.cg-shell { --cg-ink:#f5fbff; --cg-muted:#c1d6e5; color:var(--cg-ink); display:grid; gap:15px; min-width:0; font-family:inherit; }
.cg-shell * { box-sizing:border-box; }
.cg-shell [hidden] { display:none !important; }
.cg-shell button { cursor:pointer; font:inherit; }
.cg-shell button:focus-visible, .cg-shell canvas:focus-visible { outline:3px solid #fff097; outline-offset:2px; }
.cg-header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.cg-header h2 { margin:4px 0 0; max-width:670px; font-size:clamp(1.45rem,3.5vw,2.6rem); line-height:1.05; }
.cg-kicker { display:block; color:#87f4de; font-size:.67rem; font-weight:900; letter-spacing:.18em; }
.cg-menu { display:grid; gap:18px; }
.cg-hero { display:grid; grid-template-columns:minmax(210px,.78fr) 1fr; overflow:hidden; border:1px solid #89f9de80; border-radius:26px; background:linear-gradient(125deg,#1b4161,#193552 65%,#25536c); box-shadow:0 19px 50px #05152955; }
.cg-hero > div:last-child { padding:clamp(20px,3vw,42px); align-self:center; }
.cg-hero h3 { margin:9px 0 13px; max-width:600px; font-size:clamp(1.6rem,3.2vw,2.9rem); line-height:1.05; }
.cg-hero p { color:#d9eaf1; line-height:1.55; margin:0 0 13px; }
.cg-hero .cg-instructions { margin:14px 0 0; padding:13px 15px; border-left:3px solid #74f1df; border-radius:0 10px 10px 0; background:#102b42a3; font-size:.88rem; }
.cg-instructions b { color:#ffecac; }
.cg-hero-art { position:relative; min-height:258px; display:grid; place-items:center; overflow:hidden; background:radial-gradient(circle at 52% 33%,#fff7cdbb,transparent 23%),linear-gradient(145deg,#87eddf,#7e8ce9 56%,#4157b3); isolation:isolate; }
.cg-hero-art::before { content:''; position:absolute; width:130%; height:150%; top:18%; background:repeating-linear-gradient(90deg,#ffffff26 0 3%,transparent 3% 15%),linear-gradient(#ffffff2d,#293db348); transform:perspective(400px) rotateX(62deg); z-index:-1; }
.cg-hero-art::after { content:''; position:absolute; width:130px; height:130px; border:18px solid #f8efffa8; border-radius:50%; box-shadow:0 0 50px #e2f9ff; transform:translateY(-25px); z-index:-1; }
.cg-hero-art span { font-size:6.4rem; text-shadow:0 8px 35px #26458280; transform:translateY(21px); }
.cg-hero-art i, .cg-hero-art b { position:absolute; padding:12px 19px; border:3px solid #ddfff5; border-radius:14px; background:#32bba3df; color:white; font-size:2rem; font-style:normal; font-weight:950; box-shadow:0 10px 22px #1b568666; transform:rotate(-12deg); }
.cg-hero-art i { top:16%; left:9%; }.cg-hero-art b { right:8%; bottom:13%; background:#32bba3df; transform:rotate(8deg); }
.cg-worlds { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px; }
.cg-worlds section { min-width:0; padding:17px; border:1px solid color-mix(in srgb,var(--cg-accent) 52%,transparent); border-radius:22px; background:linear-gradient(140deg,#142f49,#203e5a); }
.cg-worlds h3 { margin:0 0 11px; font-size:1.07rem; }.cg-worlds h3 span { color:var(--cg-accent); font-size:.76rem; margin-right:7px; }
.cg-levels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.cg-levels button { min-height:84px; min-width:0; padding:8px 10px; display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; color:#f5fbff; border:1px solid #a4e0ec4c; border-radius:13px; background:#28506a; transition:transform .16s, background .16s; }
.cg-levels button:hover { transform:translateY(-3px); background:#34708b; }.cg-levels button b { color:var(--cg-accent); font-size:1rem; }.cg-levels button span { font-size:.79rem; line-height:1.15; }.cg-levels button small { color:#ffe8a5; letter-spacing:.07em; margin-top:auto; }
.cg-play { display:grid; gap:8px; min-height:0; scroll-margin-top:77px; }.cg-hud { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.cg-hud div { display:flex; justify-content:space-between; align-items:baseline; gap:6px; min-width:0; padding:9px 13px; border:1px solid #81e8dd62; border-radius:12px; background:#173e56; }
.cg-hud small { color:#b7dce5; font-size:.63rem; font-weight:900; letter-spacing:.11em; }.cg-hud strong { color:#eafffa; font-size:1rem; white-space:nowrap; }.cg-hud div:nth-child(2) strong { color:#7af7d9; }.cg-hud div:nth-child(3) strong { color:#ff9fb9; }
.cg-stage { position:relative; height:clamp(430px,69vh,800px); min-width:0; overflow:hidden; border:2px solid #8cf4e5; border-radius:21px; background:#7fe4f0; box-shadow:0 15px 39px #051b2b69; touch-action:none; }
.cg-stage canvas { display:block; width:100%; height:100%; touch-action:none; }
.cg-progress { position:absolute; inset:0 0 auto; height:8px; background:#0e46508c; pointer-events:none; }.cg-progress span { display:block; height:100%; width:0; background:linear-gradient(90deg,#67f9ce,#ffe585); box-shadow:0 0 18px #fff2a0; }
.cg-actions { position:absolute; top:15px; right:15px; display:flex; gap:7px; }.cg-actions button { width:44px; height:44px; border:1px solid #efffffd9; border-radius:11px; background:#155369bd; color:#fff; font-size:1.23rem; backdrop-filter:blur(8px); }
.cg-power { z-index:2; pointer-events:auto; }.cg-power button { position:relative; display:flex; align-items:center; justify-content:center; gap:8px; width:154px; min-height:66px; padding:5px 10px 9px; overflow:hidden; border:2px solid #d9fffa; border-radius:19px; background:#14394de8; color:white; box-shadow:0 7px 20px #0b4a647e; backdrop-filter:blur(8px); user-select:none; touch-action:manipulation; }.cg-power button:disabled { opacity:.9; cursor:default; }.cg-power button:not(:disabled) { background:#237d83ed; border-color:#f4fff9; box-shadow:0 6px 18px #073a4fb8; }.cg-power button.cg-active { background:#a6ecdfef; color:#103c4a; opacity:1; }.cg-power-icon { font-size:1.6rem; line-height:1; }.cg-power-label { font-size:.72rem; font-weight:950; white-space:nowrap; line-height:1.1; text-align:left; }.cg-power-label b { display:block; color:#d4fff4; font-size:.85rem; margin-top:3px; }.cg-power .cg-active b { color:#143f4c; }.cg-power i { position:absolute; left:0; bottom:0; height:5px; width:0; background:#a3ffe1; transition:width .16s linear; }
.cg-toast { position:absolute; top:57px; left:50%; transform:translateX(-50%); max-width:80%; padding:8px 17px; border-radius:100px; background:#133d56cf; color:#fff8d0; font-size:clamp(.8rem,2vw,1.1rem); font-weight:950; text-align:center; white-space:nowrap; box-shadow:0 5px 15px #17405d61; pointer-events:none; }
.cg-loading { position:absolute; inset:0; display:grid; place-items:center; background:#0d344bb3; color:white; font-size:1.4rem; font-weight:900; letter-spacing:.12em; text-align:center; }
.cg-overlay { position:absolute; inset:0; z-index:3; display:grid; place-items:center; padding:15px; background:#10344ac7; backdrop-filter:blur(7px); }
.cg-result { width:min(420px,100%); padding:26px; text-align:center; border:1px solid #a2fbe3; border-radius:24px; background:linear-gradient(#1a5268,#173953); box-shadow:0 16px 48px #062233ad; }.cg-result > span { display:block; font-size:4rem; line-height:1; }.cg-result h3 { margin:11px 0 4px; font-size:clamp(1.5rem,4vw,2.05rem); }.cg-result p { color:#e1edf2; line-height:1.4; }.cg-result div { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; }.cg-result button { padding:10px 13px; color:white; border:1px solid #9df6e1; border-radius:11px; background:#297b84; font-weight:800; }.cg-result button:hover { background:#369ca2; }
.cg-result .cg-result-detail { margin:4px 0 16px; color:#8bf2d6; font-size:.82rem; font-weight:800; }
.cg-touch { position:absolute; bottom:14px; left:13px; right:13px; display:flex; align-items:center; justify-content:space-between; gap:10px; pointer-events:none; }.cg-touch > button { pointer-events:auto; width:72px; height:66px; color:#fff; border:2px solid #e9fffa; border-radius:19px; background:#16576dc4; font-size:1.45rem; font-weight:950; user-select:none; touch-action:none; backdrop-filter:blur(8px); box-shadow:0 7px 20px #0b4a647e; }.cg-touch > button:active, .cg-power button:not(:disabled):active { background:#299eae; transform:scale(.96); }
.cg-stage[data-mode="battle"] .cg-touch, .cg-stage[data-mode="won"] .cg-touch, .cg-stage[data-mode="lost"] .cg-touch { display:none; }
.cg-bottom { display:flex; justify-content:space-between; align-items:center; gap:9px; color:#c7e2e9; font-size:.79rem; }.cg-bottom button { white-space:nowrap; }
.cg-shell:fullscreen { display:flex; flex-direction:column; height:100dvh; padding:7px; overflow:hidden; background:#12344b; gap:7px; }.cg-shell:fullscreen .cg-header { display:none; }.cg-shell:fullscreen .cg-play { display:flex; flex:1; flex-direction:column; min-height:0; }.cg-shell:fullscreen .cg-stage { flex:1; height:auto; min-height:0; }.cg-shell:fullscreen .cg-bottom { flex:0 0 auto; }
@media (max-width:850px) { .cg-worlds { grid-template-columns:1fr; }.cg-hero { grid-template-columns:1fr; }.cg-hero-art { min-height:195px; }.cg-hero-art span { font-size:4.7rem; }.cg-hero-art i, .cg-hero-art b { font-size:1.6rem; }.cg-hud div { flex-direction:column; align-items:flex-start; gap:0; padding:6px 8px; }.cg-hud strong { font-size:.88rem; }.cg-hud small { font-size:.55rem; } }
@media (max-width:600px) { .cg-header h2 { font-size:1.44rem; }.cg-header .control-button { font-size:.74rem; padding:7px 9px; }.cg-stage { height:min(65dvh,590px); min-height:360px; border-radius:15px; }.cg-touch { bottom:8px; left:8px; right:8px; }.cg-touch > button { width:58px; height:62px; border-radius:15px; }.cg-actions { top:10px; right:10px; }.cg-power button { width:126px; min-height:62px; padding:4px 7px 8px; gap:5px; border-radius:15px; }.cg-power-label { font-size:.67rem; }.cg-power-label b { font-size:.72rem; }.cg-power-icon { font-size:1.28rem; }.cg-bottom { flex-wrap:wrap; }.cg-bottom span { max-width:43%; }.cg-hero > div:last-child { padding:21px; } }
@media (max-width:390px) { .cg-hud small { font-size:.49rem; }.cg-hud strong { font-size:.76rem; }.cg-levels { gap:5px; }.cg-levels button { padding:7px; }.cg-touch > button { width:56px; height:58px; }.cg-power button { min-height:58px; width:116px; } }
@media (orientation:landscape) and (max-height:500px) { .cg-shell:has(.cg-play:not([hidden])) { position:fixed; inset:0; z-index:1000; display:flex; flex-direction:column; height:100dvh; width:100vw; padding:4px; overflow:hidden; background:#12344b; gap:4px; }.cg-shell:has(.cg-play:not([hidden])) .cg-header { display:none; }.cg-play { display:flex; flex:1; flex-direction:column; min-height:0; gap:4px; }.cg-stage { flex:1; height:auto; min-height:0; }.cg-hud { flex:0 0 auto; }.cg-hud div { padding:4px 8px; }.cg-bottom { flex:0 0 auto; font-size:.7rem; }.cg-bottom .control-button { padding:5px 8px; }.cg-touch > button { width:56px; height:52px; }.cg-power button { min-height:52px; width:132px; } }
@media (orientation:landscape) and (max-height:500px) { .game-stage:has(.cg-shell .cg-play:not([hidden])) { overflow:visible; backdrop-filter:none; } }
@media (prefers-reduced-motion:reduce) { .cg-levels button { transition:none; }.cg-power i { transition:none; } }

/* The command layer stays readable while the road remains the main play area. */
.cg-briefing { display:grid; grid-template-columns:1fr minmax(220px,.38fr); gap:18px; padding:20px; border:1px solid #82dbce55; border-radius:22px; background:#17394e; }
.cg-doctrines { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:11px; }
.cg-doctrines button { min-width:0; min-height:112px; padding:14px; display:grid; align-content:start; gap:7px; text-align:left; color:#effffb; border:1px solid #a6d9e76b; border-radius:14px; background:#254b62; }
.cg-doctrines button[aria-pressed="true"] { border:2px solid #c0ffeb; padding:13px; background:#315a70; }
.cg-doctrines span,.cg-difficulty small { color:#c4dee7; font-size:.8rem; line-height:1.4; }
.cg-difficulty { display:grid; align-content:start; gap:10px; font-size:.87rem; font-weight:800; }
.cg-difficulty select { width:100%; min-width:0; min-height:48px; padding:10px; border:1px solid #9bded1; border-radius:11px; color:#fff; background:#23495e; font:inherit; font-size:.8rem; }
.cg-instructions summary { min-height:44px; display:list-item; cursor:pointer; font-weight:900; padding:10px 0; }
.cg-instructions p { margin:10px 0; font-size:.84rem; }
.cg-logistics { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 16px; padding:0 5px; color:#c8e4e9; font-size:.75rem; }
.cg-logistics span:nth-child(2) { color:#ffdfa0; font-weight:900; }
.cg-actions { gap:6px; }
.cg-actions button { width:48px; height:48px; }
.cg-actions button { flex-shrink:0; min-width:44px; }
.cg-actions #cgFormation { width:100px; font-size:.76rem; font-weight:900; }
.cg-battle { position:absolute; top:76px; left:12px; right:12px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px 12px; padding:10px 14px; border:1px solid #fff1d5b3; border-radius:13px; color:#fff; background:#193e53e8; pointer-events:none; }
.cg-battle b { font-size:.8rem; }.cg-battle span { color:#ffdbb9; font-size:.77rem; font-weight:900; }
.cg-battle[data-kind="charge"] { background:#6d3545ed; }.cg-battle[data-kind="quake"] { background:#604a2bed; }.cg-battle[data-kind="volley"] { background:#514074ed; }
.cg-stage[data-mode="battle"] .cg-toast { top:132px; }
.cg-toast { white-space:normal; max-width:85%; line-height:1.3; top:76px; }
.cg-stage[data-mode="battle"] .cg-touch { display:flex; }
.cg-stage[data-mode="camp"] .cg-touch,.cg-stage[data-mode="camp"] .cg-actions { display:none; }
.cg-camp { width:min(760px,100%); max-height:100%; overflow:auto; padding:clamp(15px,3vw,28px); border:1px solid #b0e9d9; border-radius:22px; background:linear-gradient(135deg,#214d5f,#17394b); box-shadow:0 16px 48px #062233ad; }
.cg-camp h3 { margin:10px 0; font-size:clamp(1.2rem,3vw,1.9rem); }.cg-camp p { color:#d8e9ec; line-height:1.4; font-size:.88rem; }
.cg-upgrades { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.cg-upgrades button { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding:17px 14px; text-align:left; color:#f7fffc; border:1px solid #b7e6d9; border-radius:14px; background:#2b5667; }
.cg-upgrades button:hover { background:#376a79; }.cg-upgrades b { font-size:1rem; }.cg-upgrades span { font-size:.83rem; color:#d6e7ec; line-height:1.4; }.cg-upgrades small { margin-top:auto; color:#ffe0a4; font-weight:900; }
.cg-result { max-height:100%; overflow:auto; }.cg-record-note { font-size:.76rem; color:#bfd7e0; }
.cg-overlay { overflow:auto; }.cg-stage[data-mode="camp"] .cg-overlay { z-index:4; }
.cg-stage:is([data-mode="camp"],[data-mode="won"],[data-mode="lost"]),.cg-overlay,.cg-camp,.cg-result { touch-action:pan-y; }
@media(max-width:850px){ .cg-briefing { grid-template-columns:1fr; }.cg-doctrines button { min-height:122px; padding:11px; }.cg-doctrines button[aria-pressed="true"] { padding:10px; } }
@media(max-width:600px){
 .cg-briefing { padding:15px; }.cg-doctrines { grid-template-columns:1fr; }.cg-doctrines button { min-height:76px; }.cg-doctrines span { font-size:.77rem; }
 .cg-logistics { font-size:.65rem; gap:3px 9px; }.cg-logistics span:last-child { flex-basis:100%; }
 .cg-actions { top:12px; left:10px; right:10px; justify-content:flex-end; gap:5px; }.cg-actions #cgFormation { margin-right:auto; width:100px; }
 .cg-upgrades { grid-template-columns:1fr; gap:8px; }.cg-upgrades button { padding:12px; min-height:100px; gap:5px; }.cg-upgrades b { font-size:.9rem; }.cg-upgrades span { font-size:.77rem; }
 .cg-camp p { font-size:.8rem; }.cg-camp { padding:14px; }.cg-overlay { padding:10px; }.cg-battle { top:70px; padding:8px 11px; }
 .cg-stage[data-mode="battle"] .cg-toast { top:139px; font-size:.76rem; }
}
@media(orientation:landscape) and (max-height:500px){
 .cg-logistics { flex:0 0 auto; padding:0 3px; font-size:.62rem; }.cg-logistics span:last-child { flex-basis:auto; }
 .cg-actions { top:10px; left:auto; right:10px; }.cg-actions button { width:44px; height:44px; }.cg-actions #cgFormation { width:90px; }
 .cg-battle { top:11px; left:10px; right:auto; max-width:46%; padding:7px 10px; }.cg-battle b,.cg-battle span { font-size:.67rem; }
 .cg-stage[data-mode="battle"] .cg-toast,.cg-toast { top:65px; }.cg-camp { width:min(780px,100%); }.cg-camp h3 { margin:5px 0; }.cg-camp p { margin:6px 0; }
 .cg-upgrades { grid-template-columns:repeat(3,minmax(0,1fr)); }.cg-upgrades button { min-height:100px; padding:10px; }
}
@media(max-width:390px) and (orientation:portrait){
 .cg-actions button { width:44px; height:48px; }.cg-actions #cgFormation { width:74px; font-size:.7rem; }.cg-actions { gap:4px; left:8px; right:8px; }
}
@media(max-width:600px) and (max-height:700px) and (orientation:portrait){
 .cg-stage { height:calc(100dvh - 260px); min-height:280px; }
 .cg-hud div { padding:4px 6px; }.cg-logistics { font-size:.6rem; line-height:1.2; }.cg-play { gap:5px; }
 .cg-touch { bottom:7px; }.cg-battle { top:66px; }.cg-battle b,.cg-battle span { font-size:.65rem; }
 .cg-stage[data-mode="battle"] .cg-toast { top:121px; font-size:.65rem; }
 .cg-result { padding:16px; }.cg-result > span { font-size:2.4rem; }.cg-result h3 { font-size:1.25rem; }
}

/* The running game leaves the filtered catalogue frame and owns the actual viewport. */
.cg-shell.cg-immersive{position:fixed;inset:0;z-index:10000;width:100vw;max-width:none;height:100dvh;padding:7px;display:flex;flex-direction:column;gap:5px;background:#163441;overflow:hidden;translate:none!important;}
.cg-immersive .cg-header{display:none;}.cg-immersive .cg-play{display:flex;flex:1;min-height:0;flex-direction:column;gap:5px;}
.cg-immersive .cg-stage{flex:1;height:auto;min-height:0;border-radius:12px;}.cg-immersive .cg-hud,.cg-immersive .cg-logistics,.cg-immersive .cg-bottom{flex:0 0 auto;}
.cg-immersive .cg-bottom{font-size:.72rem;}.cg-immersive .cg-bottom .control-button{padding:5px 9px;min-height:32px;}
.cg-combo{position:absolute;left:14px;top:15px;padding:9px 13px;border:1px solid #d7fff0;border-radius:13px;background:#133e42da;color:#cbffe9;font-size:.8rem;font-weight:950;pointer-events:none;}
.cg-immersive .cg-toast{top:73px;max-width:94%;white-space:normal;line-height:1.2;}.cg-immersive .cg-stage[data-mode='battle'] .cg-toast{top:139px;}
@media(max-width:600px){.cg-shell.cg-immersive{padding:4px;gap:4px;}.cg-immersive .cg-logistics{font-size:.59rem;line-height:1.15;}.cg-immersive .cg-bottom{gap:4px;flex-wrap:nowrap;}.cg-immersive .cg-bottom span:first-child{display:none;}.cg-immersive .cg-bottom span{max-width:none;font-size:.64rem;flex:1;}.cg-immersive .cg-actions{left:7px;right:7px;gap:4px;}.cg-immersive .cg-actions #cgFormation{width:75px;}.cg-immersive .cg-actions button{width:43px;min-width:43px;height:44px;}.cg-immersive .cg-combo{top:68px;left:9px;font-size:.65rem;padding:6px 9px;}.cg-immersive .cg-toast{top:108px;font-size:.76rem;}.cg-immersive .cg-stage[data-mode='battle'] .cg-toast{top:139px;}}
@media(orientation:landscape) and (max-height:500px){.cg-immersive .cg-logistics{display:none;}.cg-immersive .cg-actions{right:8px;left:auto;}.cg-immersive .cg-combo{top:12px;}.cg-immersive .cg-toast{top:69px;}.cg-immersive .cg-stage[data-mode='battle'] .cg-toast{top:85px;}}

@media(max-width:600px){.cg-immersive .cg-actions{left:4px;right:4px;gap:3px;}.cg-immersive .cg-actions #cgFormation{width:64px;min-width:64px;font-size:.68rem;}.cg-immersive .cg-actions button{width:44px;min-width:44px;height:44px;}.cg-immersive .cg-actions .play-options-trigger{margin:0;padding:0;}}

.cg-loading{z-index:1;pointer-events:none;}.cg-actions{z-index:2;}.cg-immersive .cg-bottom #cgRetry{min-height:44px;min-width:90px;}
.cg-pace{pointer-events:auto;order:1}.cg-touch>button:first-of-type{order:0}.cg-touch .cg-power{order:2}.cg-touch>button:last-of-type{order:3}
.cg-pace button{width:124px;min-height:66px;border:2px solid #d9fffa;border-radius:16px;background:#173c4de8;color:#fff;touch-action:manipulation;line-height:1.3;padding:5px 7px}
.cg-pace small,.cg-pace b{display:block}.cg-pace small{font-size:.6rem;letter-spacing:.08em}.cg-pace b{font-size:.85rem}.cg-pace button[data-pace='careful']{background:#245f71ed}.cg-pace button[data-pace='rush']{background:#845c2ded}
@media(max-width:600px){.cg-touch:has(.cg-pace:not([hidden])){gap:5px;left:8px;right:8px}.cg-touch:has(.cg-pace:not([hidden]))>button{width:44px;min-width:44px;height:58px}.cg-touch:has(.cg-pace:not([hidden])) .cg-power button{width:100px;min-height:58px}.cg-touch:has(.cg-pace:not([hidden])) .cg-power-icon{display:none}.cg-pace button{width:88px;min-height:58px}.cg-pace b{font-size:.73rem}}
@media(orientation:landscape) and (max-height:500px){.cg-pace button{min-height:52px}}
