/* ============================================================
   ChronoDino — GAME.CSS
   "Can You Survive?" — Survival Decision Game
   ============================================================ */

/* ─── PAGE HERO ───────────────────────────────────────────── */
.game-hero {
  padding-top: calc(var(--header-h) + 5rem);
  padding-bottom: 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--clr-void);
}

.game-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(192,57,43,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 50%, rgba(232,160,32,0.06) 0%, transparent 55%);
  pointer-events: none;
}

.game-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  background: rgba(192,57,43,0.12);
  border: 1px solid rgba(192,57,43,0.3);
  border-radius: var(--r-pill);
  padding: 5px 18px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #e05050;
  margin-bottom: 1.5rem;
}

.game-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--clr-bone);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.game-hero h1 em {
  font-style: normal;
  color: #e74c3c;
}

.game-hero-sub {
  font-size: 1.1rem;
  color: rgba(245,234,208,.72);
  max-width: 580px;
  margin-inline: auto;
  line-height: 1.75;
}

/* ─── SETTINGS GRID ───────────────────────────────────────── */
.settings-section {
  padding-block: 5rem;
  background: var(--clr-earth);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin-inline: auto;
}

/* ── Setting Card ── */
.setting-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3/4;
  border: 2px solid transparent;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  background: var(--clr-mud);
}

.setting-card:hover:not(.coming-soon) {
  border-color: var(--clr-amber);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 40px rgba(232,160,32,.15);
}

.setting-card.coming-soon {
  cursor: not-allowed;
  filter: saturate(.3) brightness(.6);
}

.setting-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.setting-card:hover:not(.coming-soon) .setting-card-img {
  transform: scale(1.07);
}

/* image placeholder when no real image */
.setting-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: var(--clr-mud);
}

.setting-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,.92) 0%,
    rgba(0,0,0,.6) 45%,
    rgba(0,0,0,.1) 100%);
}

.setting-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
}

.setting-card-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: .4rem;
}

.setting-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--clr-bone);
  margin-bottom: .4rem;
  line-height: 1.2;
}

.setting-card-desc {
  font-size: .82rem;
  color: rgba(245,234,208,.7);
  line-height: 1.55;
}

.setting-card-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .9rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clr-amber);
}

/* Coming soon badge */
.coming-soon-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245,234,208,.5);
}

/* ─── GAME SCREEN (full-screen takeover) ──────────────────── */
#game-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--clr-void);
  overflow-y: auto;
  overflow-x: hidden;
}

#game-screen.active { display: block; }

/* ── Game top bar ── */
.game-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,8,4,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232,160,32,.1);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-topbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--clr-amber);
  flex: 1;
}

.game-exit-btn {
  background: rgba(192,57,43,.15);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e05050;
  cursor: pointer;
  transition: all .2s;
}
.game-exit-btn:hover {
  background: rgba(192,57,43,.3);
}

/* ── Stats strip ── */
.game-stats-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(232,160,32,.07);
  border: 1px solid rgba(232,160,32,.15);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 800;
  color: rgba(245,234,208,.75);
  white-space: nowrap;
  transition: background .3s, border-color .3s;
}

.stat-pill .stat-val {
  color: var(--clr-amber);
  font-size: .85rem;
}

.stat-pill.flash-up {
  background: rgba(39,174,96,.2);
  border-color: rgba(39,174,96,.5);
  color: #a8f0b0;
}

.stat-pill.flash-down {
  background: rgba(192,57,43,.2);
  border-color: rgba(192,57,43,.5);
  color: #ffaaaa;
}

/* ── Inventory strip ── */
.game-inventory-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .5rem 1.5rem;
  background: rgba(0,0,0,.3);
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-height: 38px;
}

.inventory-label {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245,234,208,.35);
  flex-shrink: 0;
}

