/* style.css Emotica  */

/* Fredoka One = the chunky rounded font from the images */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  /* Default bg for screens that don't set their own */
  background: #0a0014;
  color: #fff;
}


/* SKY BACKGROUND*/

.sky-bg {
  background: url('assets/background.png') center center / cover no-repeat !important;
}


/* SETTINGS GEAR — opens dashboard*/

#settings-icon {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 100;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
#settings-icon:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
}


/* GLOBAL BUTTON RESET */

button {
  font-family: 'Fredoka One', cursive;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}


/* INTRO SCREEN  */

#intro-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 50px;
  text-align: center;
}

/* The big "emotica" title */
.intro-logo {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(90px, 14vw, 170px);
  color: #f5f0e8;
  /* Purple offset shadow = the chunky 3D look in the image */
  text-shadow:
    5px  5px 0 #6b52b5,
    8px  8px 0 #5a3f9e,
   -2px -2px 0 #8870cc,
    0px  0px 20px rgba(107, 82, 181, 0.4);
  line-height: 0.95;
  letter-spacing: -3px;
  font-style: italic;
}

/* PLAY button: dark purple pill with cream border */
#start-btn {
  background: #6b52b5;
  border: 4px solid #f5f0e8;
  border-radius: 60px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 32px;
  letter-spacing: 4px;
  padding: 18px 100px;
  text-transform: uppercase;
  box-shadow: 0 6px 0 rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
#start-btn:hover {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.3);
}


/* CONSENT OVERLAY*/

#consent-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#consent-box {
  position: relative;
  background: #f0e8d5;
  border: 4px solid #2a2520;
  border-radius: 28px;
  padding: 48px 44px 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 0 #2a2520;
  margin-top: 30px; 
}
/* Brown tab label on top */
#consent-box::before {
  content: 'DATA & PRIVACY';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #b05540;
  border: 4px solid #2a2520;
  border-radius: 20px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 5px 36px;
  white-space: nowrap;
  box-shadow: 0 4px 0 #2a2520;
}
#consent-box h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  color: #2a2520;
  margin-bottom: 14px;
}
#consent-box > p {
  font-size: 14px;
  color: #7c5cbf;
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 24px;
}
.consent-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
}
#consent-yes {
  background: #5bbccc;
  border: 3px solid #2a2520;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  padding: 12px 32px;
  box-shadow: 0 4px 0 #2a2520;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}
#consent-yes:hover { transform: translateY(2px); box-shadow: 0 2px 0 #2a2520; }

#consent-no {
  background: #aaa;
  border: 3px solid #2a2520;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  padding: 12px 32px;
  box-shadow: 0 4px 0 #2a2520;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.1s;
}
#consent-no:hover { transform: translateY(2px); box-shadow: 0 2px 0 #2a2520; }


/* CAMERA PROMPT  */

#camera-prompt {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-prompt-box {
  position: relative;
  background: #f0e8d5;
  border: 4px solid #2a2520;
  border-radius: 32px;
  padding: 36px 44px 44px;
  max-width: 580px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 0 #2a2520;
  margin-top: 36px; /* room for the red tab above */
}

/* Red "Permissions" pill tab sitting above the card */
#camera-prompt-box::before {
  content: 'PERMISSION';
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #b05540;
  border: 4px solid #2a2520;
  border-radius: 22px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  letter-spacing: 2px;
  padding: 7px 48px;
  white-space: nowrap;
  box-shadow: 0 4px 0 #2a2520;
}

/* White inner box that holds the text */
.cam-inner-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px 24px;
  margin: 28px 0 32px;
}
.cam-inner-box h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 28px;
  color: #7c5cbf;
  margin-bottom: 14px;
}
.cam-inner-box p {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  color: #8b5cf6;
  font-weight: 700;
  line-height: 1.9;
  text-align: center;
}

/* Two side-by-side buttons at the bottom */
.cam-buttons {
  display: flex;
  gap: 18px;
  justify-content: center;
}

/* ENABLE CAMERA: teal pill */
#prompt-enable {
  background: #5bbccc;
  border: 3px solid #2a2520;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  letter-spacing: 1px;
  padding: 15px 40px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 #2a2520;
  transition: transform 0.1s, box-shadow 0.1s;
  flex: 1;
}
#prompt-enable:hover { transform: translateY(2px); box-shadow: 0 3px 0 #2a2520; }

/* SKIP — green pill */
#prompt-skip {
  background: #6b52b5;
  border: 3px solid #2a2520;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  letter-spacing: 1px;
  padding: 15px 40px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 #2a2520;
  transition: transform 0.1s, box-shadow 0.1s;
}
#prompt-skip:hover { transform: translateY(2px); box-shadow: 0 3px 0 #2a2520; }


/* GAME SCREEN */

#game-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  flex-direction: column;
}


/* HUD BAR */

#hud {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  padding: 0 18px;
  background: #7c6ab5;
  flex-shrink: 0;
  z-index: 5;
  gap: 10px;
}

/* Shared pill style — all HUD pills use this */
.hud-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 50px;
  border: 3px solid #2a2520;
  padding: 7px 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Individual pill colors from Image 4 */
