/* =========================================================
   PANDALION — Gaming Corner
   ========================================================= */
.game-page { background: linear-gradient(180deg, #ffe4ec 0, var(--cream) 560px); }
.game-main { padding: 112px 0 90px; }

/* ---------- menu ---------- */
.menu-hero { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: center; margin-bottom: 30px; }
.menu-art { width: 100%; filter: drop-shadow(0 16px 20px rgba(200, 90, 70, .18)); animation: bob 5s ease-in-out infinite; }
.menu-hero h1 { font-size: clamp(36px, 5.6vw, 58px); margin: 12px 0 10px; }
.menu-hero h1 span { color: #e86f55; }
.menu-hero p { color: var(--ink-soft); font-weight: 600; font-size: 17px; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.game-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px 22px 22px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-soft);
  transition: transform .35s var(--bounce), box-shadow .3s;
}
a.game-card:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: var(--shadow-pop); }
.gc-emoji { font-size: 46px; line-height: 1; }
.game-card b { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.game-card > span:not(.gc-emoji):not(.gc-play) { color: var(--ink-soft); font-weight: 600; flex: 1; }
.gc-play { font-weight: 900; color: var(--sage-dark); }
.game-card.soon { opacity: .7; }
.game-card.soon .gc-play { color: #b07a1d; }

/* ---------- game layout ---------- */
.back { display: inline-flex; font-weight: 800; color: var(--sage-dark); margin-bottom: 8px; }
.back:hover { text-decoration: underline; }
.game-title { font-size: clamp(30px, 4.6vw, 44px); margin-bottom: 20px; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.board, .sidenote { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-soft); }
.board { padding: 26px; position: relative; overflow: hidden; min-height: 420px; }
.play, .setup { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* characters + speech bubbles */
.cast { display: flex; align-items: center; gap: 14px; width: 100%; }
.cast.lion-side { justify-content: flex-end; }
.char { margin: 0; flex: none; text-align: center; }
.char img { width: 84px; height: 100px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.1)); }
.char figcaption { font-size: 12px; font-weight: 900; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; }
.bubble {
  position: relative; flex: 1; max-width: 460px; padding: 12px 16px; border-radius: 20px;
  background: var(--sky-soft); border: 2px solid #cfe9fb; font-weight: 800; font-size: 15.5px;
}
.bubble::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; background: inherit; border-left: 2px solid #cfe9fb; border-bottom: 2px solid #cfe9fb; transform: translateY(-50%) rotate(45deg); }
.lion-bubble { background: var(--honey-soft); border-color: #f5dd9c; }
.lion-bubble::before { left: auto; right: -9px; border: 0; border-right: 2px solid #f5dd9c; border-top: 2px solid #f5dd9c; }
.bubble.warn { background: var(--pink-soft); border-color: #ffc6d5; }
.bubble.warn::before { border-color: #ffc6d5; }
.bubble.pop { animation: bubblePop .35s var(--bounce); }
@keyframes bubblePop { from { transform: scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }

/* range setup */
.range-row { display: flex; align-items: flex-end; gap: 12px; }
.range-row label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.range-row .input { width: 150px; text-align: center; font-size: 22px; font-weight: 800; }
.range-dash { padding-bottom: 14px; font-weight: 800; color: var(--ink-soft); }
.hint { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.hint.bad { color: #d6455d; }
.btn.big { font-size: 19px; padding: 14px 34px; }

/* status pills */
.status-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill { padding: 6px 14px; border-radius: 999px; background: var(--pink-soft); font-weight: 900; font-size: 14px; color: #c2456a; }
.pill.soft { background: var(--cream-2); color: var(--ink-soft); }
.pill.low { animation: pulse 1s infinite; background: #ffd6dc; }

/* guess display */
.display {
  width: min(100%, 320px); height: 72px; border-radius: 20px; border: 3px solid var(--sage);
  display: grid; place-items: center; font-family: var(--font-head); font-size: 40px; font-weight: 700; letter-spacing: .04em;
  background: var(--sage-soft); color: var(--ink);
}
.display .ph { font-size: 18px; font-weight: 600; color: #9bb398; letter-spacing: 0; }

/* code slots */
.slots { display: flex; gap: 12px; }
.slot {
  width: 64px; height: 76px; border-radius: 18px; border: 3px dashed #d6ccb6; background: var(--cream);
  display: grid; place-items: center; font-family: var(--font-head); font-size: 40px; font-weight: 700;
}
.slot.filled { border-style: solid; border-color: var(--honey); background: var(--honey-soft); animation: bubblePop .25s var(--bounce); }
.slot.now { border-color: var(--sage); }

/* keypads */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 320px); }
.key {
  height: 58px; border-radius: 16px; border: 0; background: var(--cream-2); font-family: var(--font-head);
  font-size: 24px; font-weight: 600; color: var(--ink); box-shadow: 0 4px 0 #e6d9bd;
  transition: transform .12s, box-shadow .12s, background .2s;
}
.key:hover { background: #fbe9c6; }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #e6d9bd; }
.key:disabled { opacity: .35; cursor: default; }
.key.fn { background: #eef1f5; box-shadow: 0 4px 0 #d8dde5; font-size: 22px; }
.key.go { background: var(--sage); color: #fff; box-shadow: 0 4px 0 var(--sage-dark); font-size: 19px; }
.key.go:hover { background: #8fbf8c; }
.key.wide { grid-column: 1 / -1; }
.key.g { background: #6cc070; color: #fff; box-shadow: 0 4px 0 #4f9b53; }
.key.y { background: #f7c948; color: #4a3b0a; box-shadow: 0 4px 0 #d5a82a; }
.key.r { background: #ef6f6f; color: #fff; box-shadow: 0 4px 0 #c94f4f; }

/* colour tiles (code game) */
.t { display: inline-grid; place-items: center; width: 38px; height: 42px; border-radius: 10px; font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #fff; }
.t.g { background: #6cc070; } .t.y { background: #f7c948; color: #4a3b0a; } .t.r { background: #ef6f6f; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .t { width: 16px; height: 16px; border-radius: 5px; }

/* word game: input boxes, hint button, A–Z keyboard */
.word-input { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; min-height: 64px; }
.wslot { width: 48px; height: 58px; font-size: 30px; border-radius: 14px; }
.wslot.ghost { opacity: .45; }
.word-input:not(.fixed) .wslot:not(.filled) { border-style: dotted; }
.hint-btn { border: 2px dashed #e7b84d; background: var(--honey-soft); color: #9a6a10; cursor: pointer; transition: transform .2s var(--bounce); }
.hint-btn:hover:not(:disabled) { transform: translateY(-2px); }
.hint-btn:disabled { border-style: solid; cursor: default; color: var(--ink); }
.qwerty { display: flex; flex-direction: column; gap: 8px; width: min(100%, 560px); }
.qrow { display: flex; justify-content: center; gap: 6px; }
.qrow .key { flex: 1 1 0; max-width: 48px; height: 54px; font-size: 19px; padding: 0; }
.qrow .key.wide-key { flex: 1.6 1 0; max-width: 78px; font-size: 15px; }
.word-row { flex-wrap: wrap; }
.word-row .tiles { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.word-row .t { width: 26px; height: 32px; font-size: 16px; border-radius: 7px; }
.reveal-word { flex-wrap: wrap; justify-content: center; }
.reveal-word .t { width: 42px; height: 50px; font-size: 24px; }

/* hangman: balloons, panda, blanks */
.sky-scene { position: relative; width: min(100%, 420px); height: 320px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(180deg, #dff1ff 0%, #f1f9ff 74%, #e9f6e2 74%); border: 2px solid #d6ecfa; }
.sky-scene::before { content: "☁️"; position: absolute; left: 14%; top: 18px; font-size: 34px; opacity: .8; animation: drift-c 14s linear infinite alternate; }
.sky-scene::after { content: "☁️"; position: absolute; right: 12%; top: 54px; font-size: 26px; opacity: .7; animation: drift-c 10s linear infinite alternate-reverse; }
@keyframes drift-c { to { transform: translateX(30px); } }
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(180deg, #cfeac2, #b9dfaa); }
.floater { --sink: 0; position: absolute; left: 50%; top: 10px; z-index: 2; display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, calc(var(--sink) * 100px)); transition: transform .8s cubic-bezier(.3, 1.4, .5, 1); }
.balloons { display: flex; justify-content: center; gap: 2px; height: 96px; position: relative; }
.balloon { --c: #ff8fab; --tilt: 0deg; position: relative; width: 36px; height: 44px; border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 12%, transparent 13%), var(--c);
  transform: rotate(var(--tilt)); transform-origin: 50% 160%; animation: sway 3s ease-in-out infinite; box-shadow: inset -4px -6px 0 rgba(0,0,0,.08); }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 52px; background: rgba(80, 80, 80, .45); transform: translateX(-50%); }
.balloon.popped { animation: popBalloon .45s ease-out forwards; animation-delay: 0s !important; }
@keyframes popBalloon { 0% { transform: rotate(var(--tilt)) scale(1); opacity: 1; } 40% { transform: rotate(var(--tilt)) scale(1.35); opacity: .9; } 100% { transform: rotate(var(--tilt)) scale(0); opacity: 0; } }
.hang-panda { width: 84px; height: 104px; object-fit: contain; margin-top: 0; filter: drop-shadow(0 6px 6px rgba(0,0,0,.12)); }
.blanks { display: flex; justify-content: center; gap: 8px; width: 100%; }
.blank { flex: 0 1 42px; min-width: 22px; height: 52px; border-bottom: 5px solid #cfc3a8; display: grid; place-items: center;
  font-family: var(--font-head); font-size: 32px; font-weight: 700; color: var(--ink); }
.blank.shown { border-color: var(--sage); animation: bubblePop .3s var(--bounce); }
.blank.missed { color: #e05d5d; border-color: #ef9a9a; }
.hang-row { display: flex; flex-wrap: wrap; gap: 6px; }
.hang-row .t { width: 34px; height: 38px; font-size: 19px; animation: bubblePop .3s var(--bounce); }
.hang-sum { display: flex; gap: 14px; font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-top: 6px; }
.hang-sum span { display: inline-flex; align-items: center; gap: 6px; }
.hang-sum .t { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- side note ---------- */
.sidenote { padding: 20px 18px; position: sticky; top: 96px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.sidenote h3 { font-size: 20px; margin-bottom: 12px; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.notes .empty { color: #b5ad9e; font-weight: 700; font-size: 14px; padding: 6px 2px; }
.note-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--cream); border: 2px solid var(--line); }
.note-row .nl { display: flex; flex-direction: column; line-height: 1.15; }
.note-row .nl small, .code-row small { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.note-row .nl b { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.note-row .nr { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.note-row .arrow { font-size: 26px; }
.note-row .nr small { font-size: 11px; font-weight: 900; }
.note-row.lower .nr small { color: #d6455d; }
.note-row.higher .nr small { color: #3d8bd6; }
.note-row.right { background: var(--sage-soft); border-color: var(--sage); }
.note-row.right .nr small { color: var(--sage-dark); }
.notes .fresh { animation: slideIn .4s var(--bounce); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--cream); border: 2px solid var(--line); }
.code-row .tiles { display: flex; gap: 5px; }
.code-row .t { width: 34px; height: 38px; font-size: 20px; }
.code-notes .fresh .t { animation: flip .45s ease both; }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: none; } }

/* ---------- result + celebration ---------- */
.result { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 10px 0 6px; }
.result h3 { font-size: clamp(30px, 5vw, 42px); }
.result p { color: var(--ink-soft); font-weight: 700; max-width: 440px; }
.winners { display: flex; align-items: flex-end; gap: 18px; min-height: 170px; }
.winner, .lion-party { position: relative; }
.winner img, .lion-party img { width: 120px; height: 150px; }
.lion-party img { animation: dance .7s ease-in-out infinite alternate; transform-origin: bottom center; }
@keyframes dance { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(8deg) translateY(-14px); } }
.winner { animation: bob 1.4s ease-in-out infinite; }
.crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 40px; }
.lion-party .crown { display: none; }
.lion-party.crowned .crown { display: block; top: -14px; }
.trophy { display: none; font-size: 110px; line-height: 1; filter: drop-shadow(0 8px 10px rgba(180, 130, 20, .3)); }
.winner.you img, .winner.you .crown { display: none; }
.winner.you .trophy { display: block; }
.result-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.reveal-code { display: flex; gap: 8px; }
.reveal-code .t { width: 48px; height: 54px; font-size: 28px; }
.confetti-box { position: absolute; inset: -40px -26px auto; height: 520px; pointer-events: none; overflow: hidden; }
.confetti-box span { position: absolute; top: -30px; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(560px) rotate(420deg); opacity: .2; } }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .game-grid { grid-template-columns: 1fr; }
  .sidenote { position: static; max-height: none; }
  .menu-hero { grid-template-columns: 1fr; }
  .menu-art { width: 200px; }
}
@media (max-width: 520px) {
  .game-main { padding-top: 100px; }
  .board { padding: 18px 14px; }
  .char img { width: 62px; height: 76px; }
  .bubble { font-size: 14.5px; padding: 10px 12px; }
  .range-row .input { width: 120px; }
  .slot { width: 56px; height: 68px; font-size: 34px; }
  .key { height: 54px; }
  .qrow { gap: 4px; }
  .qrow .key { height: 48px; font-size: 16px; border-radius: 10px; }
  .qrow .key.wide-key { font-size: 12.5px; }
  .wslot { width: 38px; height: 48px; font-size: 24px; }
  .blanks { gap: 5px; }
  .blank { height: 44px; font-size: 24px; border-bottom-width: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-art, .lion-party img, .winner, .pill.low, .balloon, .sky-scene::before, .sky-scene::after { animation: none; }
}

/* ---------- "How to play" text (helps people and search engines) ---------- */
.seo-info { margin-top: 34px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 26px 30px; box-shadow: var(--shadow-soft); }
.seo-info h2 { font-size: 24px; margin: 0 0 12px; }
.seo-info h2:not(:first-child) { margin-top: 22px; }
.seo-info h3 { font-size: 17px; margin: 14px 0 4px; }
.seo-info p, .seo-info li { color: var(--ink-soft); font-weight: 600; line-height: 1.65; }
.seo-info ol, .seo-info ul { padding-left: 22px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.seo-info a { color: var(--sage-dark); font-weight: 800; }
.seo-info .tip { margin-top: 14px; background: var(--honey-soft); border-radius: 14px; padding: 10px 14px; color: var(--ink); }
.more-games { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more-games a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--sage-soft); text-decoration: none; }
.more-games a:hover { background: #d3ebcd; }
@media (max-width: 520px) { .seo-info { padding: 20px 18px; } }