.inventory-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(232,160,32,.08);
  border: 1px solid rgba(232,160,32,.18);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--clr-amber);
  animation: itemAppear .4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes itemAppear {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── SCENE LAYOUT ────────────────────────────────────────── */
.game-scene {
  max-width: 860px;
  margin-inline: auto;
  padding: 2.5rem 1.5rem 4rem;
  animation: sceneReveal .45s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes sceneReveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scene image ── */
.scene-image-wrap {
  width: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
  aspect-ratio: 3/2;
  background: var(--clr-mud);
  border: 1px solid rgba(232,160,32,.1);
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  background: var(--clr-mud);
  color: rgba(245,234,208,.25);
}

.scene-image-placeholder-icon { font-size: 3.5rem; }
.scene-image-placeholder-text { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* ── Atmosphere overlay on image ── */
.scene-image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, var(--clr-void) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Scene header ── */
.scene-setting-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(232,160,32,.08);
  border: 1px solid rgba(232,160,32,.2);
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: 1rem;
}

.scene-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  color: var(--clr-bone);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.scene-text {
  font-size: 1.08rem;
  color: rgba(245,234,208,.88);
  line-height: 1.9;
  margin-bottom: 2.5rem;
  white-space: pre-line;
}

/* ─── CHOICES ─────────────────────────────────────────────── */
.choices-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(245,234,208,.35);
  margin-bottom: 1rem;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.choice-btn {
  background: var(--clr-mud);
  border: 2px solid rgba(232,160,32,.12);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.4rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-bone);
  line-height: 1.5;
  transition: all .2s ease;
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(232,160,32,.06) 0%, transparent 100%);
  opacity: 0;
  transition: opacity .2s;
}

.choice-btn:hover:not(:disabled)::before { opacity: 1; }

.choice-btn:hover:not(:disabled) {
  border-color: var(--clr-amber);
  background: rgba(232,160,32,.06);
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.choice-btn:disabled { cursor: default; }

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(232,160,32,.1);
  border: 1px solid rgba(232,160,32,.2);
  font-size: .78rem;
  font-weight: 900;
  color: var(--clr-amber);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .2s;
}

.choice-btn:hover:not(:disabled) .choice-letter {
  background: var(--clr-amber);
  color: var(--clr-void);
}

/* ── Feedback banner after choice ── */
.choice-feedback {
  margin-top: 1.25rem;
  border-radius: var(--r-md);
  padding: .9rem 1.25rem;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.6;
  display: none;
  animation: feedbackPop .35s cubic-bezier(.22,1,.36,1);
}

@keyframes feedbackPop {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.choice-feedback.neutral {
  display: block;
  background: rgba(232,160,32,.08);
  border: 1px solid rgba(232,160,32,.2);
  color: rgba(245,234,208,.85);
}

.choice-feedback.positive {
  display: block;
  background: rgba(39,174,96,.12);
  border: 1px solid rgba(39,174,96,.3);
  color: #a8f0b0;
}

.choice-feedback.negative {
  display: block;
  background: rgba(192,57,43,.12);
  border: 1px solid rgba(192,57,43,.3);
  color: #ffbbbb;
}

.game-continue-btn {
  margin-top: 1.5rem;
  display: none;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--clr-amber);
  color: var(--clr-void);
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.game-continue-btn.visible { display: block; }
.game-continue-btn:hover { background: #ffcc55; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,160,32,.3); }

/* ─── ENDING SCREENS ──────────────────────────────────────── */
.game-ending {
  max-width: 780px;
  margin-inline: auto;
  padding: 3rem 1.5rem 5rem;
  text-align: center;
  animation: sceneReveal .5s cubic-bezier(.22,1,.36,1) forwards;
}

/* SURVIVED */
.ending-survived .ending-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 40%, rgba(39,174,96,.15) 0%, transparent 60%);
  animation: glowPulse 3s ease-in-out infinite;
}

/* NOT SURVIVED */
.ending-not-survived .ending-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 40%, rgba(192,57,43,.12) 0%, transparent 60%);
}

@keyframes glowPulse {
  0%,100% { opacity: .8; } 50% { opacity: 1.2; }
}

/* ── Ending image ── */
.ending-image-wrap {
  width: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/6;
  position: relative;
  border: 2px solid transparent;
  transition: border-color .5s;
}

.ending-survived .ending-image-wrap { border-color: rgba(39,174,96,.4); }
.ending-not-survived .ending-image-wrap { border-color: rgba(192,57,43,.35); }

