/* ============================================================
   games.css — game shell + five anomalies + room 00
   ============================================================ */

.game-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--void);
  visibility: hidden; opacity: 0;
  transition: opacity .35s var(--ease), visibility .35s;
}
.game-overlay.is-open { visibility: visible; opacity: 1; }
.game-shell {
  height: 100dvh; display: flex; flex-direction: column;
  background: #080a0c; position: relative; overflow: hidden;
}
.game-bar {
  flex: 0 0 62px; display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(8,10,12,.86); backdrop-filter: blur(14px);
  position: relative; z-index: 30;
}
.game-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--muted);
  border: 1px solid var(--line); height: 32px; padding: 0 10px;
  transition: color .2s, border-color .2s;
}
.game-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.game-back:hover { color: var(--acid); border-color: rgba(216,255,79,.4); }
.game-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.game-title .mono { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.game-title strong { font-family: var(--serif); font-size: 18px; letter-spacing: .04em; white-space: nowrap; }
.game-hud { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.hud-chip {
  display: inline-flex; align-items: baseline; gap: 7px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); background: rgba(242,239,228,.02);
  font-family: var(--mono); font-size: 9px; color: var(--muted-2);
  white-space: nowrap;
}
.hud-chip b { font-weight: 500; color: var(--paper-dim); font-size: 10px; letter-spacing: .03em; }
.hud-chip--hot b { color: var(--acid); }
.game-tools { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.game-pause { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 1px solid var(--line); font-family: var(--mono); font-size: 9px; color: var(--muted); transition: color .2s, border-color .2s; }
.game-pause kbd { border: 1px solid var(--line); padding: 1px 4px; font-size: 7px; color: var(--muted-2); }
.game-pause:hover { color: var(--paper); border-color: var(--paper-dim); }
.game-pause:disabled, .game-pause.is-disabled { opacity: .28; cursor: default; }
.game-host { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.game-foot {
  flex: 0 0 34px; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 0 clamp(14px, 2.4vw, 28px); border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 8px; letter-spacing: .06em; color: var(--muted-2);
  background: rgba(8,10,12,.8); position: relative; z-index: 20;
}
.game-foot #gameHint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-foot #gameDaily { color: var(--acid); white-space: nowrap; }

.game-pause-screen, .result-screen {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(5,6,8,.78); backdrop-filter: blur(14px);
  animation: fade-in .25s ease;
}
.game-pause-screen[hidden], .result-screen[hidden] { display: none; }
.pause-card {
  width: min(430px, 100%); background: #0d1013; border: 1px solid var(--line);
  padding: clamp(26px, 4vw, 42px);
}
.pause-card > .mono { color: var(--acid); }
.pause-card h2 { font-family: var(--serif); font-size: clamp(30px, 5vw, 44px); line-height: 1.1; margin: 18px 0 10px; letter-spacing: -.03em; }
.pause-card p { color: var(--muted); font-size: 12px; }
.pause-card__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; }

.result-card {
  width: min(590px, 100%); background: #0d1013; border: 1px solid rgba(242,239,228,.2);
  padding: clamp(24px, 4vw, 42px); position: relative; overflow: hidden;
  animation: result-up .55s var(--ease);
}
.result-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--acid), transparent);
}
.result-card__top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted-2); }
.result-card__top .mono:first-child { color: var(--acid); }
.result-card h2 { font-family: var(--serif); font-size: clamp(29px, 4.5vw, 44px); line-height: 1.1; letter-spacing: -.035em; margin: 17px 0 9px; }
.result-card > p { color: var(--muted); font-size: 12px; line-height: 1.75; max-width: 420px; }
.result-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-score .mono { color: var(--muted-2); font-size: 8px; padding-bottom: 7px; }
.result-score strong { font-family: var(--mono); font-size: clamp(38px, 7vw, 64px); line-height: .9; font-weight: 400; letter-spacing: -.06em; color: var(--acid); }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 1px; background: var(--line-soft); margin-top: 18px; }
.result-stats > div { background: #0d1013; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.result-stats span { font-family: var(--mono); font-size: 7px; color: var(--muted-2); letter-spacing: .08em; }
.result-stats b { font-family: var(--mono); font-size: 15px; font-weight: 400; color: var(--paper-dim); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.result-actions .btn { min-height: 42px; }
.result-card__foot { margin-top: 20px; font-size: 8px; color: var(--muted-2); letter-spacing: .06em; }
@keyframes result-up { from { opacity: 0; transform: translateY(20px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.game-loading {
  position: absolute; inset: 62px 0 34px; z-index: 40; display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center; background: #080a0c;
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--muted);
  transition: opacity .3s;
}
.game-loading[hidden] { display: none; }
.game-loading i { width: 90px; height: 1px; background: rgba(242,239,228,.1); overflow: hidden; position: relative; }
.game-loading i::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--acid); animation: load-slide 1s var(--ease-in-out) infinite; }
@keyframes load-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* share start screen */
.game-start {
  position: absolute; inset: 0; z-index: 25;
  display: grid; place-items: center; padding: clamp(18px, 4vw, 40px);
  background:
    radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--game-accent, var(--acid)) 8%, transparent), transparent 58%),
    linear-gradient(180deg, rgba(8,10,12,.25), rgba(8,10,12,.88));
}
.game-start__card { width: min(580px, 100%); text-align: left; }
.game-start__card > .mono { color: var(--game-accent, var(--acid)); }
.game-start__card h2 {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 58px); line-height: 1.06;
  letter-spacing: -.045em; margin: 14px 0 14px;
}
.game-start__card h2 em { font-style: normal; color: var(--game-accent, var(--acid)); }
.game-start__card p { color: var(--muted); font-size: 12px; line-height: 1.85; max-width: 470px; }
.game-start__controls { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 24px 0; padding: 16px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.ctrl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 8px; letter-spacing: .06em; color: var(--muted); }
.ctrl kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid var(--line); background: rgba(242,239,228,.03);
  font-family: var(--mono); font-size: 8px; color: var(--paper-dim);
}
.game-start__cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.game-start__note { font-family: var(--mono); font-size: 8px; color: var(--muted-2); letter-spacing: .06em; }

