/* =========================================================
   Game shell + the three built games
   ========================================================= */

/* ---------- SHELL ---------- */
.game-shell { --accent: var(--game-accent, var(--lime)); }

.game-top {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
/* The only way out of a game on mobile, so it gets a full target. */
.game-top .back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: 999px; padding: 8px 16px;
  color: var(--ink); font-size: 13px; font-weight: bold;
}
.game-top .back:hover { text-decoration: none; border-color: var(--accent); }

.game-title {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.game-title .em { font-size: 26px; }
.game-title h1 {
  margin: 0; font-size: clamp(17px, 3.6vw, 25px);
  color: var(--accent);
}

.game-top-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.game-howto {
  color: var(--ink-dim);
  font-size: 14.5px;
  margin: -6px 0 16px;
  max-width: 62ch;
}

.stage {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 3.5vw, 30px);
  min-height: 60vh;
  display: flex; flex-direction: column;
}

.stage-scoreline {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.game-side {
  margin-top: 18px;
}

/* =========================================================
   GAME 1 — THE AWKWARD BUTTON
   ========================================================= */
.ab-wrap { flex: 1; display: flex; flex-direction: column; }

.ab-sign {
  font-family: var(--font-display);
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(19px, 5vw, 34px);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 4px auto 6px;
  max-width: 22ch;
  min-height: 2.3em;
  display: flex; align-items: center; justify-content: center;
}
.ab-sign.shout { color: var(--red); }
.ab-sign.sweet { color: var(--pink); }
.ab-sign.calm  { color: var(--cyan); }

.ab-sub {
  text-align: center; color: var(--ink-dim);
  font-size: 14px; min-height: 2.6em;
  max-width: 44ch; margin: 0 auto 10px;
}

.ab-field {
  position: relative;
  flex: 1;
  min-height: 260px;
  display: grid; place-items: center;
  border: 2px dashed #2b2b38;
  border-radius: var(--r);
  padding: 16px;
  overflow: hidden;
}

.ab-btn {
  position: relative;
  min-width: 190px; min-height: 78px;
  padding: 18px 34px;
  background: var(--red);
  color: #2a0600;
  border: 4px solid #ff9c92;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 0 #8e2a22;
  transition: transform .16s cubic-bezier(.2,1.2,.3,1),
              left .28s ease, top .28s ease,
              background .2s ease, color .2s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.ab-btn:active { transform: translateY(5px) scale(.97); box-shadow: 0 2px 0 #8e2a22; }

.ab-btn.is-tiny   { transform: scale(.42); }
.ab-btn.is-tiny:active { transform: scale(.38); }
.ab-btn.is-giant  { transform: scale(1.32); }
.ab-btn.is-giant:active { transform: scale(1.26); }
.ab-btn.is-angry  { background: #ff3b2f; border-color: #ffd0cb; animation: ab-rage .32s ease infinite; }
.ab-btn.is-nervous{ animation: ab-jitter .22s linear infinite; }
.ab-btn.is-sweet  { background: var(--pink); border-color: #ffd0e4; box-shadow: 0 8px 0 #a3315f; color: #2c0014; }
.ab-btn.is-rich   { background: var(--gold); border-color: #fff0b8; box-shadow: 0 8px 0 #9a7c17; color: #2a2000; }
.ab-btn.is-calm   { background: var(--cyan); border-color: #cdf5ff; box-shadow: 0 8px 0 #2b7d92; color: #002028; }
.ab-btn.is-broken { background: #3a3a48; border-color: #5b5b6b; color: #9c9cb0; box-shadow: 0 8px 0 #191922; }
.ab-btn.is-ghost  { opacity: .35; }
.ab-btn.is-loose  { position: absolute; }

.ab-btn.hit { animation: ab-hit .3s ease; }

@keyframes ab-hit   { 0% { transform: scale(.9); } 55% { transform: scale(1.09); } 100% { transform: scale(1); } }
@keyframes ab-jitter{ 0%,100% { margin-left: -3px; } 50% { margin-left: 3px; } }
@keyframes ab-rage  { 0%,100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }

.ab-float {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
  animation: ab-float 1s ease-out forwards;
}
@keyframes ab-float {
  from { opacity: 1; transform: translate(-50%, 0) scale(.85); }
  to   { opacity: 0; transform: translate(-50%, -70px) scale(1.15); }
}

.ab-decoy {
  position: absolute;
  background: var(--surface-2);
  color: var(--ink-dim);
  border: 3px dashed #4a4a5c;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: var(--font-display);
  font-size: 14px; text-transform: uppercase;
  cursor: pointer;
}

.ab-choice {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 14px;
}

.ab-quit { margin-top: 14px; display: flex; justify-content: center; }

/* unlock list */
.unlock-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.unlock {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px; font-weight: bold;
}
.unlock.locked { color: var(--ink-dim); }
.unlock.open { border-color: var(--lime); color: var(--lime); }
.unlock .u-ico { font-size: 16px; }

/* =========================================================
   GAME 2 — PANIC DEPARTMENT
   ========================================================= */
.pd-wrap { flex: 1; display: flex; flex-direction: column; }

.pd-bars {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}
.pd-bar-label {
  display: flex; justify-content: space-between;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: bold;
  margin-bottom: 5px;
}

.pd-timer {
  height: 12px; background: #0c0c12;
  border: 2px solid var(--line); border-radius: 999px;
  overflow: hidden; margin-bottom: 16px;
}
.pd-timer-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--lime), var(--gold));
  transition: width .1s linear;
}
.pd-timer-fill.low { background: var(--red); }

.pd-case {
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-left: 8px solid var(--red);
  border-radius: var(--r);
  padding: clamp(14px, 3vw, 22px);
  margin-bottom: 16px;
  animation: pd-in .26s ease;
}
@keyframes pd-in { from { opacity: 0; transform: translateY(10px); } }

.pd-siren {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red); font-weight: bold; margin: 0 0 8px;
}
.pd-siren.blink { animation: pd-blink 1s steps(2) infinite; }
@keyframes pd-blink { 50% { opacity: .35; } }

.pd-text {
  font-family: var(--font-display);
  font-size: clamp(18px, 4.2vw, 27px);
  text-transform: uppercase; line-height: 1.14;
  margin: 0;
}
.pd-dept { margin: 10px 0 0; font-size: 13px; color: var(--ink-dim); }

.pd-options { display: grid; gap: 10px; }
.pd-options .btn { justify-content: flex-start; text-align: left; }
.pd-options .btn .opt-em { font-size: 18px; }

.pd-outcome {
  text-align: center;
  animation: pd-in .26s ease;
  padding: 6px 0;
}
.pd-outcome .oc-face { font-size: 54px; line-height: 1; }
.pd-outcome .oc-verdict {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(17px, 4vw, 24px);
  margin: 12px 0 6px;
}
.pd-outcome .oc-text { color: var(--ink-dim); max-width: 44ch; margin: 0 auto 14px; }
.oc-good   .oc-verdict { color: var(--lime); }
.oc-weird  .oc-verdict { color: var(--grape); }
.oc-bad    .oc-verdict { color: var(--gold); }
.oc-awful  .oc-verdict { color: var(--red); }

.pd-log {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: center; margin-top: 4px;
}
.pd-log i {
  font-style: normal; font-size: 18px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}

/* =========================================================
   GAME 3 — WHAT'S IN THE HOLE?
   ========================================================= */
.hole-wrap { flex: 1; display: flex; flex-direction: column; }

.hole-scene {
  position: relative;
  display: grid; place-items: center;
  min-height: 210px;
  margin-bottom: 6px;
}

.hole {
  width: clamp(140px, 40vw, 210px);
  aspect-ratio: 1.55 / 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 34%, #000 40%, #16161f 78%, #2a2a36 100%);
  border: 3px solid #33333f;
  box-shadow: inset 0 14px 26px rgba(0,0,0,.95);
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.2,1.2,.3,1), box-shadow .25s ease;
}
.hole:hover { transform: scale(1.03); }
.hole .hole-face {
  font-size: clamp(26px, 7vw, 40px);
  filter: drop-shadow(0 0 10px rgba(0,0,0,.8));
  transition: transform .2s ease;
}
.hole.gulp { animation: hole-gulp .45s cubic-bezier(.2,1.3,.3,1); }
@keyframes hole-gulp {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14, .82); }
  70%  { transform: scale(.94, 1.08); }
  100% { transform: scale(1); }
}
.hole.rare { box-shadow: inset 0 14px 26px rgba(0,0,0,.9), 0 0 40px 6px var(--grape); }

.hole-drop {
  position: absolute;
  left: 50%; top: 0;
  font-size: 34px;
  pointer-events: none;
  animation: hole-drop .5s cubic-bezier(.5,0,.9,.6) forwards;
}
@keyframes hole-drop {
  from { opacity: 1; transform: translate(-50%, -10px) scale(1) rotate(0deg); }
  to   { opacity: 0; transform: translate(-50%, 150px) scale(.35) rotate(220deg); }
}

.hole-spit {
  position: absolute;
  left: 50%; bottom: 40%;
  font-size: 34px; pointer-events: none;
  animation: hole-spit .9s ease-out forwards;
}
@keyframes hole-spit {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(.4); }
  55%  { opacity: 1; transform: translate(-50%, -130px) scale(1.15) rotate(180deg); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(.9) rotate(360deg); }
}