.ending-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Ending icon/emblem ── */
.ending-emblem {
  font-size: 5.5rem;
  display: block;
  margin-bottom: 1rem;
  animation: emblemDrop .7s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes emblemDrop {
  from { transform: translateY(-40px) scale(.5) rotate(-20deg); opacity: 0; }
  to   { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

/* ── Outcome badge ── */
.outcome-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: var(--r-pill);
  padding: 6px 22px;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.outcome-badge.survived {
  background: rgba(39,174,96,.18);
  border: 2px solid rgba(39,174,96,.5);
  color: #5aba6e;
}

.outcome-badge.not-survived {
  background: rgba(192,57,43,.18);
  border: 2px solid rgba(192,57,43,.5);
  color: #e05050;
}

/* ── Ending title ── */
.ending-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.ending-survived .ending-title { color: #a8f0b0; }
.ending-not-survived .ending-title { color: #ffaaaa; }

.ending-story {
  font-size: 1.05rem;
  color: rgba(245,234,208,.88);
  line-height: 1.85;
  margin-bottom: 2rem;
  white-space: pre-line;
}

/* ── Score display ── */
.ending-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ending-score-block {
  background: var(--clr-mud);
  border: 1px solid rgba(232,160,32,.15);
  border-radius: var(--r-lg);
  padding: 1.1rem 2rem;
  text-align: center;
}

.ending-score-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--clr-amber);
  display: block;
  line-height: 1;
}

.ending-score-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245,234,208,.45);
  display: block;
  margin-top: .25rem;
}

/* ── Final stats display ── */
.ending-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}

.ending-stat-card {
  background: var(--clr-mud);
  border: 1px solid rgba(232,160,32,.1);
  border-radius: var(--r-md);
  padding: .85rem .75rem;
  text-align: center;
}

.ending-stat-val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  display: block;
  line-height: 1;
  margin-bottom: .2rem;
}

.ending-survived .ending-stat-val   { color: #5aba6e; }
.ending-not-survived .ending-stat-val { color: #e05050; }

.ending-stat-name {
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245,234,208,.45);
}

/* ── Survival lesson box ── */
.survival-lesson {
  background: rgba(232,160,32,.07);
  border: 1px solid rgba(232,160,32,.2);
  border-left: 4px solid var(--clr-amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.25rem 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
}

.survival-lesson-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: .5rem;
}

.survival-lesson-text {
  font-size: .98rem;
  color: rgba(245,234,208,.85);
  line-height: 1.7;
}

/* ── Epilogue (island win) ── */
.ending-epilogue {
  background: var(--clr-mud);
  border: 1px solid rgba(232,160,32,.12);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
}

.ending-epilogue-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--clr-amber);
  margin-bottom: .75rem;
}

.ending-epilogue p {
  font-size: .9rem;
  color: rgba(245,234,208,.78);
  line-height: 1.75;
  margin-bottom: .5rem;
}

.ending-epilogue p:last-child { margin-bottom: 0; }

/* ── Ending buttons ── */
.ending-btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.game-btn-primary {
  background: var(--clr-amber);
  color: var(--clr-void);
  border: none;
  border-radius: var(--r-pill);
  padding: .9rem 2.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
}

.game-btn-primary:hover { background: #ffcc55; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,160,32,.3); }

.game-btn-secondary {
  background: transparent;
  color: var(--clr-bone);
  border: 2px solid rgba(232,160,32,.25);
  border-radius: var(--r-pill);
  padding: .9rem 2.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
}

.game-btn-secondary:hover { border-color: var(--clr-amber); color: var(--clr-amber); }

/* ─── SPECIAL MOMENT OVERLAYS ─────────────────────────────── */
/* Shake on bad choice */
@keyframes sceneShake {
  0%,100% { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(8px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
}

.scene-shake { animation: sceneShake .5s ease forwards; }

/* Brilliant moment flash */
@keyframes brilliantFlash {
  0%   { opacity: 0; }
  20%  { opacity: .6; }
  100% { opacity: 0; }
}

.brilliant-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,230,50,.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  animation: brilliantFlash .8s ease forwards;
}

/* Tension vignette */
.tension-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: radial-gradient(ellipse at 50% 50%,
    transparent 40%, rgba(192,57,43,.18) 70%, rgba(0,0,0,.5) 100%);
  opacity: 0;
  transition: opacity 1s;
}

.tension-vignette.active { opacity: 1; }

/* ── Trait award toast ── */
.trait-toast {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 5000;
  background: rgba(10,8,4,.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232,160,32,.25);
  border-radius: var(--r-lg);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 240px;
  animation: toastIn .4s cubic-bezier(.22,1,.36,1) forwards;
  pointer-events: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

.trait-toast-icon { font-size: 1.6rem; }
.trait-toast-title {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: .1rem;
}
.trait-toast-name {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--clr-bone);
}

/* ── Critical mistake flash ── */
@keyframes criticalFlash {
  0%,100% { opacity: 0; }
  20%,60% { opacity: 1; }
}

.critical-flash {
  position: fixed;
  inset: 0;
  background: rgba(192,57,43,.25);
  pointer-events: none;
  z-index: 9999;
  animation: criticalFlash .6s ease forwards;
}

/* ─── AUDIO BAR (in-game) ─────────────────────────────────── */
.game-audio-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
}

