*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050812;
  --card-bg: #101320;
  --accent-red: #ff5252;
  --accent-gold: #ffca28;
  --accent-green: #66bb6a;
  --accent-blue: #42a5f5;
  --accent-light: #ffe082;
  --text-main: #f5f5f5;
  --text-muted: #b0bec5;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c2540 0, #050812 55%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

/* SNOW LAYERS */
#snow-back,
#snow-front {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #ffffff;
  opacity: 0.65;
  font-size: 10px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  animation-name: snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.snowflake.small {
  font-size: 6px;
  opacity: 0.4;
}

.snowflake.big {
  font-size: 14px;
  opacity: 0.8;
}

@keyframes snow-fall {
  0% {
    transform: translate3d(0, -10px, 0);
  }
  100% {
    transform: translate3d(var(--drift, 20px), 110vh, 0);
  }
}

#app {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 12px 32px;
}

/* CARDS */
.card {
  background: rgba(8, 10, 21, 0.96);
  border-radius: 20px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
}

.hidden {
  display: none;
}

#start-screen {
  text-align: center;
  margin-top: 40px;
}

.game-title {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.tagline {
  margin: 0 auto 18px;
  max-width: 620px;
  font-size: 1rem;
  color: var(--text-muted);
}

/* BUTTONS */
.btn {
  border-radius: 999px;
  padding: 9px 18px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(135deg, #ff7043, #ffca28);
  color: #101010;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-main);
}

/* GAME HEADER */
#top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* AVATAR */
#avatar-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: #000;
  flex-shrink: 0;
}

#kevin-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  animation: kevin-idle 6s ease-in-out infinite;
}

@keyframes kevin-idle {
  0%,
  92%,
  100% {
    transform: translateY(0);
  }
  94% {
    transform: translateY(1px) scaleY(0.98);
  }
  96% {
    transform: translateY(0);
  }
}

/* KEVIN "SMIRK" EFFECT */
body.kevin-smirk #avatar-wrap {
  animation: kevin-smirk 0.6s ease-out;
}

@keyframes kevin-smirk {
  0% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
  }
  40% {
    transform: scale(1.06);
    box-shadow: 0 0 20px rgba(255, 202, 40, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
  }
}

/* HEADERS */
.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.small-title {
  margin: 0;
  font-size: 1.1rem;
}

#step-indicator {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
}

/* STORY & CHOICES */
#story-panel {
  margin-bottom: 14px;
}

#scene-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

#story-text {
  margin: 4px 0 12px;
  font-size: 0.98rem;
}

#choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}

.choice-btn {
  border-radius: 999px;
  padding: 8px 14px;
  border: none;
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.95),
    rgba(255, 202, 40, 0.95));
  color: #101010;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.choice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
}

.choice-btn.correct-locked {
  background: linear-gradient(135deg, rgba(102, 187, 106, 0.95),
    rgba(129, 212, 250, 0.95));
}

.choice-btn.disabled {
  opacity: 0.55;
  cursor: default;
}

/* FEEDBACK */
#feedback-text {
  font-size: 0.88rem;
  min-height: 1.2em;
  color: var(--text-muted);
  margin: 4px 0 6px;
}

/* CLIP PANEL */
#clip-panel {
  margin-top: 6px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(5, 7, 15, 0.92);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  min-height: 40px;
}

#clip-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

#clip-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

#clip-text {
  margin: 0;
  font-size: 0.9rem;
}

/* PROGRESS + FOOTPRINTS */
#progress-panel {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#footprints {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.footprint {
  width: 10px;
  height: 16px;
  border-radius: 50% 50% 40% 40%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(-8deg);
  opacity: 0.3;
}

.footprint.active {
  background: var(--accent-green);
  border-color: var(--accent-light);
  opacity: 1;
}

/* PROGRESS BAR */
#progress-bar-outer {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

#progress-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7043, #ff5252);
  transition: width 0.35s ease-out;
}

#progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 120px;
}

/* FINAL POLICE LIGHTS EFFECT */
body.siren-mode {
  animation: siren-bg 0.7s linear infinite;
}

@keyframes siren-bg {
  0%,
  50% {
    box-shadow: inset 0 0 0 9999px rgba(255, 0, 0, 0.08);
  }
  51%,
  100% {
    box-shadow: inset 0 0 0 9999px rgba(0, 120, 255, 0.08);
  }
}

/* CREDITS */
#credits {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: 12px;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  #app {
    padding: 14px 10px 26px;
  }
  #story-panel {
    padding: 14px 14px 16px;
  }
  .game-title {
    font-size: 1.6rem;
  }
  #avatar-wrap {
    width: 64px;
    height: 64px;
  }
}

@media (min-width: 768px) {
  #story-panel {
    padding: 18px 18px 20px;
  }
}
