:root{--bg:#061910;--edge:#38604d;--mint:#bbd2c5;--gold:#ebcf8c;--green:#133e2b}*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{background:radial-gradient(ellipse at 48% 0%,#1a422e 0%,#081f16 48%,#06160f 100%);color:#f2f5ed;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer;font:inherit}button:disabled{opacity:.45;cursor:not-allowed}.shell{width:min(1260px,100%);margin:auto;padding:18px 22px 25px}.masthead{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:15px}.brand{display:flex;gap:12px;align-items:center}.brandmark{height:49px;width:49px;border:1px solid #b8a473;color:#061910;font-size:28px;font-weight:1000;display:flex;align-items:center;justify-content:center;background:var(--gold);border-radius:13px;position:relative}.brandmark span{font-size:12px;position:absolute;bottom:-3px;right:-4px;background:#173e29;border-radius:50%;padding:2px}.brand small{font-size:10px;font-weight:900;letter-spacing:.22em;color:#9eaf9f}.brand h1{margin:1px 0 0;font-size:clamp(24px,3vw,37px);line-height:1.05;font-weight:1000;letter-spacing:-.045em}.brand h1 em{font-style:normal;color:var(--gold)}.actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.subtle,.primary{min-height:38px;padding:9px 14px;border-radius:11px;border:1px solid #3c6652;font-size:12px;font-weight:850;text-decoration:none;white-space:nowrap}.subtle{color:#f0f3e9;background:#173b2d}.subtle:hover{background:#25513d}.primary{border-color:#eac987;background:#eac987;color:#0b2319}.primary:hover{background:#ffe0a2}.scoreboard{display:grid;grid-template-columns:1fr 1fr 1.5fr 1fr 1fr;gap:10px;margin-bottom:12px}.stat{background:linear-gradient(150deg,#193e2c,#0a281d);border:1px solid #3b614c;border-radius:12px;padding:9px 14px;display:flex;flex-direction:column;gap:4px}.stat>span{font-size:10px;color:#9aaf9f;letter-spacing:.12em;font-weight:900}.stat b{color:#f4f2e9;font-size:17px;line-height:1.25;white-space:nowrap;font-variant-numeric:tabular-nums}.stat b i{font-style:normal;color:#89a897;font-size:12px}.stat b.gold{color:#e7c87a;letter-spacing:.05em}.life{display:flex;align-items:center;gap:8px}.hp-mini{display:inline-block;border-radius:20px;overflow:hidden;background:#24352b;width:60px;height:7px}.hp-mini span{display:block;background:#65d99b;width:100%;height:100%}.arena{position:relative;border:2px solid #426a55;border-radius:17px;overflow:hidden;background:#0d291d;box-shadow:0 20px 85px #0008;isolation:isolate}.arena:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 35px #04180c55;border-radius:15px}.arena canvas{display:block;width:100%;height:auto;touch-action:none;user-select:none;cursor:crosshair}.status-pill{position:absolute;top:12px;left:50%;transform:translateX(-50%);background:#071b16df;border:1px solid #68847388;border-radius:9px;color:#f4d893;font-weight:1000;letter-spacing:.035em;font-size:clamp(10px,1.6vw,13px);padding:9px 13px;white-space:nowrap;pointer-events:none;max-width:94%;overflow:hidden;text-overflow:ellipsis}.hint-side{position:absolute;bottom:12px;font-size:10px;font-weight:900;letter-spacing:.12em;padding:7px 11px;border-radius:7px;background:#092115ad;color:#f0d692;pointer-events:none}.hint-side.left{left:12px}.hint-side.right{right:12px;color:#ffb9aa}.aim-ui{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);min-width:240px;display:flex;align-items:center;gap:10px;background:#0a201ae8;border:1px solid #bda879a0;padding:8px 12px;border-radius:9px;color:#f0d693;font-size:10px;font-weight:1000}.aim-ui[hidden]{display:none}.gauge{height:7px;width:85px;overflow:hidden;background:#234532;border-radius:8px}.gauge span{display:block;height:100%;width:0%;background:linear-gradient(90deg,#94cf81,#f2c76d)}.helpbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:15px}.guide{display:flex;align-items:center;gap:11px}.guide-icon{width:38px;height:38px;border-radius:9px;border:1px solid #46705a;background:#1a432f;display:grid;place-items:center;color:#eed294;font-weight:900;font-size:20px;flex-shrink:0}.guide strong{display:block;font-size:12px;margin-bottom:3px}.guide small{display:block;font-size:11px;color:#97b4a1;line-height:1.55;max-width:660px}.level-pills{display:flex;gap:5px}.level-pills button{min-width:34px;height:34px;border:1px solid #396249;border-radius:8px;background:#112e20;color:#789987;font-weight:900;font-size:12px}.level-pills button.active{background:#eac987;color:#16251b;border-color:#eac987}.level-pills button.unlocked{color:#f0d693}.footnote{margin:14px 0 0;color:#789f87;text-align:center;font-size:10px;font-weight:700;letter-spacing:.09em}.result-backdrop{position:absolute;inset:0;z-index:8;background:#061b14ae;display:grid;place-items:center;padding:16px;backdrop-filter:blur(4px)}.result-backdrop[hidden]{display:none}.result-card{background:linear-gradient(150deg,#1c4933,#08241a);border:1px solid #c3a86e;border-radius:18px;padding:25px;text-align:center;box-shadow:0 18px 70px #0009;width:min(380px,100%)}.result-kicker{font-size:11px;letter-spacing:.22em;font-weight:900;color:#ebd08e}.result-card h2{font-size:30px;letter-spacing:-.04em;line-height:1.1;margin:8px 0 0}.result-stars{font-size:36px;letter-spacing:.12em;color:#ebcc80;margin:8px 0}.result-card p{font-size:13px;color:#aac7b6;margin:8px 0 18px}.result-buttons{display:flex;gap:8px;justify-content:center}.result-buttons button{flex:1}@media(max-width:750px){.shell{padding:10px 7px 18px}.masthead{padding:0 5px}.brandmark{height:39px;width:39px;font-size:23px}.brand h1{font-size:25px}.brand small{font-size:8px}.actions{gap:4px}.actions .subtle{font-size:10px;padding:7px;min-height:32px}.scoreboard{gap:5px}.stat{padding:6px 7px}.stat>span{font-size:8px}.stat b{font-size:12px}.stat b i{font-size:9px}.hp-mini{width:27px}.arena{border-radius:9px}.status-pill{top:6px;padding:5px 7px}.hint-side{bottom:5px;font-size:7px;padding:4px 6px}.helpbar{align-items:flex-start;flex-direction:column;padding:0 5px}.level-pills{align-self:flex-end}.footnote{font-size:8px;padding:0 6px}}@media(max-width:490px){.masthead{flex-wrap:wrap}.actions{justify-content:flex-start}.stat b{font-size:11px}.status-pill{font-size:8px}.guide small{font-size:10px}.aim-ui{transform:translateX(-50%) scale(.75);transform-origin:bottom center;bottom:1px}}

/* 20 stages: one horizontal, swipeable strip on phones and tablets. */
.helpbar{display:block}.level-pills{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}.level-pills button{min-width:39px;height:37px}@media(max-width:750px){.level-pills{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;width:100%;padding:2px 4px 10px;scrollbar-width:thin}.level-pills button{flex:0 0 39px}}

.arena,.arena canvas,.arena .aim-ui{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;touch-action:none} .arena{overscroll-behavior:contain} .level-pills{flex-wrap:wrap} .status-pill[hidden]{display:none}

.scoreboard{grid-template-columns:repeat(6,minmax(0,1fr))}.shop-area{margin-top:12px}.shop-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px;color:#a9c5b0}.shop-bar>span{margin-left:auto}.special-toggle{display:flex;align-items:center;gap:6px}.shop-panel{margin-top:10px;background:#103222;border:1px solid #45684e;border-radius:12px;padding:12px}.shop-panel[hidden]{display:none}.shop-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.shop-grid>div{display:flex;flex-direction:column;gap:7px;padding:11px;background:#173d2b;border-radius:9px}.shop-grid small{color:#a5c0ac}.shop-grid button{padding:9px;background:#eac987;color:#10291b;border:0;border-radius:8px;font-weight:800}.shop-grid button:disabled{opacity:.4}.shop-panel p{margin:10px 0 0;font-size:12px;color:#abc1ac}@media(max-width:800px){.scoreboard{grid-template-columns:repeat(3,minmax(0,1fr))}.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.shop-bar>span{margin-left:0}}

.rules-overlay{position:fixed;inset:0;z-index:150;display:grid;place-items:center;background:#03130edc;padding:15px;overflow:auto;overscroll-behavior:contain}.rules-overlay[hidden]{display:none}.rules-visible{overflow:hidden}.rules-card{width:min(690px,100%);max-height:min(92dvh,820px);overflow-y:auto;border:1px solid #a58c55;background:linear-gradient(155deg,#183d2b,#071e16);border-radius:17px;padding:22px;box-shadow:0 18px 80px #000c}.rules-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.rules-head h2{font-size:clamp(18px,3vw,25px);color:#f0d395;margin:0}.rules-head .subtle{min-height:32px}.rules-intro{font-size:13px;color:#b8cdbd;line-height:1.55}.rules-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.rules-grid>div{background:#1b46318c;border:1px solid #385b47;border-radius:11px;padding:13px}.rules-grid b{color:#f0d395;font-size:13px}.rules-grid p{color:#c4d5c8;font-size:12px;line-height:1.5;margin:6px 0 0}.rules-note{font-size:11px;color:#b9c6aa}.rules-start{width:100%;margin-top:8px;font-size:13px}@media(max-width:600px){.rules-card{padding:14px}.rules-grid{grid-template-columns:1fr;gap:7px}.rules-grid>div{padding:9px}.rules-grid p{margin:4px 0 0}}

/* v1.4 compact game layout: keep the field in the visible viewport. */
html,body{overscroll-behavior:none}body{min-height:100dvh}.shell{height:100dvh;min-height:0;padding:6px 10px;display:flex;flex-direction:column;gap:4px;overflow:hidden}.masthead{margin-bottom:0;flex-shrink:0}.brandmark{height:31px;width:31px;font-size:18px}.brand h1{font-size:20px}.brand small{font-size:8px}.actions .subtle{min-height:28px;padding:5px 8px}.scoreboard{margin-bottom:0;gap:4px;flex-shrink:0}.stat{padding:4px 7px;gap:1px}.stat b{font-size:13px}.stat>span{font-size:8px}.arena{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center}.arena canvas{width:auto;height:100%;max-width:100%;object-fit:contain;aspect-ratio:1000/560}.shop-area{margin-top:0;flex-shrink:0}.shop-bar{gap:5px;font-size:10px}.shop-bar>span{display:none}.helpbar{margin-top:0;flex-shrink:0;max-height:40px;overflow-x:auto}.level-pills{flex-wrap:nowrap;justify-content:flex-start}.level-pills button{min-width:28px;height:26px;padding:2px;font-size:10px}.ball-choices{display:flex;gap:5px}.ball-choice{background:#163d2a;color:#fff;border:1px solid #526a52;border-radius:9px;min-width:65px;display:flex;align-items:center;justify-content:center;gap:3px;padding:4px 6px;font-size:19px}.ball-choice small{font-size:8px;display:block;font-weight:900}.ball-choice.active{border:2px solid #f2d080;box-shadow:0 0 0 1px #f2d08055}.ball-choice.explosive{background:#5d3026}.ball-choice.multi{background:#243b73}.ball-choice.unavailable{opacity:.55}.shop-panel{position:fixed;z-index:30;left:50%;transform:translateX(-50%);bottom:10px;width:min(790px,96vw);max-height:77dvh;overflow-y:auto;box-shadow:0 18px 70px #000c}.result-buttons{flex-wrap:wrap}.result-buttons button{min-width:100px}.rules-overlay{z-index:60}@media(max-width:700px){.shell{padding:3px 5px}.brand h1{font-size:15px}.brandmark{display:none}.brand small{display:none}.actions .subtle{font-size:9px;padding:4px}.stat{padding:3px 4px}.stat b{font-size:11px}.scoreboard{grid-template-columns:repeat(6,minmax(0,1fr))}.stat>span{font-size:7px}.ball-choice{min-width:51px;font-size:16px}.ball-choice small{font-size:7px}.shop-grid{grid-template-columns:repeat(2,1fr)}}

/* v1.5: in-field controls, anchored away from aiming zone */
.arena>.shop-bar{position:absolute;z-index:7;top:8px;right:8px;display:flex;align-items:center;gap:6px;max-width:70%;padding:5px 7px;border:1px solid #7e956c77;border-radius:11px;background:#062017c9;box-shadow:0 2px 12px #0005;pointer-events:auto}.arena>.shop-bar>span{display:none}.arena>.shop-bar .ball-choice{min-width:46px;padding:3px 4px}.arena>.shop-bar .subtle{font-size:10px;padding:6px;min-height:28px}.shop-area{min-height:0}@media(max-width:700px){.arena>.shop-bar{top:4px;right:4px;gap:3px;padding:3px;max-width:72%}.arena>.shop-bar .ball-choice{min-width:38px;font-size:14px;padding:2px}.arena>.shop-bar .ball-choice small{font-size:6px}.arena>.shop-bar .subtle{font-size:8px;padding:3px}}

.level-pills,.helpbar{display:none!important}

/* FINAL CHAMPIONSHIP CELEBRATION */
.champion-backdrop{position:absolute;inset:0;z-index:21;display:grid;place-items:center;background:radial-gradient(ellipse at center,#175038ee,#031910f5);overflow:hidden;padding:10px}.champion-backdrop[hidden]{display:none}.champion-card{z-index:1;position:relative;width:min(560px,98%);max-height:98%;overflow:auto;text-align:center;background:linear-gradient(145deg,#1f583a,#09291d);border:2px solid #e6c676;border-radius:18px;box-shadow:0 0 60px #f0c46a44;padding:12px 18px;color:#fff}.champion-eyebrow{font-size:10px;letter-spacing:.2em;color:#edda9e;font-weight:900}.champion-card h2{margin:2px 0;font-weight:1000;font-size:clamp(19px,3vw,32px);color:#ffe39e}.team-stage{position:relative;height:clamp(125px,21vh,215px);background:radial-gradient(ellipse at 50% 85%,#32865c,#0a3727 70%);overflow:hidden;border-radius:14px;margin:8px 0}.trophy-rays{position:absolute;inset:-70%;background:repeating-conic-gradient(from 0deg,#f3d48a26 0 12deg,transparent 12deg 30deg);animation:spin 19s linear infinite}.trophy{font-size:clamp(40px,6vh,72px);position:absolute;top:3%;left:50%;transform:translateX(-50%);z-index:2;animation:liftcup 1.4s ease-in-out infinite alternate}.celebrating-team{position:absolute;bottom:13px;left:0;right:0;display:flex;align-items:flex-end;justify-content:center;gap:clamp(6px,2vw,22px)}.celebrating-player{position:relative;display:flex;flex-direction:column;align-items:center;animation:jump 1.1s ease-in-out infinite alternate;animation-delay:calc(var(--n)*.15s)}.celebrating-player .arms{height:16px;color:#ffe3a1;font-size:17px}.celebrating-player .arms span{font-size:13px}.celebrating-player .face{font-size:23px;line-height:1}.celebrating-player .kit{min-width:28px;padding:7px 3px;background:linear-gradient(90deg,#e6bd5f,#c9a34b);border-radius:5px 5px 2px 2px;color:#163b2b;font-size:11px;font-weight:1000}.celebrating-player .feet{font-size:14px;color:#c6d1b9}.podium{position:absolute;bottom:0;left:0;right:0;background:#cfb36e;color:#103021;font-weight:1000;font-size:10px;letter-spacing:.17em}.champion-stat{font-size:clamp(10px,1.5vw,13px);font-weight:800;color:#f5d896}.record-box{background:#071e17a6;border:1px solid #72967b70;border-radius:10px;padding:5px 9px;margin:7px auto;max-width:420px}.record-box>strong{font-size:11px;color:#edd397}.record-row{display:flex;justify-content:space-between;gap:9px;padding:2px 4px;border-bottom:1px solid #ffffff12;font-size:11px}.record-row small{font-size:10px;color:#a0bfac}.new-campaign{margin-top:3px;min-height:34px}.champion-card>small{display:block;margin-top:5px;color:#b6cabc;font-size:9px}.confetti-sky{position:absolute;inset:0;pointer-events:none;z-index:2;overflow:hidden}.confetti{position:absolute;top:-20px;width:7px;height:12px;opacity:.95;animation:confettifall 3s linear infinite}@keyframes confettifall{0%{transform:translate3d(0,-20px,0) rotate(0)}100%{transform:translate3d(100px,120vh,0) rotate(680deg)}}@keyframes liftcup{from{transform:translate(-50%,6px) rotate(-7deg)}to{transform:translate(-50%,-14px) rotate(7deg)}}@keyframes jump{from{transform:translateY(1px)}to{transform:translateY(-13px)}}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.confetti,.celebrating-player,.trophy,.trophy-rays{animation:none}}



/* Three-tier boss trophy ceremonies. Only stage 30 triggers records/new game. */
.boss-drop{position:absolute;left:50%;top:2%;font-size:28px;z-index:4;animation:bossfall .9s cubic-bezier(.28,.05,.8,1) both}
.bronze-ceremony .champion-card{border-color:#ca8856;background:linear-gradient(145deg,#573d29,#132b20)}
.bronze-ceremony .trophy{filter:sepia(1) saturate(2.4) hue-rotate(335deg);animation:bronzelift 1.3s 1s ease-out both}
.bronze-ceremony .celebrating-player{animation-duration:1.5s}
.bronze-ceremony .celebrating-player.supporting-player{transform:scale(.88)}
.silver-ceremony .champion-card{border-color:#d2dee7;background:linear-gradient(145deg,#34525b,#102c2b)}
.silver-ceremony .trophy{filter:grayscale(1) brightness(1.35);animation:silverlift 1.6s 1s ease-out both}
.silver-ceremony .celebrating-player{animation-duration:.8s}
.gold-ceremony .trophy{filter:drop-shadow(0 0 14px #ffcf59)}
@keyframes bossfall{0%{transform:translateY(-90px) scale(1.6) rotate(-25deg);opacity:1}70%{transform:translateY(55px) scale(1.1) rotate(75deg);opacity:1}100%{transform:translateY(65px) scale(.7) rotate(120deg);opacity:0}}
@keyframes bronzelift{from{transform:translate(-50%,55px) rotate(-20deg) scale(.65);opacity:0}to{transform:translate(-50%,-8px) rotate(0) scale(1);opacity:1}}
@keyframes silverlift{from{transform:translate(-50%,65px) scale(.7);opacity:0}to{transform:translate(-50%,-12px) scale(1.1);opacity:1}}

/* In-field cup ceremony; no separate emoji avatars. */
#ceremonyCanvas{display:block;width:100%;height:auto;max-height:min(37dvh,330px);border-radius:10px;touch-action:manipulation;background:#13382c}
.team-stage{overflow:hidden;min-height:0;height:auto!important;padding:0!important}
.champion-backdrop{touch-action:pan-y}
#game{touch-action:none!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html,body{overscroll-behavior:none;-webkit-text-size-adjust:100%}

/* Safari iPad: gestures on arena are reserved for aiming, not page zoom. */
.arena,.arena canvas{touch-action:none!important;-webkit-touch-callout:none!important;user-select:none!important;-webkit-user-select:none!important}
button,select,a{touch-action:manipulation}

/* GOALCU unified Play header — existing brand typography; no new logo. */
.masthead{min-height:43px;height:auto;display:flex;align-items:center;border-bottom:1px solid rgba(200,221,192,.23);padding-bottom:6px;gap:10px}
.gc-brand{display:flex;align-items:center;flex-wrap:nowrap;gap:9px;min-width:0}
.gc-brand-link{font:900 22px/1.1 system-ui,-apple-system,Segoe UI,Arial,sans-serif;letter-spacing:-1.2px;color:#f0f8ee;text-decoration:none;white-space:nowrap}
.gc-brand-link .gc-dot{color:#e4bd78}.gc-brand-link .gc-com{font-size:12px;letter-spacing:-.3px;color:#e4bd78;margin-left:1px}
.gc-separator{color:#829c85;font-size:17px}.gc-brand h1{font:780 19px/1.15 system-ui,-apple-system,Segoe UI,Arial,sans-serif;letter-spacing:-.45px;color:#e6eee4;margin:0;white-space:nowrap}
.masthead .actions{margin-left:auto}
.masthead .actions .subtle{background:#163a2b;border-color:#638468;color:#f0e0ad}
@media(max-width:700px){.gc-brand-link{font-size:17px}.gc-brand-link .gc-com{font-size:9px}.gc-brand h1{font-size:16px}.gc-brand{gap:5px}.masthead{gap:4px}.masthead .actions .subtle{font-size:9px}}


/* GOALCU Shoot Them mobile layout repair — 2026-10-28.
   Do not stretch the 1000x560 coordinate system: pointer aiming depends on it. */
@media (max-width: 699px) and (orientation: portrait) {
  html,body { min-height:100%; height:auto; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:auto; }
  .shell { width:100%; height:auto; min-height:100dvh; overflow:visible;
    display:flex; flex-direction:column; gap:8px; padding:10px 8px max(18px,env(safe-area-inset-bottom)); }
  .masthead { align-items:flex-start; flex-wrap:wrap; row-gap:9px; padding:2px 2px 9px; }
  .masthead .gc-brand { width:100%; }
  .masthead .actions { width:100%; margin-left:0; justify-content:flex-end; gap:7px; }
  .masthead .actions .subtle { min-height:36px; padding:8px 10px; font-size:11px; }
  .scoreboard { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .stat { min-width:0; padding:8px 7px; min-height:51px; gap:3px; }
  .stat>span { font-size:9px; letter-spacing:.035em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .stat b { font-size:15px; }
  .hp-mini { width:30px; }
  .arena { display:block; flex:none; width:100%; min-height:0; height:auto; aspect-ratio:1000/560;
    border-radius:12px; overflow:hidden; }
  .arena canvas#game { display:block; width:100%; height:auto; max-width:none; aspect-ratio:1000/560;
    object-fit:fill; }
  .shop-area { position:relative; flex:none; margin-top:0; }
  .shop-area>.shop-bar { position:static; display:flex; flex-wrap:wrap; justify-content:center; align-items:center;
    width:100%; max-width:none; padding:8px; gap:7px; border:1px solid #426a55;
    border-radius:12px; background:#102e20; }
  .shop-area>.shop-bar #shopToggle { width:100%; min-height:39px; font-size:12px; }
  .shop-area>.shop-bar .ball-choices { display:flex; justify-content:center; flex-wrap:wrap; gap:7px; }
  .shop-area>.shop-bar .ball-choice { min-width:82px; min-height:39px; padding:5px 7px; font-size:17px; }
  .shop-area>.shop-bar .ball-choice small { font-size:8px; }
  .shop-panel { bottom:max(10px,env(safe-area-inset-bottom)); }
  .result-backdrop { padding:6px; }
  .result-card { padding:12px; }
  .result-card h2 { font-size:22px; }
}
@media (max-width:699px) and (orientation:landscape) {
  .shell { padding:3px 5px; }
  .arena { min-height:0; }
  .arena canvas#game { max-width:100%; max-height:100%; object-fit:contain; }
}

/* Mobile end-of-level dialog: keep every action visible beyond the 1000:560 pitch. */
@media (max-width:699px) and (orientation:portrait) {
  #result.result-backdrop {
    position:fixed!important;
    inset:0!important;
    z-index:120!important;
    width:100vw;
    height:100dvh;
    max-height:100dvh;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow-y:auto;
    padding:calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
    background:#031810dc;
    -webkit-backdrop-filter:blur(5px);
    backdrop-filter:blur(5px);
  }
  #result.result-backdrop[hidden] { display:none!important; }
  #result .result-card {
    width:min(380px,100%);
    max-width:100%;
    max-height:calc(100dvh - 34px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y:auto;
    flex:0 1 auto;
    padding:clamp(16px,4vw,24px);
    border-radius:17px;
  }
  #result .result-card h2 {font-size:clamp(20px,5.6vw,27px);line-height:1.14;overflow-wrap:anywhere;}
  #result .result-stars {font-size:32px;margin:8px 0;}
  #result .result-card p {line-height:1.45;overflow-wrap:anywhere;}
  #result .result-buttons {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  #result .result-buttons button {width:100%;min-width:0;min-height:44px;padding:9px 7px;white-space:normal;line-height:1.2;font-size:12px;}
  #result #continue {grid-column:1/-1;}
}

/* 17.8.46: the rules dialog stays above page tools, including language/fullscreen. */
body.rules-visible #rulesOverlay{z-index:10000!important}
body.rules-visible #goalcu-language,body.rules-visible .gc-screen-tools{visibility:hidden!important;pointer-events:none!important}