.game-audio-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(232,160,32,.1);
  border: 1px solid rgba(232,160,32,.2);
  color: var(--clr-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
}
.game-audio-btn:hover { background: rgba(232,160,32,.22); }

.game-audio-vol {
  accent-color: var(--clr-amber);
  width: 60px;
  cursor: pointer;
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
  .setting-card { aspect-ratio: 4/3; }
  .game-topbar { padding: .6rem 1rem; gap: .5rem; }
  .game-scene { padding: 1.5rem 1rem 3rem; }
  .ending-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-pill { font-size: .65rem; }
  .game-stats-bar { gap: .35rem; }
}

/* ─── TIMER ────────────────────────────────────────────────── */
.scene-timer-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding: .75rem 1.1rem;
  background: rgba(192,57,43,.08);
  border: 1px solid rgba(192,57,43,.25);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}

.scene-timer-track {
  position: absolute;
  inset: 0;
  transform-origin: left;
  background: rgba(192,57,43,.12);
  transition: transform .5s linear, background .5s;
}

.scene-timer-wrap.timer-critical .scene-timer-track { background: rgba(192,57,43,.3); }
.scene-timer-wrap.timer-out     .scene-timer-track { background: rgba(192,57,43,.5); }

.scene-timer-icon {
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.scene-timer-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #e05050;
  position: relative;
  z-index: 1;
}

.scene-timer-count {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #e05050;
  line-height: 1;
  margin-left: auto;
  position: relative;
  z-index: 1;
  transition: color .3s;
  min-width: 2.5rem;
  text-align: right;
}

.scene-timer-count.urgent { color: #ff3333; animation: timerPulse .4s ease-in-out infinite; }

@keyframes timerPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.timer-timeout-flash {
  position: fixed;
  inset: 0;
  background: rgba(192,57,43,.4);
  z-index: 9999;
  pointer-events: none;
  animation: timeoutFlash .8s ease forwards;
}

@keyframes timeoutFlash {
  0%,50% { opacity: 1; } 100% { opacity: 0; }
}

/* ─── NAME INPUT SCREEN ───────────────────────────────────── */
.game-input-screen {
  max-width: 620px;
  margin-inline: auto;
  padding: 2.5rem 1.5rem 4rem;
  animation: sceneReveal .45s cubic-bezier(.22,1,.36,1) forwards;
}

.game-input-intro {
  font-size: 1.05rem;
  color: rgba(245,234,208,.88);
  line-height: 1.85;
  margin-bottom: 2rem;
  white-space: pre-line;
}

.name-input-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.name-input-row {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.name-input-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-amber);
}

.name-input-field {
  background: var(--clr-mud);
  border: 2px solid rgba(232,160,32,.15);
  border-radius: var(--r-md);
  padding: .75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-bone);
  width: 100%;
  transition: border-color .2s, background .2s;
}

.name-input-field::placeholder { color: rgba(245,234,208,.3); }
.name-input-field:focus {
  outline: none;
  border-color: var(--clr-amber);
  background: rgba(232,160,32,.06);
}

/* ─── ROUTER TRANSITION ───────────────────────────────────── */
.router-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--clr-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: routerFadeIn .4s ease forwards;
}

@keyframes routerFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