#camera-toggle        { background: #7a4f3a; }
#camera-toggle.active { background: #5bbccc; }
.hud-score-pill       { background: #c9503a; }
.hud-best-pill        { background: #d4a234; }
.hud-health-pill      { background: #5aab6e; }
.hud-mood-pill        { background: #d4678a; }
.hud-diff-pill        { background: #9580cc; border-color: #f5f0e8; }

/* Camera toggle is a button so we override its styles */
#camera-toggle {
  border-radius: 50px;
  border: 3px solid #2a2520;
  padding: 7px 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
  transition: background 0.2s;
}

/* Canvas fills everything below the HUD */
#gameCanvas {
  display: block;
  flex: 1;
  width: 100%;
}


/* CAMERA PREVIEW + HAND LANDMARK OVERLAY*/

#cam-preview {
  position: fixed;
  top: 78px;   /* HUD is 68px + 10px gap */
  right: 16px;
  width: 220px;
  height: 165px;
  border: 3px solid #2a2520;
  border-radius: 14px;
  object-fit: cover;
  z-index: 50;
  transform: scaleX(-1);
  display: none;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
}

#hand-canvas {
  position: fixed;
  top: 78px;
  right: 16px;
  width: 220px;
  height: 165px;
  z-index: 51;
  pointer-events: none;
  transform: scaleX(-1);
  display: none;
}


/* RAGEBAIT OVERLAY */

#ragebait-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 0, 0, 0);
  pointer-events: none;
  transition: background 0.4s;
  z-index: 10;
}
#ragebait-overlay.active {
  background: rgba(255, 45, 120, 0.2);
}
#ragebait-msg {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #f0e8d5;
  border: 4px solid #2a2520;
  color: #2a2520;
  padding: 22px 44px;
  border-radius: 24px;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  letter-spacing: 1px;
  z-index: 20;
  text-align: center;
  box-shadow: 0 6px 0 #2a2520;
}


/* PAUSE SCREEN*/

#pause-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
#pause-box {
  position: relative;
  background: #f0e8d5;
  border: 4px solid #2a2520;
  border-radius: 28px;
  padding: 48px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 8px 0 #2a2520;
  margin-top: 30px;
}
#pause-box::before {
  content: 'PAUSED';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #7c6ab5;
  border: 4px solid #2a2520;
  border-radius: 20px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 5px 36px;
  white-space: nowrap;
  box-shadow: 0 4px 0 #2a2520;
}
#pause-box h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 32px;
  color: #2a2520;
  margin-bottom: 10px;
}
#pause-box p {
  color: #7c5cbf;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
}
#breathe-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 188, 204, 0.4), transparent);
  border: 3px solid #5bbccc;
  margin: 0 auto 18px;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1);   opacity: 0.6; }
  50%       { transform: scale(1.4); opacity: 1;   }
}
#pause-mood-line {
  color: #888;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
}
#pause-mood { color: #5bbccc; }


/* GAME OVER SCREEN */

#gameover-screen {
  width: 100vw; height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 14px;
}
.gameover-label {
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  letter-spacing: 6px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#final-score-text {
  font-family: 'Fredoka One', cursive;
  font-size: 88px;
  color: #f5f0e8;
  text-shadow: 5px 5px 0 #6b52b5, 0 4px 24px rgba(0,0,0,0.4);
  line-height: 1;
}
#survived-text {
  font-family: 'Nunito', sans-serif;
  font-size: 19px;
  color: #f5f0e8;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
#gameover-highscore {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.gameover-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
#restart-btn {
  background: #6b52b5;
  border: 4px solid #f5f0e8;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  padding: 14px 48px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
#restart-btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.3); }

#report-btn {
  background: #5bbccc;
  border: 4px solid #f5f0e8;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  padding: 14px 48px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
#report-btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.3); }


/* SESSION REPORT SCREEN */

#report-screen {
  width: 100vw; height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  gap: 20px;
}
#report-header {
  text-align: center;
  flex-shrink: 0;
}
#report-header p {
  font-family: 'Fredoka One', cursive;
  font-size: 13px;
  letter-spacing: 5px;
  color: #f5f0e8;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
#report-header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 52px;
  color: #f5f0e8;
  text-shadow: 4px 4px 0 #6b52b5, 0 4px 20px rgba(0,0,0,0.4);
  line-height: 1;
}
#report-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  height: 420px;
}
.report-panel {
  background: rgba(240, 232, 213, 0.93);
  border: 3px solid #2a2520;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}
.chart-label {
  font-family: 'Fredoka One', cursive;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #7c5cbf;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.chart-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
}
.chart-wrapper canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}
#stats-box {
  font-size: 13px;
  overflow-y: auto;
  flex: 1;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 37, 32, 0.1);
}
.stat-row:last-child { border-bottom: none; }
.stat-label {
  color: #888;
  font-size: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.stat-value {
  color: #2a2520;
  font-family: 'Fredoka One', cursive;
  font-size: 17px;
}
.stat-value.pink   { color: #c9503a; }
.stat-value.teal   { color: #5bbccc; }
.stat-value.gold   { color: #d4a234; }
.stat-value.purple { color: #7c5cbf; }

#report-footer { flex-shrink: 0; }
#play-again-from-report {
  background: #6b52b5;
  border: 4px solid #f5f0e8;
  border-radius: 50px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  padding: 14px 56px;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
#play-again-from-report:hover { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.3); }


/* HELPER */

.subtitle {
  font-family: 'Fredoka One', cursive;
  font-size: 12px;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.glow-title {
  font-family: 'Fredoka One', cursive;
  font-size: 80px;
  color: #f5f0e8;
  text-shadow: 5px 5px 0 #6b52b5;
  margin-bottom: 14px;
  line-height: 1;
}
.tagline {
  font-size: 16px;
  color: #f5f0e8;
  font-weight: 700;
  margin-bottom: 24px;
}