/* ============================================================
   01 GRAVITY
   ============================================================ */
.grav-wrap { position: absolute; inset: 0; background: #05080b; }
.grav-wrap canvas { width: 100%; height: 100%; touch-action: none; }
.grav-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 8px; letter-spacing: .12em; color: rgba(242,239,228,.4);
  white-space: nowrap; pointer-events: none;
}
.grav-hint b { color: var(--acid); font-weight: 400; }
.grav-status {
  position: absolute; left: 18px; top: 16px; z-index: 2; display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: var(--muted);
  pointer-events: none;
}
.grav-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); }
.grav-lives { position: absolute; right: 18px; top: 14px; display: flex; gap: 6px; z-index: 2; pointer-events: none; }
.grav-lives i { width: 7px; height: 7px; border: 1px solid rgba(216,255,79,.7); transform: rotate(45deg); }
.grav-lives i.is-out { opacity: .2; }
.grav-wrap .game-start { background: radial-gradient(ellipse at 50% 45%, rgba(216,255,79,.06), transparent 55%), rgba(5,8,11,.72); }

/* ============================================================
   02 LEXICON
   ============================================================ */
.lex {
  --lex-bg: #0d0b12;
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 75% 20%, rgba(182,164,255,.075), transparent 50%),
    radial-gradient(ellipse at 12% 90%, rgba(243,202,114,.045), transparent 45%),
    var(--lex-bg);
  color: #eee8dd; overflow: hidden;
}
.lex-top {
  flex: 0 0 auto; display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 2.6vw, 30px); border-bottom: 1px solid rgba(238,232,221,.1);
}
.lex-goal { display: flex; align-items: baseline; gap: 11px; min-width: 0; }
.lex-goal .mono { color: var(--gold); font-size: 8px; white-space: nowrap; }
.lex-goal strong { font-family: var(--serif); font-size: clamp(18px, 2.2vw, 26px); font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.lex-goal strong em { color: var(--gold); font-style: normal; }
.lex-progress { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.lex-progress span { font-family: var(--mono); font-size: 8px; color: rgba(238,232,221,.4); letter-spacing: .1em; }
.lex-progress b { font-family: var(--mono); font-size: 14px; font-weight: 400; color: var(--gold); }
.lex-progress i { width: 110px; height: 1px; background: rgba(238,232,221,.12); position: relative; overflow: hidden; }
.lex-progress i::after { content: ""; position: absolute; inset: 0; width: var(--p,0%); background: var(--gold); transition: width .8s var(--ease); }

.lex-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.lex-bank { position: relative; min-height: 0; display: flex; flex-direction: column; padding: 18px clamp(16px, 2.6vw, 30px) 12px; border-right: 1px solid rgba(238,232,221,.09); overflow: hidden; }
.lex-bank::before { content: "词"; position: absolute; right: 4%; bottom: -9%; font-family: var(--serif); font-size: min(48vw, 420px); line-height: 1; color: rgba(243,202,114,.028); pointer-events: none; }
.lex-bank__note { position: relative; z-index: 1; flex: 0 0 auto; display: flex; align-items: baseline; gap: 14px; padding-top: 14px; border-top: 1px solid rgba(238,232,221,.08); margin-top: 8px; }
.lex-bank__note .mono { color: rgba(238,232,221,.28); font-size: 7px; white-space: nowrap; }
.lex-bank__note p { font-family: var(--serif); font-size: 11px; color: rgba(238,232,221,.42); }
.lex-bank__note b { color: var(--gold); font-weight: 500; }
.lex .game-start { background: radial-gradient(ellipse at 50% 45%, rgba(243,202,114,.06), transparent 52%), rgba(13,11,18,.92); backdrop-filter: blur(4px); }
.lex-bank__head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; }
.lex-bank__head h3 { font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.lex-bank__head .mono { font-size: 8px; color: rgba(238,232,221,.35); }
.lex-search {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid rgba(238,232,221,.16); padding: 3px 0; width: min(150px, 30%);
}
.lex-search svg { width: 11px; height: 11px; stroke: rgba(238,232,221,.4); fill: none; stroke-width: 1.4; }
.lex-search input { width: 100%; border: 0; outline: 0; background: none; font-family: var(--mono); font-size: 9px; color: #eee8dd; }
.lex-search input::placeholder { color: rgba(238,232,221,.26); }
.lex-words { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 4px 4px 22px 0; scrollbar-width: thin; }
.lex-word {
  position: relative; min-width: 64px; height: 64px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(238,232,221,.16);
  background: rgba(238,232,221,.025);
  font-family: var(--serif); font-size: 22px; letter-spacing: .06em; color: #eee8dd;
  transition: transform .25s var(--ease), border-color .2s, background .2s, color .2s;
}
.lex-word::after {
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 3px; height: 3px; border-radius: 50%;
  transform: translateX(-50%); background: var(--tone, var(--gold)); opacity: .7;
}
.lex-word:hover { border-color: var(--tone, var(--gold)); background: rgba(243,202,114,.07); transform: translateY(-3px); }
.lex-word.is-selected { border-color: var(--tone, var(--gold)); color: var(--gold); background: rgba(243,202,114,.1); }
.lex-word.is-new { animation: word-pop .7s var(--ease); }
.lex-word[data-tier="1"] { color: #d8c9ff; border-color: rgba(182,164,255,.26); }
.lex-word[data-tier="2"] { color: #a9f4e8; border-color: rgba(114,246,223,.22); }
.lex-word[data-tier="3"] { color: #f3ca72; border-color: rgba(243,202,114,.34); }
.lex-word[data-tier="4"] { color: #0c0a0f; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.lex-word--long { font-size: 18px; }
@keyframes word-pop { 0% { transform: scale(.8); box-shadow: 0 0 0 10px rgba(243,202,114,.18); } 100% { transform: none; box-shadow: 0 0 0 0 transparent; } }

.lex-forge {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  padding: clamp(18px, 2.6vw, 28px); overflow-y: auto;
  background: rgba(0,0,0,.16);
}
.lex-forge__label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lex-forge__label .mono { font-size: 8px; color: rgba(238,232,221,.35); }
.lex-forge__label span { font-family: var(--serif); font-size: 13px; color: rgba(238,232,221,.7); }
.lex-cauldron {
  position: relative; margin: 16px 0 12px; padding: 22px 14px;
  border: 1px solid rgba(243,202,114,.23);
  background:
    radial-gradient(circle at 50% 50%, rgba(243,202,114,.1), transparent 65%),
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(243,202,114,.028) 10px, transparent 11px);
}
.lex-cauldron::before, .lex-cauldron::after {
  content: ""; position: absolute; width: 7px; height: 7px; border: 1px solid var(--gold); opacity: .65;
}
.lex-cauldron::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.lex-cauldron::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.lex-slots { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lex-slot {
  width: min(94px, 24vw); aspect-ratio: 1; border: 1px dashed rgba(238,232,221,.26);
  display: grid; place-items: center; font-family: var(--serif); font-size: 27px; color: #eee8dd;
  background: rgba(0,0,0,.16); transition: border-color .2s, background .2s, transform .2s;
}
.lex-slot:hover { border-color: rgba(243,202,114,.6); }
.lex-slot.is-filled { border-style: solid; border-color: rgba(243,202,114,.55); background: rgba(243,202,114,.08); color: var(--gold); }
.lex-slot.is-target { animation: slot-pulse 1.4s infinite; }
.lex-slot span { font-family: var(--mono); font-size: 8px; color: rgba(238,232,221,.28); letter-spacing: .1em; }
.lex-slots > em { font-family: var(--serif); font-size: 18px; color: rgba(238,232,221,.35); font-style: normal; }
@keyframes slot-pulse { 50% { border-color: var(--gold); background: rgba(243,202,114,.12); } }
.lex-combine {
  width: 100%; height: 42px; margin-top: 15px; border: 1px solid var(--gold);
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: #0c0a0f; background: var(--gold);
  transition: background .2s, color .2s, opacity .2s;
}
.lex-combine:hover { background: #ffe2a1; }
.lex-combine:disabled { background: transparent; color: rgba(243,202,114,.34); border-color: rgba(243,202,114,.18); opacity: 1; cursor: not-allowed; }
.lex-message {
  min-height: 42px; font-family: var(--serif); font-size: 12px; line-height: 1.7;
  color: rgba(238,232,221,.68); padding: 4px 2px;
}
.lex-message.is-good { color: var(--gold); }
.lex-message.is-bad { color: #ff9c88; }
.lex-message.is-whisper { color: #d8c9ff; font-style: italic; }
.lex-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(238,232,221,.09); }
.lex-hint { font-family: var(--mono); font-size: 8px; letter-spacing: .08em; color: #d8c9ff; border-bottom: 1px solid rgba(182,164,255,.35); padding: 3px 0; }
.lex-hint:hover { color: #fff; border-color: #fff; }
.lex-hint-count { font-family: var(--mono); font-size: 7px; color: rgba(238,232,221,.26); }
.lex-log { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.lex-log p { font-family: var(--mono); font-size: 8px; line-height: 1.8; color: rgba(238,232,221,.32); }
.lex-log p b { color: rgba(243,202,114,.75); font-weight: 400; }
.lex-whisper {
  position: fixed; pointer-events: none; z-index: 45; background: #1a1620; border: 1px solid rgba(243,202,114,.25);
  color: #eee8dd; font-family: var(--serif); font-size: 11px; line-height: 1.6; padding: 8px 11px; max-width: 240px;
  opacity: 0; transform: translate(-50%, -120%); transition: opacity .15s;
}
.lex-whisper.is-on { opacity: 1; }
.lex-finale {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse at 50% 75%, rgba(255,186,113,.4), transparent 55%),
    linear-gradient(180deg, #0b0910 0%, #2a1b26 55%, #d58b64 100%);
  animation: dawn 1.4s var(--ease);
  text-align: center;
}
.lex-finale__inner { max-width: 620px; }
.lex-finale .mono { color: rgba(255,245,230,.6); }
.lex-finale h2 { font-family: var(--serif); font-size: clamp(58px, 13vw, 120px); line-height: .95; letter-spacing: -.07em; margin: 18px 0 20px; color: #fff3df; text-shadow: 0 0 60px rgba(255,240,210,.3); }
.lex-finale p { font-family: var(--serif); color: rgba(255,245,230,.78); font-size: 14px; line-height: 2; max-width: 480px; margin: 0 auto; }
.lex-finale .btn { margin-top: 30px; }
@keyframes dawn { from { opacity: 0; filter: brightness(.3); } }

@media (max-width: 900px) {
  .lex-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
  .lex-forge { order: -1; border-bottom: 1px solid rgba(238,232,221,.09); overflow: visible; padding: 13px 16px 14px; }
  .lex-bank { border-right: 0; padding: 12px 16px 8px; }
  .lex-bank__note { margin-top: 6px; padding-top: 8px; }
  .lex-bank__note .mono { display: none; }
  .lex-forge__label { display: none; }
  .lex-cauldron { margin: 0 0 8px; padding: 10px; display: flex; align-items: center; gap: 12px; }
  .lex-slots { flex: 1; gap: 7px; }
  .lex-slot { width: 54px; font-size: 21px; }
  .lex-combine { width: auto; min-width: 96px; height: 54px; margin-top: 0; }
  .lex-message { min-height: 32px; padding: 0; }
  .lex-actions { padding-top: 6px; }
  .lex-log { display: none; }
  .lex-goal strong { font-size: 19px; }
  .lex-progress i { width: 60px; }
  .lex-word { min-width: 54px; height: 54px; font-size: 19px; padding: 0 9px; }
  .lex-word--long { font-size: 15px; }
}
@media (max-width: 560px) {
  .lex-top { padding: 10px 14px; gap: 10px; }
  .lex-goal { gap: 7px; }
  .lex-goal .mono { display: none; }
  .lex-goal strong { font-size: 17px; }
  .lex-progress > span:first-child { display: none; }
  .lex-progress i { width: 48px; }
  .lex-bank__head h3 { font-size: 13px; }
  .lex-bank__head .mono { display: none; }
  .lex-search { width: 100px; }
  .lex-words { gap: 6px; }
  .lex-word { min-width: 48px; height: 48px; font-size: 17px; }
  .lex-slot { width: 48px; font-size: 19px; }
  .lex-combine { min-width: 80px; height: 48px; font-size: 8px; }
}

/* ============================================================
   03 ECHO
   ============================================================ */
.echo-wrap { position: absolute; inset: 0; background: #05070b; overflow: hidden; }
.echo-wrap canvas { width: 100%; height: 100%; touch-action: none; }
.echo-hud {
  position: absolute; left: clamp(12px, 2vw, 24px); right: clamp(12px, 2vw, 24px); top: 12px;
  display: flex; gap: 7px; flex-wrap: wrap; pointer-events: none; z-index: 3;
}
.echo-stat { background: rgba(5,7,11,.52); border: 1px solid rgba(114,246,223,.15); padding: 7px 10px; backdrop-filter: blur(8px); min-width: 78px; }
.echo-stat span { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: rgba(114,246,223,.55); }
.echo-stat b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 400; color: #d8fff8; margin-top: 2px; font-variant-numeric: tabular-nums; }
.echo-stat--lap b { color: var(--cyan); }
.echo-center-msg {
  position: absolute; left: 50%; top: 20%; transform: translateX(-50%); z-index: 4;
  font-family: var(--serif); font-size: clamp(18px, 3.2vw, 30px); color: var(--cyan);
  text-shadow: 0 0 30px rgba(114,246,223,.35); opacity: 0; transition: opacity .4s; white-space: nowrap;
  pointer-events: none;
}
.echo-center-msg.is-on { opacity: 1; }
.echo-count {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; pointer-events: none;
  font-family: var(--serif); font-size: clamp(100px, 22vw, 230px); line-height: 1; color: var(--cyan);
  text-shadow: 0 0 70px rgba(114,246,223,.35); opacity: 0; transform: scale(1.4);
}
.echo-count.is-on { animation: countdown-pop .85s var(--ease); }
@keyframes countdown-pop { 0% { opacity: 0; transform: scale(1.5); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.8); } }
.echo-touch { position: absolute; inset: auto 0 0; z-index: 2; display: none; justify-content: space-between; padding: 12px; pointer-events: none; }
.echo-touch button {
  pointer-events: auto; width: 74px; height: 54px; border: 1px solid rgba(114,246,223,.28);
  background: rgba(5,7,11,.5); color: var(--cyan); font-size: 18px; backdrop-filter: blur(8px);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.echo-touch button:active { background: rgba(114,246,223,.15); }
.echo-wrap .game-start { background: radial-gradient(ellipse at 50% 50%, rgba(114,246,223,.07), transparent 55%), rgba(5,7,11,.82); }
@media (max-width: 900px) {
  .echo-touch { display: flex; }
  .echo-stat { min-width: 66px; padding: 5px 8px; }
  .echo-stat b { font-size: 12px; }
}
@media (max-width: 560px) {
  .echo-hud { top: 8px; gap: 5px; }
  .echo-stat { min-width: 58px; padding: 4px 7px; }
  .echo-stat b { font-size: 11px; }
  .echo-stat span { font-size: 6px; }
}

/* ============================================================
   04 BUTTON
   ============================================================ */
.button-game {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255,79,79,.115), transparent 46%),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(242,239,228,.025) 60px),
    #0a0709;
  overflow: hidden; user-select: none;
}
.button-game__timer { position: absolute; top: clamp(18px, 4vh, 44px); left: 50%; transform: translateX(-50%); text-align: center; z-index: 3; }
.button-game__timer span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: .2em; color: rgba(255,180,160,.45); }
.button-game__timer strong { display: block; font-family: var(--mono); font-size: clamp(30px, 5vw, 48px); font-weight: 300; letter-spacing: -.04em; color: #ffe4db; line-height: 1.2; font-variant-numeric: tabular-nums; }
.button-game__whisper {
  position: absolute; top: clamp(100px, 15vh, 145px); left: 50%; transform: translateX(-50%);
  width: min(520px, 80vw); text-align: center; z-index: 3;
  font-family: var(--serif); font-size: clamp(14px, 1.8vw, 19px); color: rgba(255,228,219,.56); line-height: 1.7;
  min-height: 2em; transition: opacity .3s;
}
.button-game__target {
  position: relative; width: clamp(180px, 27vw, 260px); aspect-ratio: 1; border-radius: 50%;
  border: 0; z-index: 2; margin-top: 16px;
  background:
    radial-gradient(circle at 38% 32%, #ff8b6d 0%, #f24d2e 35%, #951c13 78%, #5b0d0b 100%);
  box-shadow:
    0 18px 0 #4a0b09, 0 24px 45px rgba(0,0,0,.55),
    inset 0 2px 3px rgba(255,220,200,.6), inset 0 -8px 22px rgba(60,0,0,.5),
    0 0 90px rgba(255,79,79,.2);
  color: #2a0503; font-family: var(--serif); font-size: clamp(50px, 9vw, 84px); font-weight: 700;
  transition: transform .12s var(--ease), box-shadow .12s;
}
.button-game__target::before {
  content: ""; position: absolute; inset: -18px; border-radius: 50%;
  border: 1px solid rgba(255,107,61,.28); animation: button-ring 3s ease-out infinite;
}
.button-game__target::after {
  content: "DO NOT PRESS"; position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 6px; letter-spacing: .2em; color: rgba(42,5,3,.55); white-space: nowrap;
}
.button-game__target:hover { transform: translateY(2px) scale(1.012); }
.button-game__target:active { transform: translateY(6px) scale(.98); box-shadow: 0 8px 0 #4a0b09, 0 12px 25px rgba(0,0,0,.5), inset 0 2px 3px rgba(255,220,200,.6); }
.button-game__target.is-tempting { animation: button-tempt 4s ease-in-out infinite; }
.button-game__target.is-glitch { animation: button-glitch 2.8s steps(1) infinite; }
@keyframes button-ring { 0% { transform: scale(.94); opacity: 0; } 20% { opacity: .9; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes button-tempt { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes button-glitch {
  0%, 91%, 100% { transform: translate(0,0); }
  92% { transform: translate(-4px, 2px); }
  94% { transform: translate(5px, -2px); }
  96% { transform: translate(-2px, -3px); }
}
.button-game__note {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 7px;
  background: #f2efe4; color: #111; padding: 7px 10px; font-family: var(--mono); font-size: 8px;
  letter-spacing: .04em; box-shadow: 0 5px 18px rgba(0,0,0,.4); transform: rotate(var(--rot, -2deg));
  animation: note-in .4s var(--ease); cursor: pointer; max-width: 180px;
  border: 1px solid rgba(0,0,0,.08);
}
.button-game__note::before { content: "×"; color: #b33; font-size: 10px; }
.button-game__note.is-out { animation: note-out .35s var(--ease) forwards; }
.button-game__note:hover { background: #fff; }
@keyframes note-in { from { opacity: 0; transform: rotate(var(--rot,-2deg)) scale(.8); } }
@keyframes note-out { to { opacity: 0; transform: rotate(var(--rot,-2deg)) translateY(-16px) scale(.9); } }
.button-game__progress {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: min(420px, 72vw); z-index: 3;
}
.button-game__progress span { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: rgba(255,228,219,.55); margin-bottom: 6px; }
.button-game__progress i { display: block; height: 1px; background: rgba(255,228,219,.12); overflow: hidden; }
.button-game__progress i::after { content: ""; display: block; width: var(--p,0%); height: 100%; background: var(--ember); transition: width .25s linear; }
.button-game__cursor {
  position: absolute; z-index: 5; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(255,228,219,.7); pointer-events: none; opacity: 0;
  transition: opacity .3s; mix-blend-mode: screen;
}
.button-game__cursor::after { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; background: #ffe4db; border-radius: 50%; }
.button-game__cursor.is-on { opacity: .8; }
.button-game.is-pressed { animation: press-flash .7s var(--ease); }
.button-game.is-pressed .button-game__target { transform: translateY(12px) scale(.9); box-shadow: 0 4px 0 #4a0b09, 0 0 120px rgba(255,79,79,.8); }
@keyframes press-flash { 0%, 100% { background-color: #0a0709; } 20% { background-color: #5c1410; } 50% { background-color: #f24d2e; } }
.button-game__ending {
  position: absolute; inset: 0; z-index: 8; background: rgba(10,7,9,.9); display: grid; place-items: center;
  padding: 24px; text-align: center; animation: fade-in .5s;
}
.button-game__ending h2 { font-family: var(--serif); font-size: clamp(40px, 9vw, 92px); line-height: 1; letter-spacing: -.06em; color: #ffe4db; }
.button-game__ending p { margin-top: 14px; color: rgba(255,228,219,.56); font-size: 12px; }
.button-game .game-start { background: rgba(10,7,9,.82); }
@media (max-width: 560px) {
  .button-game__target { width: 168px; }
  .button-game__whisper { top: 100px; }
  .button-game__timer { top: 14px; }
  .button-game__progress { bottom: 18px; }
}

/* ============================================================
   05 STAR MAP
   ============================================================ */
.starmap { position: absolute; inset: 0; background: #05070d; overflow: hidden; }
.starmap canvas { width: 100%; height: 100%; touch-action: none; }
.sm-hud { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; pointer-events: none; flex-wrap: wrap; justify-content: center; }
.sm-chip { text-align: center; padding: 5px 11px; border: 1px solid rgba(182,164,255,.16); background: rgba(5,7,13,.5); backdrop-filter: blur(8px); }
.sm-chip span { display: block; font-family: var(--mono); font-size: 6px; letter-spacing: .12em; color: rgba(182,164,255,.45); }
.sm-chip b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; color: #ddd4ff; margin-top: 1px; }
.sm-prompt {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3;
  font-family: var(--serif); font-size: clamp(14px, 2vw, 19px); color: #cfc4ff;
  text-align: center; pointer-events: none; transition: opacity .3s; text-shadow: 0 0 22px rgba(5,7,13,.9);
  width: min(90vw, 600px);
}
.sm-prompt small { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: .14em; color: rgba(182,164,255,.4); margin-top: 5px; }
.sm-reveal {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(circle, rgba(182,164,255,.08), transparent 55%); opacity: 0;
}
.sm-reveal.is-on { animation: sm-reveal 2s var(--ease); }
.sm-reveal p { font-family: var(--serif); font-size: clamp(24px, 4vw, 42px); letter-spacing: .12em; color: #eee8ff; text-shadow: 0 0 40px rgba(182,164,255,.4); }
@keyframes sm-reveal { 0% { opacity: 0; } 25%, 70% { opacity: 1; } 100% { opacity: 0; } }
.starmap .game-start { background: radial-gradient(ellipse at 50% 40%, rgba(182,164,255,.07), transparent 55%), rgba(5,7,13,.78); }
@media (max-width: 560px) {
  .sm-hud { top: 8px; gap: 4px; }
  .sm-chip { padding: 3px 7px; }
  .sm-chip b { font-size: 10px; }
  .sm-prompt { bottom: 14px; }
}

/* ============================================================
   00 ROOM ZERO
   ============================================================ */
.room0 { position: absolute; inset: 0; background: #050406; color: #e9e3d8; overflow: hidden; }
.room0__scene { position: absolute; inset: 0; overflow: hidden; }
.room0__floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(180deg, transparent, rgba(233,227,216,.035));
  border-top: 1px solid rgba(233,227,216,.08);
}
.room0__door {
  position: absolute; left: 50%; bottom: 14%; width: clamp(140px, 20vw, 210px); height: clamp(250px, 38vh, 380px);
  transform: translateX(-50%); border: 1px solid rgba(233,227,216,.34);
  background: linear-gradient(180deg, rgba(182,164,255,.07), rgba(0,0,0,.55));
  box-shadow: 0 0 120px rgba(255,234,190,.12), inset 0 0 60px rgba(255,234,190,.05);
}
.room0__door::before {
  content: ""; position: absolute; left: 9%; right: 9%; top: 7%; bottom: 7%;
  border: 1px solid rgba(182,164,255,.15);
}
.room0__door::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,238,200,.85), transparent);
  box-shadow: 0 0 28px rgba(255,238,200,.5); opacity: .6;
  animation: door-light 5s ease-in-out infinite;
}
.room0__glow {
  position: absolute; left: 50%; bottom: 8%; width: 72vw; height: 78vh; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 74%, rgba(255,234,190,.26), rgba(255,234,190,.06) 35%, transparent 62%);
  pointer-events: none;
}
.room0__fog {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 80%, transparent 15%, rgba(3,2,5,.72) 75%);
}
.room0__grain { position: absolute; inset: 0; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes door-light { 0%,100% { opacity: .25; } 50% { opacity: .95; } }
.room0__panel {
  position: absolute; left: clamp(20px, 6vw, 90px); bottom: clamp(26px, 8vh, 80px); z-index: 4;
  width: min(570px, calc(100vw - 40px));
}
.room0__panel > .mono { color: var(--lilac); font-size: 8px; }
.room0__text { font-family: var(--serif); font-size: clamp(17px, 2.1vw, 23px); line-height: 1.85; letter-spacing: .015em; margin-top: 14px; min-height: 5.5em; cursor: pointer; }
.room0__text .ghost { color: rgba(233,227,216,.36); }
.room0__text b { color: #ffefd2; font-weight: 500; }
.room0__choices { display: flex; flex-direction: column; gap: 7px; margin-top: 20px; }
.room0__choice {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px; text-align: left;
  border: 1px solid rgba(233,227,216,.13); color: rgba(233,227,216,.72);
  font-family: var(--serif); font-size: 13px; transition: background .2s, border-color .2s, color .2s;
}
.room0__choice span { font-family: var(--mono); font-size: 8px; color: var(--lilac); }
.room0__choice:hover { background: rgba(182,164,255,.06); border-color: rgba(182,164,255,.4); color: #fff; }
.room0__continue {
  margin-top: 20px; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .12em; color: var(--lilac);
  border-bottom: 1px solid rgba(182,164,255,.35); padding: 4px 0;
}
.room0__continue:hover { color: #fff; border-color: #fff; }
.room0__panel.is-hidden { opacity: 0; pointer-events: none; }
.room0__panel { transition: opacity .5s; }
.room0__flash { position: absolute; inset: 0; z-index: 7; background: #fff6e0; opacity: 0; pointer-events: none; }
.room0__flash.is-on { animation: room-flash 3s var(--ease); }
@keyframes room-flash { 0% { opacity: 0; } 12% { opacity: .92; } 35% { opacity: .5; } 100% { opacity: 0; } }
.room0__title { position: absolute; right: clamp(20px, 6vw, 90px); top: clamp(30px, 9vh, 80px); z-index: 3; text-align: right; }
.room0__title .mono { color: rgba(233,227,216,.35); font-size: 8px; }
.room0__title strong { display: block; font-family: var(--serif); font-size: clamp(48px, 9vw, 120px); line-height: .9; letter-spacing: -.05em; color: rgba(233,227,216,.09); margin-top: 8px; }
.room0 .game-start { background: rgba(5,4,6,.72); }
@media (max-width: 760px) {
  .room0__door { bottom: 24%; width: 130px; height: 240px; opacity: .7; }
  .room0__title { display: none; }
  .room0__panel { bottom: 20px; left: 16px; width: calc(100vw - 32px); }
  .room0__text { min-height: 6em; font-size: 16px; line-height: 1.8; }
  .room0__choice { font-size: 12px; padding: 8px 10px; }
}

/* ============================================================
   RESPONSIVE SHELL
   ============================================================ */
@media (max-width: 900px) {
  .game-bar { flex-basis: 56px; gap: 10px; padding: 0 12px; }
  .game-title .mono { display: none; }
  .game-title strong { font-size: 15px; }
  .game-hud { gap: 4px; }
  .hud-chip { height: 26px; padding: 0 7px; font-size: 8px; }
  .hud-chip b { font-size: 9px; }
  .game-pause kbd { display: none; }
  .game-pause { padding: 0 8px; }
  .game-foot { flex-basis: 30px; padding: 0 12px; font-size: 7px; }
  .game-foot #gameDaily { display: none; }
  .game-back span { display: none; }
  .game-back { padding: 0 8px; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .game-tools .icon-btn { display: none; }
  .game-title strong { font-size: 14px; }
  .game-hud .hud-chip:nth-child(n+3) { display: none; }
  .result-card h2 { font-size: 30px; }
  .result-actions { gap: 6px; }
  .result-actions .btn { min-height: 40px; padding: 0 10px; font-size: 11px; }
  .result-actions .btn--text { display: none; }
}

.game-open .cursor__ring { width: 20px; height: 20px; left: -10px; top: -10px; border-color: rgba(216,255,79,.42); }
.game-open .cursor.is-hover .cursor__ring { width: 30px; height: 30px; left: -15px; top: -15px; }
