/* Angry Marble: the mobile game flow. The map, hints, fail offers, ad breaks and the store. */
.hero-cta .b-ghost { margin-left: 2px; }
.mapcta { margin-top: 30px; border: 2px solid #14110B; border-radius: 14px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; align-items: end;
  background: linear-gradient(120deg, #0E1622 0%, #2B4656 48%, #2A1A4A 52%, #C9704A 100%); color: #F7F1E3; }
.mapcta .eyebrow { color: rgba(247, 241, 227, 0.7); }
.mapcta h2 { font-family: var(--display); font-weight: 900; font-stretch: 122%; text-transform: uppercase; font-size: clamp(26px, 4vw, 38px); line-height: 0.95; margin: 6px 0 8px; }
.mapcta p { margin: 0; max-width: 62ch; line-height: 1.5; font-size: 14.5px; }
.mapcta .row { display: flex; flex-wrap: wrap; gap: 8px; }
.mapcta .b-ghost { border-color: rgba(247, 241, 227, 0.5); color: #F7F1E3; }
@media (max-width: 720px) { .mapcta { grid-template-columns: 1fr; } }

/* ---------- the map ---------- */
.mapscreen { overflow: hidden; display: flex; flex-direction: column; background: #14110B; color: #F7F1E3; }
.maptop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; }
.maptop .spacer { flex: 1; }
/* Buttons and stats share one pill shape and height, like the chips on the title screen. */
.maptop .b-ghost { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; border-radius: 999px; color: #F7F1E3; border-color: rgba(247, 241, 227, 0.35); padding: 0 16px; font-size: 14px; line-height: 1; }
.maptop .b-ghost svg { width: 18px; height: 18px; margin-left: -6px; }
.mapstat { display: inline-block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; background: rgba(247, 241, 227, 0.08); border: 1px solid rgba(247, 241, 227, 0.18); border-radius: 999px; padding: 0 14px; line-height: 34px; }
.mapstat b { color: #F2C230; }
.mapnote { font-size: 12px; color: rgba(247, 241, 227, 0.65); }
.worlds { flex: 1; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 4px 16px 16px; scroll-snap-type: x mandatory; min-height: 0; }
.world { position: relative; flex: none; width: min(620px, 86vw); scroll-snap-align: center; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--s0), var(--s1)); border: 2px solid rgba(247, 241, 227, 0.14); box-shadow: inset 0 -80px 60px -40px rgba(0, 0, 0, 0.45); }
.world header { padding: 14px 16px 0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45); }
.world .wnum { margin: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(247, 241, 227, 0.85); }
.world h2 { margin: 2px 0; font-family: var(--display); font-weight: 900; font-stretch: 122%; text-transform: uppercase; font-size: clamp(24px, 3.6vw, 34px); line-height: 0.95; }
.world .wmeta { margin: 0; font-size: 13px; font-weight: 600; color: rgba(247, 241, 227, 0.92); }
.world .wdoc { margin: 2px 0 0; font-size: 12.5px; font-style: italic; color: rgba(247, 241, 227, 0.8); }
.wtag { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #F2C230; color: #14110B; font-weight: 700; letter-spacing: 0.06em; text-shadow: none; }
.wtag.live { background: #FF6B6B; }
.trail { position: relative; flex: 1; min-height: 170px; margin: 18px 10px 18px; }
.trail svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trail > svg path { fill: none; stroke: rgba(247, 241, 227, 0.6); stroke-width: 4; stroke-dasharray: 2 10; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.node { position: absolute; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #E9E1CD 70%); border: 3px solid #14110B; box-shadow: 0 5px 0 #14110B, 0 10px 18px rgba(0, 0, 0, 0.35); transition: transform 0.12s ease; }
.node:hover { transform: translate(-50%, -54%); }
.node:active { transform: translate(-50%, -46%); box-shadow: 0 2px 0 #14110B; }
.nface { position: absolute; inset: 4px; display: grid; place-items: center; }
.nface canvas { width: 46px; height: 46px; display: block; }
.nid { position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; font-weight: 700; background: #14110B; color: #F7F1E3; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.nstars { position: absolute; left: 50%; top: -16px; transform: translateX(-50%); display: flex; }
.nstars .star { width: 15px; height: 15px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.nstars .star path { stroke: rgba(247, 241, 227, 0.8); opacity: 0.9; }
.node.done { background: radial-gradient(circle at 35% 30%, #FFF6D6, #F2C230 75%); }
.node.current { background: radial-gradient(circle at 35% 30%, #FFE1DC, #FF6B6B 75%); animation: nodePulse 1.4s ease-in-out infinite; }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 5px 0 #14110B, 0 0 0 0 rgba(255, 107, 107, 0.75); } 50% { box-shadow: 0 5px 0 #14110B, 0 0 0 14px rgba(255, 107, 107, 0); } }
.node.locked { background: radial-gradient(circle at 35% 30%, #8B8577, #4E4A42 75%); }
.node.locked .nface { opacity: 0.35; filter: grayscale(1); }
.nlock { position: absolute; inset: 0; display: grid; place-items: center; }
.nlock svg, .wlock svg { width: 22px; height: 22px; fill: #F7F1E3; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.world.locked .trail { filter: saturate(0.4) brightness(0.8); }
.wlock { position: absolute; right: 14px; top: 14px; display: flex; align-items: center; gap: 6px; background: rgba(20, 17, 11, 0.78); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.wlock svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .node.current { animation: none; } }

/* ---------- hints and the result card ---------- */
.btn-hint { border-color: rgba(211, 140, 8, 0.7); }
.btn-hint .hintn { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #14110B; font-family: var(--mono); font-size: 11px; font-weight: 700; text-align: center; }
.btn-hint:disabled { opacity: 0.55; cursor: default; }
.bigstars.anim .star.on { animation: starPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; }
.bigstars.anim .star.on:nth-child(2) { animation-delay: 0.22s; }
.bigstars.anim .star.on:nth-child(3) { animation-delay: 0.44s; }
@keyframes starPop { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } }
#btnNext.big { font-size: 18px; padding: 14px 26px; box-shadow: 0 4px 0 var(--house-ink); }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0 0 14px; }
.offer { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper-2); box-shadow: 0 3px 0 var(--ink); }
.offer:hover { transform: translateY(-1px); }
.offer b { display: block; font-size: 14.5px; }
.offer small { display: block; font-size: 12px; color: var(--ink-2); }
.oic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--house); color: #14110B; font-family: var(--display); font-weight: 900; font-size: 16px; }

/* ---------- ads (stand-ins in the preview) ---------- */
.admodal { z-index: 9; background: rgba(6, 5, 3, 0.88); }
.adcard { width: 100%; max-width: 440px; background: #14110B; color: #F7F1E3; border: 1px solid rgba(247, 241, 227, 0.2); border-radius: 16px; padding: 22px; text-align: center; }
.adtag { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #F2C230; }
.adcard h2 { font-family: var(--display); font-weight: 900; font-stretch: 122%; text-transform: uppercase; font-size: 30px; margin: 8px 0; }
.adcard p { font-size: 14px; line-height: 1.5; color: rgba(247, 241, 227, 0.82); margin: 0 0 14px; }
.adbar { height: 8px; border-radius: 999px; background: rgba(247, 241, 227, 0.14); overflow: hidden; }
.adbar i { display: block; height: 100%; width: 0; background: #F2C230; transition: width 0.1s linear; }
.adcount { font-family: var(--display); font-weight: 900; font-size: 44px; margin: 10px 0; }
.adcard .actions { justify-content: center; }
.adcard .b-ghost { color: #F7F1E3; border-color: rgba(247, 241, 227, 0.3); }
.adcard .b-primary:disabled { opacity: 0.4; cursor: default; }

/* ---------- the store ---------- */
.skus { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 6px 0 12px; }
.sku { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; padding: 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper-2); box-shadow: 0 4px 0 var(--ink); }
.sku.best { background: #FFE9A8; color: #14110B; }
.sku:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.skuname { font-family: var(--display); font-weight: 900; font-stretch: 118%; text-transform: uppercase; font-size: 19px; line-height: 1; }
.skutext { font-size: 13px; line-height: 1.45; }
.skuprice { margin-top: auto; align-self: flex-start; font-family: var(--mono); font-weight: 700; font-size: 14px; background: #14110B; color: #F7F1E3; padding: 4px 10px; border-radius: 8px; }
.skubadge { position: absolute; top: -11px; right: 10px; background: var(--house); color: #14110B; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 2px solid #14110B; }

/* ---------- phones held sideways ---------- */
/* Safe centring: a card taller than the screen scrolls from its top instead of losing it. */
.modal { display: flex; }
.modal > .card, .modal > .adcard { margin: auto; }
@media (max-height: 500px) {
  .hud-top { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .hud-top::-webkit-scrollbar { display: none; }
  .hud-top .pill { flex: none; white-space: nowrap; }
  .hud-top .lvl-name, .hud-top .key, #btnInstallHud { display: none; }
  .pill.btn { min-height: 34px; }
  .modal { padding: 8px 16px; }
  .card { padding: 14px 18px; max-width: 640px; }
  .card h2 { font-size: 24px; margin: 4px 0 6px; }
  .card p { font-size: 14px; margin-bottom: 8px; }
  .bigstars { margin: 0 0 6px; }
  .bigstars .star { width: 30px; height: 30px; }
  .starlist { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
  .starlist li { font-size: 13px; }
  .offers { margin-bottom: 8px; }
  .offer { padding: 7px 10px; }
  .sharerow { margin-bottom: 6px; }
  .actions .b-primary, .actions .b-ghost { padding: 9px 14px; font-size: 14px; }
  #btnNext.big { font-size: 16px; padding: 10px 20px; }
  .skus { gap: 8px; }
  .sku { padding: 10px 12px; }
  .skutext { font-size: 12px; }
  .skuname { font-size: 16px; }
  .adcard { padding: 14px 18px; }
  .adcard h2 { font-size: 22px; }
  .adcount { font-size: 28px; margin: 4px 0; }
  .maptop { padding: 6px 16px; }
  .maptop .b-ghost { padding: 0 14px; }
  .world header { padding: 10px 14px 0; }
  .world h2 { font-size: 22px; }
  .world .wdoc { display: none; }
  .trail { min-height: 0; margin: 20px 8px 26px; }
  .node { width: 48px; height: 48px; border-width: 2px; }
  .nface { inset: 3px; }
  .nface canvas { width: 38px; height: 38px; }
}
@media (max-width: 520px) { .wlock { top: auto; bottom: 14px; } }

/* Touch screens have no keyboard: drop the U / R shortcut hints. */
@media (hover: none) and (pointer: coarse) {
  .how span:has(.key), .hud-top .key { display: none; }
}

/* A phone held sideways: Play has to be on screen without scrolling. */
@media (max-height: 500px) {
  .menu-inner { padding-block: 14px 40px; }
  .hero h1 { font-size: 46px; margin: 4px 0 10px; }
  .hero .lede { display: none; }
  .hero .how { font-size: 12.5px; gap: 4px 14px; }
  .hero-cta { margin-top: 12px; }
  #heroArt { max-height: 62vh; width: auto; justify-self: end; }
}

/* ---------- the app's title screen ---------- */
/* The next level's board shows through, darkened on the left where the buttons sit. */
#menu.app { background: transparent; overflow: hidden; }
.apphome { position: absolute; inset: 0; display: flex; flex-direction: column; color: #F7F1E3;
  background: linear-gradient(90deg, rgba(12, 10, 6, 0.9) 0%, rgba(12, 10, 6, 0.72) 42%, rgba(12, 10, 6, 0.05) 78%); }
.ahtop { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.ahtop .spacer { flex: 1; }
.ahchip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 5px 12px; border-radius: 999px; font: 600 13px/1 var(--body); color: #F7F1E3;
  background: rgba(12, 10, 6, 0.6); border: 1px solid rgba(247, 241, 227, 0.2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
button.ahchip { cursor: pointer; }
.ahstat { font-family: var(--mono); font-weight: 700; color: #F2C230; }
.ahdim { color: rgba(247, 241, 227, 0.65); font-weight: 500; }
.ahbadge { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(from 200deg, #F2C230, #D38C08, #FF6B6B, #F2C230); color: #14110B; font-weight: 900; font-size: 12px; }
.ahicon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #F7F1E3; background: rgba(12, 10, 6, 0.6); border: 1px solid rgba(247, 241, 227, 0.2); }
.ahicon svg { width: 22px; height: 22px; fill: currentColor; }
.ahshare svg { width: 15px; height: 15px; fill: #F2C230; }
.ahmain { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 16px 16px max(16px, 5vw); max-width: 560px; min-height: 0; }
.ahlogo { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; text-transform: uppercase; line-height: 0.84; letter-spacing: -0.02em;
  font-size: clamp(44px, 9vh, 84px); text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.ahlogo span { display: block; color: #FF6B6B; }
.ahplay { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; padding: 12px 34px 12px 26px; border-radius: 16px;
  background: #FF6B6B; color: #14110B; border: 3px solid #14110B; box-shadow: 0 6px 0 #14110B; transition: transform 0.1s ease, box-shadow 0.1s ease; }
.ahplay span { font-family: var(--display); font-weight: 900; font-stretch: 120%; text-transform: uppercase; font-size: 30px; line-height: 1; }
.ahplay span::before { content: '▶'; font-size: 0.7em; margin-right: 10px; vertical-align: 0.12em; }
.ahplay small { font: 700 12.5px/1.2 var(--mono); opacity: 0.75; }
.ahplay:active { transform: translateY(4px); box-shadow: 0 2px 0 #14110B; }
.ahmodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ahmode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 10px; border-radius: 12px; cursor: pointer; text-align: left; color: #F7F1E3;
  background: rgba(247, 241, 227, 0.08); border: 1px solid rgba(247, 241, 227, 0.22); }
.ahmode:hover { border-color: rgba(247, 241, 227, 0.6); }
.ahmode svg { width: 20px; height: 20px; color: #F2C230; margin-bottom: 2px; }
.ahmode b { font-size: 13.5px; line-height: 1.15; }
.ahmode small { font: 600 11px/1.2 var(--mono); color: rgba(247, 241, 227, 0.65); }
@media (max-width: 560px) { .ahmodes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-height: 420px) { .ahtop { padding: 8px 16px; } .ahmain { gap: 10px; } .ahplay { padding: 9px 28px 9px 22px; } .ahplay span { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .ahplay { transition: none; } }

/* After a win the challenge link is the main way to share: it opens the same level for a friend. */
.b-share.lead { background: var(--house); color: #14110B; border-color: #14110B; box-shadow: 0 3px 0 #14110B; font-weight: 800; }

/* The app's loading screen: the title scene (icons/splash-scene.jpg, or -tall in portrait; drawn by tools/assets.js)
   right after the phone's own splash, with a bar that fills while the game boots. Only the app
   and ?app switch it on (early.js), so the website never downloads the picture. */
.boot { display: none; }
.app-boot .boot { display: flex; position: fixed; inset: 0; z-index: 50; align-items: flex-end; justify-content: center; padding-bottom: max(18px, 5vh);
  background: #C8241D url(icons/splash-scene.jpg) center / cover no-repeat; transition: opacity 0.35s ease; }
.boot.gone { opacity: 0; pointer-events: none; }
.bootbar { width: min(40vw, 320px); height: 10px; border-radius: 5px; background: rgba(42, 21, 16, 0.5); overflow: hidden; }
.bootbar i { display: block; height: 100%; width: 12%; border-radius: 5px; background: #FFD23F; animation: bootfill 1s ease-out forwards; }
.boot.done .bootbar i { animation: bootdone 0.2s ease-out forwards; }
@keyframes bootfill { to { width: 85%; } }
@keyframes bootdone { from { width: 85%; } to { width: 100%; } }
@media (orientation: portrait) { .app-boot .boot { background-image: url(icons/splash-scene-tall.jpg); } }
@media (prefers-reduced-motion: reduce) { .bootbar i { animation: none; width: 85%; } .app-boot .boot { transition: none; } }

/* The rank and missions sheet in the app: the website's two-column panel, stacked for a phone
   popup, with no frame inside the card's frame. */
#gCard:has(.ranksheet) { max-width: 540px; }
.ranksheet .today { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; border: 0; background: none; }
.ranksheet .rank { gap: 16px; }
.ranksheet .rinfo h3 { font-size: 26px; overflow-wrap: anywhere; }
.ranksheet .missions { border-top: 1px solid var(--rule); padding-top: 14px; }
.ranksheet .missions li { grid-template-columns: 22px minmax(0, 1fr) 72px 36px; }
.ranksheet .actions { justify-content: flex-end; margin-top: 18px; }
@media (max-height: 500px) {
  .ranksheet .today { gap: 10px; }
  .ranksheet .rbadge { width: 52px; height: 52px; }
  .ranksheet .rinfo h3 { font-size: 22px; margin: 2px 0 6px; }
  .ranksheet .missions { padding-top: 10px; }
  .ranksheet .missions ul { gap: 5px; }
  .ranksheet .actions { margin-top: 10px; }
}

/* ---------- launch fixes ---------- */
/* Cutouts: held sideways, a phone's camera notch sits on the left or right. The board stays
   full-bleed; every control keeps clear of it. */
:root { --edge-l: max(16px, calc(env(safe-area-inset-left, 0px) + 8px)); --edge-r: max(16px, calc(env(safe-area-inset-right, 0px) + 8px)); }
.hud-top, .hud-bottom { left: var(--edge-l); right: var(--edge-r); }
.maptop, .ahtop { padding-left: var(--edge-l); padding-right: var(--edge-r); }
.worlds { padding-left: var(--edge-l); padding-right: var(--edge-r); scrollbar-width: none; }
.worlds::-webkit-scrollbar { display: none; }
.ahmain { padding-left: max(var(--edge-l), 5vw); }

/* Pause: one button on a phone, and a sheet with the rest. */
.ico { width: 20px; height: 20px; fill: currentColor; display: block; }
.btn-pause { display: none; }
#btnUndo .ico { display: none; }
.pausecard { max-width: 420px; width: 100%; }
.pausecard h2 { font-family: var(--display); font-weight: 900; font-stretch: 120%; text-transform: uppercase; font-size: 30px; margin: 2px 0 14px; }
.pausegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pausegrid button { min-height: 48px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.pausegrid #pzResume { grid-column: 1 / -1; font-family: var(--display); font-stretch: 115%; text-transform: uppercase; font-size: 20px; box-shadow: 0 4px 0 var(--house-ink); }
.pausegrid #pzResume::before { content: '\25B6'; font-size: 0.7em; margin-right: 10px; vertical-align: 0.12em; }
.pztoggle b { margin-left: 4px; color: var(--house-ink); }
.askcard { max-width: 420px; width: 100%; }
.askcard h2 { font-family: var(--display); font-weight: 900; font-stretch: 120%; text-transform: uppercase; font-size: 26px; margin: 0 0 6px; }
.askcard .actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.askcard .actions button { min-height: 46px; font-size: 15px; }

/* Power card: on a short phone it hangs under the top bar, next to the chips, clear of the slingshot. */
.power.up { position: absolute; top: 62px; left: var(--edge-l); max-width: min(440px, calc(100% - 32px)); flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 8px 12px;
  background: rgba(18, 15, 10, 0.92); color: #F1EDE1; border: 1px solid rgba(241, 237, 225, 0.2); border-left: 4px solid var(--house); border-radius: 12px; pointer-events: auto; }
.power.up strong { color: #FF8A84; font-size: 12.5px; white-space: nowrap; }
.power.up span { color: rgba(241, 237, 225, 0.85); font-size: 12.5px; line-height: 1.3; }
.power.up.live { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.45); }
.power.up.live span { color: #FFFFFF; }
.power.up.tuck { transform: translateY(-8px); }

/* First shot: the coach card steps aside while you drag, and a finger shows the pull. */
.coach { transition: opacity 0.15s ease; }
.coach.away { opacity: 0; }
.coachhand { position: absolute; width: 0; height: 0; pointer-events: none; }
.coachhand i { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); border: 3px solid #14110B;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); animation: coachPull 1.8s ease-in-out infinite; }
.coachhand::before { content: ''; position: absolute; left: -64px; top: 0; width: 64px; height: 0; border-top: 3px dashed rgba(20, 17, 11, 0.45); transform-origin: right center; transform: rotate(-28deg); }
@keyframes coachPull {
  0% { transform: translate(0, 0) scale(1.15); opacity: 0; }
  15% { transform: translate(0, 0) scale(1); opacity: 1; }
  65% { transform: translate(-56px, 30px) scale(1); opacity: 1; }
  80%, 100% { transform: translate(-56px, 30px) scale(0.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .coachhand i { animation: none; transform: translate(-40px, 22px); } }

/* Win card: one filled button (Next). Sharing is a clear second choice, not a rival. */
.sharerow .b-share { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.sharerow .b-share.lead { background: transparent; color: var(--ink); border: 2px solid var(--house); box-shadow: none; font-weight: 800; }
.sharerow .b-share.lead::before { content: '\2197'; margin-right: 6px; color: var(--house); }

/* Map: the world name sits on a dark band, so it reads on the pale worlds too. */
.world header { background: linear-gradient(180deg, rgba(12, 10, 6, 0.62), rgba(12, 10, 6, 0.32) 70%, rgba(12, 10, 6, 0)); padding-bottom: 14px; }

/* Title: a locked Daily Shot reads as locked. */
.ahmode.locked { opacity: 0.6; }
.ahmode.locked svg { color: rgba(247, 241, 227, 0.6); }

/* Title and map buttons: 44px tall, a comfortable thumb target. */
.ahchip { min-height: 44px; }
.ahicon { width: 44px; height: 44px; }
.maptop .b-ghost { min-height: 44px; }

/* The intro card's Play is the main action: make it look like one. */
#btnPlay { font-size: 17px; padding: 12px 30px; min-height: 48px; box-shadow: 0 4px 0 var(--house-ink); }

@media (max-height: 500px) {
  .hud-top { overflow: visible; }
  .pill.btn { min-height: 40px; }
  .btn-pause { display: grid; place-items: center; width: 44px; padding: 0; }
  .hud-top #btnPrecise, .hud-top #btnRetry, .hud-top #btnLevels, .hud-top #btnSound { display: none; }
  #btnUndo { display: grid; place-items: center; width: 44px; padding: 0; }
  #btnUndo .ico { display: block; }
  #btnUndo .lbl { display: none; }
  .hud-top .shots { padding: 7px 10px; }
  .modal { padding-left: var(--edge-l); padding-right: var(--edge-r); }
  .pausecard h2 { font-size: 24px; margin-bottom: 10px; }
  #btnPlay { font-size: 16px; padding: 10px 26px; }
}

/* Title: solid mode tiles, so the level behind never collides with their labels. */
.ahmode { background: rgba(14, 12, 8, 0.86); border-color: rgba(247, 241, 227, 0.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Team Match setup: Start stays in reach. The buttons stick to the bottom of the sheet while it
   scrolls, and on short landscape phones the sheet tightens so it nearly fits one screen. */
#matchSetup .actions { position: sticky; bottom: -20px; z-index: 1; background: var(--paper); margin: 14px -22px -20px; padding: 12px 22px 16px; border-top: 1px solid var(--rule); border-radius: 0 0 14px 14px; }
@media (max-height: 500px) {
  #matchSetup .card { padding: 14px 18px 16px; }
  #matchSetup .eyebrow, #matchSetup .ms-note { display: none; }
  #matchSetup h2 { font-size: 24px; margin: 0 0 4px; }
  #matchSetup h3 { margin: 10px 0 5px; }
  #matchSetup .teamgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  #matchSetup .tcard { padding: 6px; gap: 4px; }
  #matchSetup .tcard[aria-pressed="true"] { padding: 5px; }
  #matchSetup .tcard .tn { font-size: 11.5px; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #matchSetup .tcard .faces canvas { width: 19px; height: 19px; }
  #matchSetup .seg button { padding: 6px 12px; font-size: 13px; }
  #matchSetup .actions { bottom: -16px; margin: 10px -18px -16px; padding: 8px 18px 10px; }
}

/* More games: a tile on the title screen, a sheet with one featured game, and a full-screen card
   for one of our games when an ad break has no Google ad to show. Screenshots keep the phone's
   real shape inside a dark phone frame. */
.ahmodes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ahmore .ahicons { display: flex; height: 20px; margin-bottom: 2px; }
.ahmore .ahicons img { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #14110B; margin-right: -6px; box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.ahmore { border-color: rgba(242, 194, 48, 0.55); }
@media (max-width: 560px) { .ahmodes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ahmore { grid-column: 1 / -1; } }
.mgsheet { display: grid; gap: 14px; }
.mghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mghead h2 { margin: 2px 0 0; }
.mgbody { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mgfeat { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--rule); }
.mgphone { flex: none; padding: 4px; border-radius: 16px; background: #050403; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.mgphone img { display: block; height: min(46vh, 250px); width: auto; max-width: none; border-radius: 12px; }
.mginfo { display: grid; gap: 6px; align-content: start; min-width: 0; }
.mginfo h3 { font-family: var(--display); font-stretch: 115%; font-weight: 900; font-size: 22px; line-height: 1; text-transform: uppercase; margin: 2px 0 0; color: var(--ink); letter-spacing: 0; }
.mginfo p { margin: 0; font-size: 14px; line-height: 1.4; }
.mgicon { width: 52px; height: 52px; border-radius: 13px; border: 2px solid #14110B; }
.mggenre { font: 600 11.5px/1.2 var(--mono) !important; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.mgget { justify-self: start; margin-top: 4px; padding: 11px 18px; font-weight: 800; }
.mglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mglist li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--rule); }
.mglist img { width: 38px; height: 38px; border-radius: 9px; border: 1.5px solid #14110B; }
.mglist b { display: block; font-size: 14px; line-height: 1.1; }
.mglist small { font: 600 11px/1.2 var(--mono); color: var(--ink-2); }
.mglist em { font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: var(--ink-2); padding: 0 6px; }
.mgsmall { cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 0; background: #2FA866; color: #fff; font-weight: 800; font-size: 13px; }
.housead { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(8, 6, 3, 0.9); overflow-y: auto; }
.hacard { display: flex; gap: 22px; align-items: center; max-width: 720px; padding: 18px; border-radius: 18px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.hacard .mgphone img { height: min(72vh, 380px); }
.hacard .mginfo h3 { font-size: 30px; }
.hacard .mginfo p { font-size: 15px; }
.haactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.newscard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.newscard img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--rule); }
.newscard h2 { margin: 2px 0 8px; }
.newsneed { font: 600 12.5px/1.3 var(--mono); color: var(--gold); }
@media (max-height: 500px) {
  .mgphone img { height: min(52vh, 200px); }
  .mgsheet { gap: 10px; }
  .mgsheet .mghead h2 { font-size: 24px; }
  .mglist { gap: 4px; } .mglist li { padding: 4px 8px; }
  .hacard { padding: 14px; gap: 16px; } .hacard .mgphone img { height: min(76vh, 300px); }
  .hacard .mginfo h3 { font-size: 24px; } .hacard .mginfo p { font-size: 13.5px; }
}
@media (orientation: portrait), (max-width: 560px) {
  .mgbody, .newscard { grid-template-columns: 1fr; }
  .hacard { flex-direction: column; text-align: left; } .hacard .mgphone img { height: min(44vh, 360px); }
}
@media (max-height: 500px) and (orientation: landscape) {
  #gModal .card.gcard:has(.mgsheet) { padding: 12px 16px 14px; }
  .mgsheet .eyebrow { display: none; }
  .mghead h2 { margin: 0; }
  .mghead .b-ghost { padding: 7px 14px; }
  .mgfeat { padding: 10px; gap: 12px; }
  .mgfeat .mgphone img { height: min(54vh, 196px); }
  .mgfeat .mgicon { width: 40px; height: 40px; border-radius: 10px; }
  .mgfeat .mginfo h3 { font-size: 19px; }
  .mgfeat .mginfo p { font-size: 13px; line-height: 1.32; }
  .mgfeat .mgget { padding: 9px 14px; font-size: 14px; }
  .mglist li { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 3px 8px; gap: 8px; }
  .mglist img { width: 28px; height: 28px; border-radius: 7px; }
  .mglist b { display: inline; font-size: 13px; }
  .mglist small { display: block; font-size: 10px; }
  .mgsmall { padding: 5px 12px; font-size: 12px; }
}
