/* Shared look for every Pocketorama 3D game: stage, HUD pills, cards, buttons, toast. */
/* Fredoka is served from our own folder (shell/fonts/, SIL Open Font License): no network call leaves the site. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-stretch: 100%; font-display: swap; src: url('../shell/fonts/Fredoka-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-stretch: 100%; font-display: swap; src: url('../shell/fonts/Fredoka-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
html, body { margin: 0; height: 100%; background: #0a0f1e; overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  font-family: 'Fredoka', system-ui, sans-serif; color: #fff; }
/* --pkt-ad-bottom is the room the bottom ad strip takes on phones (shell/ads.js); 0 with Premium or on desktop. */
#wrap { position: fixed; inset: 0; bottom: var(--pkt-ad-bottom, 0px); display: flex; justify-content: center; }
#stage { position: relative; width: 100%; max-width: 560px; height: 100%; overflow: hidden; }
#stage canvas { display: block; width: 100%; height: 100%; }
.vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 55%, rgba(10,15,30,.38) 100%); }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: 14px 16px; display: flex;
  justify-content: space-between; align-items: flex-start; pointer-events: none; }
.pill { background: rgba(10,15,30,.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 14px; font-weight: 600;
  font-size: 16px; display: inline-flex; gap: 8px; align-items: center; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.big-num { font-size: 30px; font-weight: 700; line-height: 1; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
.big-num small { font-size: 16px; opacity: .85; margin-left: 2px; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* Every tappable pill is a 44 px target at least: the kit's own and the raw .pill.btn-icon buttons games make. */
.btn-icon { pointer-events: auto; cursor: pointer; border: none; color: #fff; font: inherit; }
.btn-icon, button.pill { min-height: 44px; min-width: 44px; box-sizing: border-box; justify-content: center; }
/* Off, but still there: a dark backing that shows on grass and sky alike (was a see-through 35%). */
.pill:disabled, .btn-icon:disabled { background: rgba(10,15,30,.74); border-color: rgba(255,255,255,.12); text-shadow: none; cursor: default;
  color: rgba(255,255,255,.72); outline: 1.5px dashed rgba(255,255,255,.42); outline-offset: -4px; }
#wrap #stage button:disabled:not(.go) { opacity: .7; filter: saturate(.35); }
/* Sound: the pill keeps its compact look and its place in the column; the tap target around it is 48 x 44. */
#snd { position: relative; z-index: 21; margin: -6px 0; padding: 0 14px; min-width: 48px; background: none; border: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; }
#snd::before { content: ''; position: absolute; inset: 6px 0; z-index: -1; border-radius: 999px; background: rgba(10,15,30,.42);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); }
/* The frame counter is for builders: hidden unless the address has ?fps=1 (kit.fps always holds the number). */
#fps { display: none; position: absolute; left: 12px; bottom: 64px; font-size: 12px; font-weight: 500; opacity: .8; padding: 4px 10px;
  min-height: 0; min-width: 0; z-index: 21; }
#stage.show-fps #fps { display: inline-flex; }
/* A card fills the stage and sits above every game control (z-index 20), so nothing behind it can be tapped;
   only the card's own controls, the sound button and the way home (z-index 21) stay live. */
.card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10,15,30,.35); transition: opacity .25s; z-index: 20; pointer-events: auto; }
/* visibility too: buttons inside set pointer-events: auto, which opacity alone leaves catching swipes. */
.card.hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.card.hidden .go { pointer-events: none; }
.panel { width: 100%; max-width: 360px; background: rgba(16,22,44,.82); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.16); border-radius: 28px;
  padding: 26px 24px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.panel h1 { margin: 0 0 4px; font-size: 32px; font-weight: 700; letter-spacing: .3px;
  background: linear-gradient(180deg, #fff6c8, #ffd84a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel p { margin: 6px 0; opacity: .88; font-size: 15px; line-height: 1.4; font-weight: 500; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; font-size: 14px; }
.keys div { background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px 6px; font-weight: 500; }
.go { pointer-events: auto; cursor: pointer; border: none; font: inherit; font-weight: 700; font-size: 19px; color: #3a2400;
  background: linear-gradient(180deg, #ffe680, #ffc21a); border-radius: 18px; padding: 14px 0; width: 100%;
  box-shadow: 0 6px 0 #c98f00, 0 10px 24px rgba(255,194,26,.35); }
.go:active { transform: translateY(3px); box-shadow: 0 3px 0 #c98f00; }
.go:disabled { opacity: .6; }
.big { font-size: 46px; font-weight: 700; margin: 4px 0 2px; }
.row { display: flex; justify-content: center; gap: 18px; margin: 6px 0 18px; font-weight: 600; opacity: .9; }
/* The toast: a dark pill in its own slot just under the top HUD row (--kit-toast-top comes from kit.js, which
   measures the row), so it stays off the board and off the cards. One at a time; kit.js queues them. */
.toast { position: absolute; left: 12px; right: 12px; top: var(--kit-toast-top, 100px); margin: 0 auto; width: fit-content;
  max-width: calc(100% - 24px); box-sizing: border-box; padding: 8px 18px; border-radius: 22px; text-align: center;
  background: rgba(10,15,30,.8); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 6px 18px rgba(0,0,0,.28);
  font-size: 20px; font-weight: 700; line-height: 1.25; text-shadow: none; transform: translateY(-8px) scale(.9); opacity: 0;
  transition: opacity .3s, transform .35s cubic-bezier(.2,1.6,.4,1); pointer-events: none; z-index: 22; }
.toast.show { opacity: 1; transform: none; }
/* A small caption for status text ("3 moves left", "Your turn"): never under 14 px, on a dark pill so it reads
   on any scene. Use it on a <div> or <span>; it is not a button. */
.kcap { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; max-width: 100%; padding: 4px 11px;
  border-radius: 999px; background: rgba(10,15,30,.68); border: 1px solid rgba(255,255,255,.16); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1.3; text-shadow: none; }
/* The way home: a 44 px pill in the bottom-left corner, above the start and game-over cards so it always works. */
.back { position: absolute; left: 12px; bottom: 12px; box-sizing: border-box; min-height: 44px; min-width: 44px; justify-content: center;
  text-decoration: none; font-size: 14px; padding: 0 14px; pointer-events: auto; color: #fff; z-index: 21; background: rgba(10,15,30,.6); }
/* Helpers: kit.hudSlot() pills and kit.button() buttons. */
.slot { display: flex; width: fit-content; }
.kbar { position: absolute; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; pointer-events: none; z-index: 2; }
.kbar[data-where="bottom"] { left: 110px; right: 110px; bottom: 12px; }
.kbar[data-where="bottom-left"] { left: 12px; bottom: 64px; justify-content: flex-start; }
.kbar[data-where="bottom-right"] { right: 12px; bottom: 12px; justify-content: flex-end; }
.kbar[data-where="top"] { left: 110px; right: 110px; top: 14px; }
.kbtn { padding: 8px 16px; font-size: 16px; }
.kbtn:active { transform: translateY(2px); }
.btn-icon:focus-visible, .go:focus-visible, .back:focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; }
/* Hindi: Devanagari from the shell's local font (fetched only when Hindi text is on screen). */
@font-face { font-family: 'Noto Sans Devanagari'; src: url('../shell/fonts/NotoSansDevanagari-Bold.ttf') format('truetype'); font-weight: 500 800; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF, U+200C-200D, U+25CC; }
html:lang(hi), html:lang(hi) body { font-family: 'Fredoka', 'Noto Sans Devanagari', system-ui, sans-serif; }
@media (prefers-reduced-motion: reduce) { .card, .toast, .go { transition: none; } }
/* The ad strip's own font is system-ui (shell/ads.js): in Hindi its label needs the Devanagari font too. */
html:lang(hi) .pkt-ad { font-family: 'Noto Sans Devanagari', system-ui, sans-serif; line-height: 1.4; }
/* How to play (shell/howto.js): a "?" in the corner of the start and game-over cards, and a card with three steps,
   shown the first time a player opens a game. It sits above the game and its cards; the sound button and "← Games" stay live. */
.panel { position: relative; }
.howto-q { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; padding: 0; font-size: 20px; font-weight: 700; }
.panel:has(> .howto-q) > h1 { padding: 0 40px; }
.howto-card, .break-card { z-index: 24; background: rgba(10,15,30,.6); }
.howto-card { z-index: 21; } /* first in the stage: the sound button and "← Games" (also 21, later) stay on top and live */
.howto-more { margin: 12px 0 0; font-size: 14px; text-align: center; }
.howto-more a { color: #ffe680; }
.howto-card h2, .break-card h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; color: #ffe680; }
.howto-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.howto-steps li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.4; font-weight: 500; }
.howto-e { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,216,74,.18); font-size: 22px; }
.howto-steps li:nth-child(1) .howto-e { animation: howto-pop 3.9s 0s 3 both; }
.howto-steps li:nth-child(2) .howto-e { animation: howto-pop 3.9s 1.3s 3 both; }
.howto-steps li:nth-child(3) .howto-e { animation: howto-pop 3.9s 2.6s 3 both; }
@keyframes howto-pop { 0%, 33%, 100% { transform: none; background: rgba(255,216,74,.18); } 10% { transform: scale(1.14); background: rgba(255,216,74,.42); } }
.break-e { font-size: 56px; line-height: 1.1; margin-bottom: 6px; }
.break-more { width: 100%; margin-top: 12px; }
/* Comfort (shell/comfort.js): bigger text, bolder text and calmer motion, from Settings. */
html.pkt-big .panel p, html.pkt-big .howto-steps li { font-size: 18px; }
html.pkt-big .keys { font-size: 16px; }
html.pkt-big .pill, html.pkt-big .kbtn { font-size: 18px; }
html.pkt-big .kcap, html.pkt-big .back { font-size: 16px; }
html.pkt-big .toast { font-size: 23px; }
html.pkt-bold .panel p, html.pkt-bold .keys div, html.pkt-bold .kcap, html.pkt-bold .pill, html.pkt-bold .howto-steps li, html.pkt-bold .back { font-weight: 700; }
html.pkt-bold .panel p { opacity: 1; }
html.pkt-calm .card, html.pkt-calm .toast, html.pkt-calm .go { transition: none; }
html.pkt-calm .toast { transform: none; }
html.pkt-calm .howto-e, html.pkt-calm .go:active, html.pkt-calm .kbtn:active { animation: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .howto-e { animation: none !important; } }
/* Pause (kit.pause): two bars on a pill left of the sound button, while a round runs; the sheet sits over the game
   (z 23, under the break card) with a darker veil, and a big 2, 1 counts back in after Resume. */
.kpause { position: relative; z-index: 21; gap: 5px; padding: 0 14px; }
.kpause i { display: block; width: 5px; height: 15px; border-radius: 3px; background: #fff; }
.kpause[hidden] { display: none; }
.pause-card { z-index: 23; background: rgba(10,15,30,.55); }
.pause-card .panel h1 { margin-bottom: 16px; }
.pause-card a.break-more { display: flex; align-items: center; text-decoration: none; color: #fff; }
.kcount { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-size: 104px; font-weight: 700; color: #fff;
  text-shadow: 0 5px 0 rgba(0,0,0,.35), 0 0 24px rgba(16,22,44,.5); pointer-events: none; z-index: 22; opacity: 0; transition: opacity .15s; }
.kcount.show { opacity: 1; }
/* Continue later: the start card's Play becomes "▶ Continue · Level 4" with how far along as a thin bar. */
#play { position: relative; overflow: hidden; }
#play small { font-size: 15px; font-weight: 600; opacity: .8; }
.kbarfill { position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p, 0%); background: #e0461f; border-radius: 0 3px 3px 0; }
#newgame { width: 100%; margin-top: 12px; }
/* Cheat codes (cheats_kit.js): the 🎭 Cheats button on the start, pause and game-over cards, the Cheats sheet over the
   game (above the pause sheet), the HUD badge, and the effects drawn in the page (finger sparkles, confetti). */
.cheat-card { z-index: 24; background: rgba(10,15,30,.6); overflow-y: auto; align-items: flex-start; }
.cheat-card .panel { margin: auto 0; max-height: none; text-align: left; }
.cheat-card .panel h1 { text-align: center; }
.cheat-card h2 { margin: 14px 0 6px; font-size: 17px; color: #ffe680; }
.cheat-note { font-size: 14px !important; }
.cheat-form { display: flex; gap: 8px; margin-top: 10px; }
.cheat-form input { flex: 1; min-width: 0; font: inherit; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); border-radius: 12px; padding: 10px 12px; }
.cheat-form input:focus { outline: 2px solid #ffd84a; outline-offset: 1px; }
.cheat-form input.wobble { animation: cheat-wobble .4s; }
@keyframes cheat-wobble { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.cheat-msg { min-height: 20px; font-size: 14px !important; }
.cheat-msg.good { color: #9ff0b8; }
.cheat-book { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cheat-book li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.07); }
.cheat-book li.locked { opacity: .7; }
.cheat-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.cheat-l code { font-size: 13px; letter-spacing: 1px; color: #ffe680; }
.cheat-l small { font-size: 13px; opacity: .85; line-height: 1.35; }
.cheat-book .switch { flex: none; width: 52px; height: 30px; border-radius: 15px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.14); padding: 3px; cursor: pointer; }
.cheat-book .switch i { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cheat-book .switch[aria-checked="true"] { background: #ffd84a; border-color: #ffd84a; }
.cheat-book .switch[aria-checked="true"] i { transform: translateX(22px); background: #3a2a00; }
.cheat-badge { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 20; pointer-events: none;
  padding: 3px 12px; border-radius: 999px; background: rgba(120,60,170,.78); color: #fff; font-size: 12px; font-weight: 600;
  white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.cheat-badge[hidden] { display: none; }
.over-extra .cheat-done { color: #e6c8ff; font-weight: 600; }
.cheat-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 19; }
.cheat-dot, .cheat-spark { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: hsl(var(--h), 95%, 62%); box-shadow: 0 0 10px hsl(var(--h), 95%, 62%); animation: cheat-dot 1.2s ease-out forwards; }
.cheat-spark { z-index: 25; }
@keyframes cheat-dot { to { transform: translate(var(--dx), 26px) scale(.2); opacity: 0; } }
.cheat-confetti { position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; background: hsl(var(--h), 90%, 60%);
  animation: cheat-fall 1.9s cubic-bezier(.3,.6,.6,1) forwards; }
@keyframes cheat-fall { to { transform: translateY(110vh) rotate(var(--r)); } }
html.pkt-calm .cheat-dot, html.pkt-calm .cheat-confetti { animation-duration: 2.6s; }