.hole-say {
  text-align: center;
  min-height: 4.6em;
  display: flex; flex-direction: column; justify-content: center;
  gap: 6px;
  margin: 8px auto 14px;
  max-width: 40ch;
}
.hole-say .hs-main {
  font-family: var(--font-display);
  font-size: clamp(17px, 4vw, 24px);
  text-transform: uppercase; margin: 0;
}
.hole-say .hs-sub { color: var(--ink-dim); font-size: 14px; margin: 0; }
.hole-say.is-rare .hs-main { color: var(--grape); }
.hole-say.is-new  .hs-main { color: var(--lime); }

.tray-label {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: bold;
  text-align: center; margin: 0 0 10px;
}

.tray {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.tray-item {
  width: 68px; height: 68px;
  display: grid; place-items: center;
  gap: 0;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: var(--r);
  font-size: 30px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.tray-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.tray-item:active { transform: translateY(3px); }
.tray-item:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.tray-item.fresh { border-color: var(--lime); animation: pop .5s ease; }

.disco-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}
.disco {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 13px; font-weight: bold;
}
.disco .d-em { font-size: 18px; }
.disco.found { border-color: var(--lime); }
.disco.hidden-item { color: var(--ink-dim); }
.disco.hidden-item .d-em { filter: grayscale(1) blur(1px); opacity: .6; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 560px) {
  .stage { min-height: 66vh; padding: 16px 14px; }
  .pd-bars { grid-template-columns: 1fr; }
  .ab-btn { min-width: 160px; font-size: 20px; }
  .tray-item { width: 62px; height: 62px; font-size: 27px; }
  .game-top-right { width: 100%; margin-left: 0; }
}

/* =========================================================
   Ready card + pause, shared by every game.

   Games used to begin the instant the route rendered, so the clock
   was already running while the instructions were still being read.
   Both of these live in the shell rather than in any game file, so
   all 30 get them without a line of per-game code.
   ========================================================= */
.game-ready {
  margin: auto;
  max-width: 44ch;
  text-align: center;
  display: flex; flex-direction: column; gap: 10px;
}
.ready-em {
  font-size: clamp(48px, 14vw, 76px);
  line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45));
}
.ready-title {
  margin: 0;
  font-size: clamp(24px, 6.5vw, 38px);
  color: var(--game-accent, var(--accent));
}
.ready-tag { margin: 0; font-size: 15px; color: var(--ink-dim); }
.ready-howto {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  text-align: left;
}
.ready-scored {
  margin: 0;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: bold;
}
.ready-note { margin: 0; font-size: 12.5px; color: var(--ink-dim); }

/* ---------- the pause control ---------- */
.game-pause {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: .08em;
  cursor: pointer;
  touch-action: manipulation;
}
.game-pause:hover { border-color: var(--game-accent, var(--accent)); }
.game-pause[hidden] { display: none; }

/* ---------- the pause veil ---------- */
.game-veil {
  position: absolute; inset: 0;
  z-index: 40;
  border-radius: var(--r-lg);
  background: rgba(10, 10, 14, .88);
  backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.game-veil[hidden] { display: none; }
.veil-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 38px);
  color: var(--game-accent, var(--accent));
}
.veil-msg { margin: 0; font-size: 14.5px; color: var(--ink-dim); max-width: 30ch; }
.game-veil .btn { min-width: 180px; }

/* Anything still animating underneath would look alive while paused. */
.stage.is-paused * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .game-veil { backdrop-filter: none; background: rgba(10, 10, 14, .96); }
}

.game-howto[hidden] { display: none; }