.router-overlay-icon { font-size: 3rem; animation: routerSpin 1.5s linear infinite; }
@keyframes routerSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.router-overlay-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--clr-amber);
  text-align: center;
}

/* ─── FRIEND STATUS STRIP ─────────────────────────────────── */
.friend-status-bar {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .4rem 1.5rem;
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-height: 34px;
}

.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: var(--r-pill);
  padding: 2px 10px;
  font-size: .68rem;
  font-weight: 800;
  transition: all .3s;
}

.friend-chip.alive {
  background: rgba(39,174,96,.1);
  border: 1px solid rgba(39,174,96,.25);
  color: #5aba6e;
}

.friend-chip.dead {
  background: rgba(192,57,43,.1);
  border: 1px solid rgba(192,57,43,.25);
  color: #e05050;
  text-decoration: line-through;
  opacity: .65;
}

/* ─── LEGAL CONSEQUENCE ENDING ────────────────────────────── */
.ending-legal-box {
  background: rgba(232,160,32,.06);
  border: 1px solid rgba(232,160,32,.18);
  border-left: 4px solid var(--clr-amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.25rem 1.5rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.ending-legal-title {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-amber);
  margin-bottom: .75rem;
}

.ending-legal-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  color: rgba(245,234,208,.78);
  padding: .35rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.ending-legal-row:last-child { border-bottom: none; }
.ending-legal-row strong { color: var(--clr-bone); }

/* ─── PARK MAP IMAGE IN INVENTORY ─────────────────────────── */
.park-map-preview {
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: .75rem;
  border: 1px solid rgba(232,160,32,.2);
  cursor: pointer;
  transition: transform .2s;
}

.park-map-preview:hover { transform: scale(1.02); }
.park-map-preview img { width: 100%; display: block; }

/* ─── BLINDED EFFECT ──────────────────────────────────────── */
.blinded-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(0,0,0,.75);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blinded-overlay-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: rgba(255,200,100,.7);
  text-align: center;
  padding: 2rem;
  background: rgba(192,57,43,.2);
  border: 1px solid rgba(192,57,43,.4);
  border-radius: var(--r-xl);
}

/* ─── AGE GATE / CONTENT WARNING MODAL ─────────────────────── */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: ageGateFadeIn .35s ease forwards;
}

@keyframes ageGateFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.age-gate-overlay.age-gate-hidden {
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}

.age-gate-modal {
  max-width: 520px;
  width: 100%;
  background: var(--clr-void);
  border: 2px solid rgba(232,160,32,.2);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,.8), 0 0 60px rgba(232,160,32,.06);
  animation: ageGateModalIn .4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes ageGateModalIn {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.age-gate-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: ageGatePulse 1.5s ease-in-out infinite;
}

@keyframes ageGatePulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.1); }
}

.age-gate-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #e74c3c;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.age-gate-text {
  font-size: .92rem;
  color: rgba(245,234,208,.82);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.age-gate-confirm {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-bone);
  margin-bottom: 2rem;
}

.age-gate-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.age-gate-btn {
  padding: .85rem 2rem;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  border: none;
  min-width: 140px;
}

.age-gate-btn-back {
  background: transparent;
  color: var(--clr-bone);
  border: 2px solid rgba(232,160,32,.25);
}

.age-gate-btn-back:hover {
  border-color: var(--clr-amber);
  color: var(--clr-amber);
  transform: translateY(-2px);
}

.age-gate-btn-proceed {
  background: var(--clr-amber);
  color: var(--clr-void);
  border: 2px solid var(--clr-amber);
}

.age-gate-btn-proceed:hover {
  background: #ffcc55;
  border-color: #ffcc55;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,160,32,.3);
}

/* ─── GATE-BLOCKED: prevent clicks on settings grid ─── */
.settings-section.gate-blocked .setting-card {
  cursor: default;
  pointer-events: none;
}

@media (max-width: 600px) {
  .age-gate-modal {
    padding: 2rem 1.25rem;
  }
  .age-gate-title {
    font-size: 1.3rem;
  }
  .age-gate-icon {
    font-size: 2.8rem;
  }
  .age-gate-btn {
    min-width: 120px;
    padding: .75rem 1.5rem;
    font-size: .9rem;
  }
}
