/* arcade.css — the Spark Arcade: lobby cards, gates, the round HUD, results.
   Part of The Ten Towers (E11 economy). Loaded after css/market.css.
   See brain/plans/E11-economy.md §4.4, §7.5 (Agent C, EC2). The .ec-panel/.card shell is
   from css/econ.css. */

.ar-panel .card{width:min(96vw,880px)}

/* ── head ── */
.ar-head{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}
.ar-head>div:first-child{flex:1 1 240px;min-width:0}
.ar-head h2{margin:0 0 4px}
.ar-head .sub{margin:0;font-size:13px;opacity:.78}
.ar-purse{display:flex;gap:8px;flex-wrap:wrap}
.ar-purse span{font-size:13px;font-weight:600;padding:6px 10px;border-radius:12px;
  background:rgba(156,235,208,.08);border:1px solid rgba(156,235,208,.22);white-space:nowrap}
.ar-purse b{font-size:16px;color:#9CEBD0}
.ar-head .x{float:none;font-size:18px;line-height:1;padding:8px 10px}

/* ── a section of games ── */
.ar-sec{margin-top:18px}
.ar-sec-h{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.6;margin-bottom:8px}
.ar-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.ar-empty{font-size:13px;opacity:.6;padding:10px 0}

/* ── one game card ── */
.ar-item{background:linear-gradient(150deg,rgba(156,235,208,.06),rgba(255,255,255,.02));
  border:1px solid rgba(156,235,208,.18);border-radius:14px;padding:12px;display:flex;
  flex-direction:column;gap:8px}
.ar-item.lock{opacity:.7;border-color:rgba(255,143,208,.2)}
.ar-item-top{display:flex;align-items:flex-start;gap:8px}
.ar-ic{font-size:24px;width:32px;text-align:center;flex:0 0 auto}
.ar-item-top>div:nth-child(2){flex:1 1 auto;min-width:0}
.ar-n{font-weight:700;font-size:14px}
.ar-blurb{font-size:11.5px;opacity:.72;line-height:1.4;margin-top:2px}
.ar-cost{font-weight:700;font-size:14px;color:#9CEBD0;white-space:nowrap}
.ar-best{font-size:12px;opacity:.8}
.ar-best b{color:#FFD27A}
.ar-why{font-size:12px;line-height:1.4;padding:6px 9px;border-radius:10px;
  background:rgba(255,143,208,.1);border:1px solid rgba(255,143,208,.22);color:#ffc4e2}
.ar-learn{display:flex;align-items:center;gap:8px;font-size:11px;opacity:.85}
.ar-learn>i{flex:1 1 auto;height:7px;border-radius:99px;background:rgba(255,255,255,.12);
  position:relative;overflow:hidden;min-width:60px}
.ar-learn>i::after{content:"";position:absolute;inset:0;width:var(--p,0%);
  background:linear-gradient(90deg,#5CC8FF,#9CEBD0);border-radius:99px}
.ar-b{padding:8px 14px;border-radius:11px;border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);color:#e7eaf3;font-weight:700;font-size:13px;cursor:pointer;min-height:36px}
.ar-b.go{background:#9CEBD0;color:#0e1a18;border-color:#9CEBD0}
.ar-b:disabled{opacity:.45;cursor:not-allowed}

/* the grown-up block reads as the grown-up's, not the child's */
.ar-parent{background:rgba(255,210,122,.05);border:1px solid rgba(255,210,122,.18);
  border-radius:14px;padding:12px}
.ar-parent .ar-row{margin-top:8px}

/* ── the round: HUD over the game host ── */
.ar-hud{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:12px;
  background:rgba(10,15,30,.6);border:1px solid rgba(156,235,208,.25);margin-bottom:10px}
.ar-hud-n{flex:1 1 auto;font-weight:700;font-size:14px;min-width:0}
.ar-hud-s,.ar-hud-t{font-size:12px;opacity:.85}
.ar-hud-s b,.ar-hud-t b{font-size:20px;color:#FFD27A;margin-right:3px}
.ar-stop{padding:6px 12px;border-radius:10px;border:1px solid rgba(255,143,208,.35);
  background:rgba(255,143,208,.12);color:#ffc4e2;font-weight:700;cursor:pointer;min-height:34px}

/* a round fills the screen: the stage column is one viewport tall, the game box takes all the
   height left under the title and the HUD (dvh where the browser has it, so a phone's URL bar
   never pushes the controls off the bottom). */
.stage-in.ar-stage{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-width:960px;
  padding:8px 12px 10px;min-height:calc(100vh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  min-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
.stage-in.ar-stage>.stage-top{flex:0 0 auto;padding:2px 0 8px}
.stage-in.ar-stage>.ar-hud{flex:0 0 auto;margin-bottom:8px}
.stage-in.ar-stage>.ar-host{flex:1 1 auto}
.stage-in.ar-stage>.ar-res{margin:auto 0}
.ar-host{position:relative;min-height:300px;display:flex;align-items:center;justify-content:center}
/* a 3D game: the box is the play surface (touch steers, never scrolls the page) */
.ar-host.ar-3d{min-height:min(320px,60vh);border-radius:14px;overflow:hidden;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
/* the 3D games park the shared world canvas in .ar-bg (a class, so the stage-level #stageBg
   that scene.css and 22-scene.js look up by id is never shadowed by a second one in here) */
.stage .ar-host .ar-bg{display:block;position:absolute;inset:0;z-index:0;border-radius:14px;overflow:hidden}
.ar-bg canvas.world{display:block;width:100%;height:100%;touch-action:none}
.ar-count{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(10,15,30,.6);border-radius:14px;z-index:5;pointer-events:none}
.ar-count b{font-size:64px;font-family:"Chakra Petch",sans-serif;color:#9CF0FF;
  text-shadow:0 0 30px rgba(92,200,255,.6)}

/* ── results ── */
.ar-res{text-align:center;display:flex;flex-direction:column;gap:10px;align-items:center}
.ar-res-h{font-family:"Chakra Petch",sans-serif;font-size:20px}
.ar-res-s{font-size:56px;font-weight:700;color:#FFD27A;line-height:1;
  text-shadow:0 0 30px rgba(255,210,122,.35)}
.ar-res-b,.ar-res-g,.ar-res-t{font-size:14px;opacity:.9}
.ar-res-b b,.ar-res-g b{color:#FFD27A}
.ar-res-t{color:#9CEBD0}
.ar-res-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:6px}

@media (max-width:560px){
  .ar-panel .card{padding:16px}
  .ar-row{grid-template-columns:1fr}
  .ar-b{padding:10px 16px;min-height:44px}
  .ar-hud-s b,.ar-hud-t b{font-size:17px}
  .ar-res-s{font-size:44px}
}

/* ── Code Bot (g1, DOM grid) ── */
.cb{width:100%;display:flex;flex-direction:column;gap:10px;align-items:center}
.cb-head{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;justify-content:center}
.cb-lv{font-weight:700;font-size:15px;color:#9CF0FF}
.cb-tip{font-size:12px;opacity:.7}
.cb-board{background:rgba(10,15,30,.5);border-radius:14px;padding:10px;border:1px solid rgba(92,200,255,.2)}
.cb-grid{display:grid;grid-template-columns:repeat(var(--w),minmax(34px,44px));
  grid-auto-rows:minmax(34px,44px);gap:3px}
.cb-cell{background:rgba(255,255,255,.06);border-radius:6px;display:flex;align-items:center;
  justify-content:center;font-size:20px;position:relative}
.cb-cell.wall{background:rgba(120,90,140,.4);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.cb-cell.goal{background:rgba(255,210,122,.18);box-shadow:inset 0 0 0 1px rgba(255,210,122,.4)}
.cb-cell.start{box-shadow:inset 0 0 0 1px rgba(156,235,208,.3)}
.cb-cell.bot::after{content:"";position:absolute;width:70%;height:70%;border-radius:50%;
  background:#9CF0FF;box-shadow:0 0 14px rgba(156,240,255,.8)}
.cb-cell.bot i{display:none}
.cb-pal{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.cb-chip{padding:7px 12px;border-radius:11px;border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.06);color:#e7eaf3;font-weight:700;font-size:13px;cursor:pointer;
  min-height:36px;display:inline-flex;align-items:center;gap:4px}
.cb-chip:hover{border-color:#9CF0FF}
.cb-prog{display:flex;gap:5px;flex-wrap:wrap;justify-content:center;min-height:38px;
  padding:6px;background:rgba(10,15,30,.4);border-radius:11px;max-width:100%}
.cb-chip.in{background:rgba(156,240,255,.14);border-color:rgba(156,240,255,.4);cursor:pointer}
.cb-empty{font-size:12px;opacity:.6;align-self:center;padding:6px 8px}
.cb-runs{min-height:22px;text-align:center}
.cb-say{font-size:13px;opacity:.85}
.cb-say.good{color:#9CEBD0}
.cb-say.bad{color:#ffc4e2}
.cb-ctrl{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}

/* ── Summit Climb + Seal Slide (3D games: the buttons float over the bottom of the canvas;
   tapping or swiping the play surface itself is the main control, the buttons are the backup) ── */
.gclimb-ui,.gseal-ui{position:absolute;inset:auto 0 0 0;display:flex;gap:10px;
  align-items:center;justify-content:space-between;padding:0 12px calc(12px + env(safe-area-inset-bottom,0px));
  z-index:4;pointer-events:none}
.gclimb-ui>*,.gseal-ui>*{pointer-events:auto}
.gclimb-b,.gseal-b{min-width:72px;min-height:60px;padding:12px 18px;border-radius:18px;
  border:1px solid rgba(255,255,255,.25);background:rgba(10,15,30,.55);color:#e7eaf3;
  font-weight:700;font-size:22px;cursor:pointer;backdrop-filter:blur(3px);touch-action:none;user-select:none}
.gclimb-b:active,.gseal-b:active{background:rgba(156,240,255,.3)}
.gclimb-h,.gseal-c{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:4;pointer-events:none;
  font-size:14px;opacity:.95;background:rgba(10,15,30,.6);padding:6px 12px;border-radius:10px;white-space:nowrap;text-align:center}
.gclimb-h b,.gseal-c b{color:#FFD27A;font-size:18px}
.gclimb-h i,.gseal-c i{font-style:normal;color:#9CF0FF;margin-left:6px}
.gseal-say{position:absolute;left:50%;top:46px;transform:translateX(-50%);z-index:4;pointer-events:none;font-size:16px;font-weight:700;
  background:rgba(10,15,30,.84);color:#fff;padding:5px 12px;border-radius:10px;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis;transition:opacity .3s}
.gseal-q{position:absolute;left:50%;top:84px;transform:translateX(-50%);z-index:4;pointer-events:none;font-size:clamp(18px,4.6vw,26px);font-weight:800;
  background:rgba(16,40,70,.82);border:2px solid #9CF0FF;color:#fff;padding:6px 16px;border-radius:12px;text-align:center;max-width:94%}
.gseal-f{position:absolute;bottom:42%;z-index:4;pointer-events:none;transform:translateX(-50%);font-size:22px;font-weight:800;color:#FFD27A;
  text-shadow:0 2px 6px rgba(0,0,0,.6);animation:gsealFloat .8s ease-out forwards}
@keyframes gsealFloat{0%{opacity:0;margin-bottom:0}15%{opacity:1}100%{opacity:0;margin-bottom:60px}}
@media (prefers-reduced-motion:reduce){.gseal-f{animation:none;opacity:1}.gseal-say{transition:none}}
.gclimb-tip{position:absolute;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);
  z-index:4;pointer-events:none;font-size:13px;opacity:.85;background:rgba(10,15,30,.5);padding:4px 10px;border-radius:9px;
  white-space:nowrap;transition:opacity .6s}
.gclimb-tip.off{opacity:0}

@media (max-width:560px){
  .cb-grid{grid-template-columns:repeat(var(--w),minmax(28px,1fr));grid-auto-rows:minmax(28px,1fr)}
  .cb-chip{padding:9px 12px;min-height:44px}
  .gclimb-b,.gseal-b{min-width:64px;min-height:56px;padding:10px 14px}
  .stage-in.ar-stage{padding:6px 8px 8px}
  .ar-hud{gap:8px;padding:6px 10px}
  .ar-stop{min-height:44px;padding:8px 12px}
}

/* ── E9 the campaign layer: the practice-question overlay (aqAsk) ──
   Sits above everything, on document.body, so it works over a 3D stage AND with WebGL off.
   Sized for 8–10 year olds on a phone: nothing tappable is under 60px, and the card scrolls
   internally so a long question can never push the buttons off screen. */
.aq-ask{position:fixed;inset:0;z-index:9000;display:flex;align-items:center;justify-content:center;
  padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));
  background:rgba(6,10,22,.72);backdrop-filter:blur(4px)}
.aq-card{width:min(560px,100%);max-height:100%;overflow:auto;background:#141a2e;color:#e7eaf3;
  border:1px solid rgba(156,240,255,.28);border-radius:22px;padding:18px 18px 16px;
  box-shadow:0 18px 50px rgba(0,0,0,.5)}
.aq-card-h{font-size:12px;letter-spacing:.14em;text-transform:uppercase;opacity:.6;margin-bottom:8px}
.aq-card-q{font-size:clamp(19px,4.4vw,26px);line-height:1.28;font-weight:700;margin-bottom:6px}
.aq-card-s{font-size:15px;line-height:1.4;opacity:.78;margin-bottom:14px}
/* two columns of big buttons; a single column when there are only two options */
.aq-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 12px}
.aq-grid.two{grid-template-columns:1fr}
.aq-btn{min-height:64px;padding:12px 14px;border-radius:16px;font-size:19px;font-weight:700;
  border:1px solid rgba(255,255,255,.2);background:rgba(156,240,255,.1);color:#e7eaf3;
  cursor:pointer;touch-action:manipulation;line-height:1.2;word-break:break-word}
.aq-btn:active{transform:scale(.97)}
/* right and wrong are marked with a ✓/✕ as well as a colour: the one place a colour-blind
   child must not lose the information */
.aq-btn.aq-ok{background:rgba(92,255,138,.22);border-color:rgba(92,255,138,.7)}
.aq-btn.aq-ok::after{content:' ✓'}
.aq-btn.aq-no{background:rgba(255,120,140,.16);border-color:rgba(255,120,140,.55);opacity:.55}
.aq-btn.aq-no::after{content:' ✕'}
.aq-btn.aq-dim{opacity:.45}
.aq-btn[data-answered]{pointer-events:none}
.aq-foot{font-size:16px;line-height:1.4;min-height:24px;color:#9CF0FF}
.aq-foot b{color:#FFD27A}
.aq-go{display:block;margin:12px auto 0;min-height:56px;padding:12px 26px;border-radius:16px;
  border:1px solid rgba(92,255,138,.6);background:rgba(92,255,138,.18);color:#e7eaf3;
  font-size:18px;font-weight:700;cursor:pointer;touch-action:manipulation}

@media (prefers-reduced-motion:reduce){
  .aq-btn:active{transform:none}
}
@media (max-width:560px){
  .aq-card{padding:16px 14px 14px;border-radius:18px}
  .aq-grid{gap:8px}
  .aq-btn{min-height:60px;font-size:17px;padding:10px 12px}
}


/* ── E9b the campaign runner: level map, level card, hearts, results, shop ── */
.aqr-map,.aqr-card,.aqr-shop{width:min(96vw,720px);margin:0 auto}
.aqr-head{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.aqr-story{font-size:clamp(16px,3.6vw,20px);font-weight:700;line-height:1.3}
.aqr-bar{display:flex;gap:8px;flex-wrap:wrap}
.aqr-bar span{font-size:14px;padding:6px 10px;border-radius:12px;background:rgba(156,235,208,.08);border:1px solid rgba(156,235,208,.22)}
.aqr-home{margin:8px 0;padding:8px 10px;border-radius:14px;background:rgba(255,255,255,.04)}
.aqr-home-n{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.6}
.aqr-home-row{display:flex;flex-wrap:wrap;gap:2px;font-size:22px;min-height:30px}
.aqr-home-row i{font-style:normal}
.aqr-home-0{font-size:13px;opacity:.6}
.aqr-world{margin-top:12px}
.aqr-world.lock{opacity:.6}
.aqr-world-h{font-size:13px;letter-spacing:.06em;text-transform:uppercase;opacity:.8;margin-bottom:6px}
.aqr-nodes{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.aqr-node{min-height:64px;border-radius:14px;border:1px solid rgba(156,235,208,.3);background:rgba(156,235,208,.1);
  color:inherit;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;touch-action:manipulation}
.aqr-node b{font-size:17px}.aqr-node span{font-size:12px;color:#FFD27A;letter-spacing:1px}
.aqr-node.boss{border-color:rgba(255,143,208,.6);background:rgba(255,143,208,.12)}
.aqr-node.lock{opacity:.5;cursor:default}
.aqr-foot{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.aqr-card-h{font-size:clamp(20px,4.6vw,28px);font-weight:800;margin-bottom:10px}
.aqr-goals{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.aqr-goal{font-size:17px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.05)}
.aqr-goal.got{background:rgba(92,255,138,.12)}.aqr-goal b{color:#FFD27A;margin-right:6px}
.aqr-tip{font-size:15px;opacity:.85;margin:8px 0}
.aqr-hud{position:relative;flex-wrap:wrap}
.aqr-hearts{font-size:18px;letter-spacing:2px}.aqr-cur{font-size:15px}
.aqr-prog{position:absolute;left:0;right:0;bottom:0;height:4px;background:rgba(255,255,255,.1)}
.aqr-prog i{display:block;height:100%;width:0;background:#5CFFE0;transition:width .2s}
.aqr-over{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:rgba(6,10,22,.72);padding:16px}
/* a red edge vignette, not a full wash: on the white storm a flat tint turned the whole screen pink */
.aqr-hurt{animation:aqrShake .4s}.aqr-hurt::after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at center,rgba(255,40,60,0) 42%,rgba(255,40,60,.6) 100%);pointer-events:none}
.aqr-hurt-soft::after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at center,rgba(255,40,60,0) 50%,rgba(255,40,60,.3) 100%);pointer-events:none}
@keyframes aqrShake{0%,100%{transform:none}25%{transform:translate(-6px,2px)}50%{transform:translate(5px,-2px)}75%{transform:translate(-3px,1px)}}
.aqr-star-row{display:flex;justify-content:center;gap:10px;font-size:54px;margin:6px 0}
.aqr-star{opacity:.35;color:#8a93b5}
.aqr-star.on{opacity:1;color:#FFD27A;animation:aqrPop .5s both;animation-delay:var(--d,0ms)}
@keyframes aqrPop{0%{transform:scale(.3);opacity:0}70%{transform:scale(1.25)}100%{transform:scale(1);opacity:1}}
.aqr-items{display:flex;flex-direction:column;gap:8px;margin:10px 0}
.aqr-item{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:rgba(255,255,255,.05)}
.aqr-item.own{opacity:.7}.aqr-item-ic{font-size:30px}
.aqr-item-n{flex:1;display:flex;flex-direction:column;font-size:13px}.aqr-item-n b{font-size:16px}
@media (prefers-reduced-motion:reduce){.aqr-hurt{animation:none}.aqr-star.on{animation:none}.aqr-prog i{transition:none}}
@media (max-width:560px){.aqr-nodes{grid-template-columns:repeat(3,minmax(0,1fr))}}
