/* Entry-only presentation. Game arenas, physics and controls are untouched. */
html[data-chaos-entry],html[data-chaos-entry] body{margin:0!important;overflow:hidden!important;background:#173d4d!important}
html[data-chaos-entry] body>:not(#chaos-entry):not(#chaos-entry-fallback):not(noscript):not(script):not(style):not(link){display:none!important}
#chaos-entry{position:fixed;inset:0;z-index:10000;box-sizing:border-box;overflow:hidden;overscroll-behavior:contain;background:#173d4d;color:#fff8dc;font-family:'Trebuchet MS',Arial,sans-serif;text-align:center;touch-action:manipulation}
#chaos-entry[hidden],#chaos-entry [hidden]{display:none!important}
#chaos-entry *{box-sizing:border-box}
#chaos-entry .ce-stage{width:100%;height:100%;position:relative;isolation:isolate;container-type:size;background:#173d4d radial-gradient(ellipse at center,#286070,#173d4d 78%)}
#chaos-entry .ce-stage::before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#142e4166,transparent 24%);z-index:-1}
#chaos-entry button{font:inherit;cursor:pointer;touch-action:manipulation;text-transform:none;letter-spacing:normal;margin:0}
#chaos-entry button:focus-visible{outline:4px solid white;outline-offset:5px}
#chaos-entry .ce-page{height:100%;width:100%;min-height:0;position:relative;padding:max(16px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));display:flex;align-items:center;flex-direction:column;justify-content:center;gap:12px}
#chaos-entry .ce-page[data-page=welcome]{justify-content:space-between;padding-top:clamp(12px,3cqh,28px);padding-bottom:clamp(24px,7cqh,58px)}
#chaos-entry .ce-brand{font-size:clamp(37px,9cqh,86px);font-weight:1000;letter-spacing:-.065em;line-height:.85;margin:0;color:#fff4c0;transform:rotate(-4deg);position:relative;z-index:2;text-shadow:-3px -3px 0 #173b55,3px -3px 0 #173b55,-3px 3px 0 #173b55,3px 3px 0 #173b55,0 7px 0 #10273e,0 10px 0 #fff7df,0 13px 19px #10273e66}
#chaos-entry .ce-brand span{display:block;color:#ffd34b;font-size:1.18em;letter-spacing:-.04em}
#chaos-entry .ce-scene-description{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
#chaos-entry .ce-play{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;gap:16px;min-width:200px;min-height:50px;padding:8px 34px;border:3px solid #fff4ae;border-radius:18px;background:linear-gradient(#ffe781,#ffd145 60%,#f4b92a);color:#17334c;font-size:clamp(25px,4cqh,33px);font-weight:1000;box-shadow:0 0 0 3px #25485b,0 6px 0 #9a6121,0 11px 20px #19302366;transition:transform .16s,filter .16s;transform:rotate(-2deg)}
#chaos-entry .ce-play:hover{transform:rotate(-2deg) translateY(-3px);filter:brightness(1.06)}
#chaos-entry .ce-play:active{transform:translateY(4px)}
#chaos-entry .ce-play svg{width:25px;height:25px;fill:currentColor;flex:none}
#chaos-entry .ce-kicker{position:absolute;bottom:clamp(8px,2cqh,18px);left:0;right:0;font-size:10px;font-weight:900;letter-spacing:.14em;color:#fff6cd;text-shadow:0 2px 3px #153042;margin:0;text-transform:uppercase}
#chaos-entry .ce-page[data-page=menu]{background:radial-gradient(ellipse at 18% 35%,#1c6575,transparent 53%),radial-gradient(ellipse at 88% 80%,#264b72,transparent 60%),#10384f;justify-content:center;padding-top:12px;padding-bottom:18px;gap:14px}
#chaos-entry .ce-menu-head{width:min(1120px,100%);display:flex;align-items:center;justify-content:space-between;gap:14px;height:48px;flex:none}
#chaos-entry .ce-menu-head h2{font-size:clamp(24px,4.8cqh,40px);font-weight:1000;margin:0;letter-spacing:-.04em;color:#fff8df;text-shadow:0 3px 0 #1e4154,0 5px 12px #18344299}
#chaos-entry .ce-mini-brand{font-size:17px;line-height:.88;font-weight:1000;letter-spacing:-.045em;text-align:right;color:#fff4c0;transform:rotate(-4deg);text-shadow:0 3px 0 #18334c}
#chaos-entry .ce-mini-brand span{display:block;color:#ffd34b;font-size:1.2em}
#chaos-entry .ce-back{display:grid;place-items:center;border:2px solid #fff3bf;border-radius:14px;width:44px;height:44px;flex:none;color:#fff8dc;background:linear-gradient(#286d83,#164256);box-shadow:0 3px 0 #102d40}
#chaos-entry .ce-back svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:3}
#chaos-entry .ce-cards{display:flex;justify-content:center;align-items:center;gap:clamp(12px,2cqw,24px);width:min(1120px,100%);min-height:0;height:min(450px,calc(100cqh - 110px));padding:4px 5px 10px;flex:none;align-self:center}
#chaos-entry .ce-card{width:min(calc((100% - 48px)/3),calc(100cqh - 124px));aspect-ratio:1;flex:none;min-width:0;overflow:hidden;padding:0;border:3px solid #fff4c0;border-radius:22px;background:#124c67;color:#fff8df;text-align:left;display:block;position:relative;transition:transform .18s,border-color .18s,filter .18s;box-shadow:0 0 0 3px #143b52,0 6px 0 #143b52,0 12px 22px #061c2c66}
#chaos-entry .ce-card:hover,#chaos-entry .ce-card:focus-visible{transform:translateY(-4px);border-color:#ffd34b;filter:brightness(1.05)}
#chaos-entry .ce-card:active{transform:translateY(2px)}
#chaos-entry .ce-card-art{display:block;position:absolute;inset:0;background-image:url('/entry-race-v4.webp');background-size:cover;background-repeat:no-repeat;background-position:center}
#chaos-entry [data-scene=combat]{background-image:url('/entry-combat-v4.webp')}
#chaos-entry [data-scene=town]{background-image:url('/entry-town-v4.webp')}
#chaos-entry .ce-card-label{position:absolute;bottom:0;left:0;right:0;padding:30px 14px 13px;display:flex;align-items:flex-end;justify-content:space-between;gap:8px;background:linear-gradient(transparent,#102c45f5 48%);width:100%;min-height:82px}
#chaos-entry .ce-card-label>span:first-child{flex:1;min-width:0}
#chaos-entry .ce-card-title{font-weight:1000;font-size:clamp(21px,4.4cqh,36px);display:block;line-height:.98;color:#fff8dc;text-shadow:0 3px 0 #0a263b;letter-spacing:-.025em}
#chaos-entry .ce-card-detail{display:block;overflow-wrap:anywhere;font-size:12px;letter-spacing:0;text-transform:none;font-weight:800;color:#ffe9a6;margin-top:7px;line-height:1.25}
#chaos-entry .ce-go{border-radius:10px;height:34px;width:34px;display:grid;place-items:center;flex:none;background:linear-gradient(#ffe781,#ffd145);border:2px solid #fff5bc;color:#193a50;font-size:27px;font-weight:bold;line-height:1;box-shadow:0 3px 0 #956026}
#chaos-entry .ce-hint{display:none}
#chaos-entry .ce-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-end;flex-direction:column;padding:14px 24px max(20px,env(safe-area-inset-bottom));gap:10px;background:linear-gradient(0deg,#102f47ee,transparent 42%)}
#chaos-entry .ce-loading .ce-brand{position:absolute;top:clamp(12px,3cqh,28px)}
#chaos-entry .ce-loading h2{font-size:20px;color:#fff8dc;margin:0;text-shadow:0 3px 1px #14394b}
#chaos-entry .ce-load-track{height:13px;width:min(330px,60%);border:2px solid #fff4c0;border-radius:20px;background:#163d58;overflow:hidden;box-shadow:0 3px 0 #10283d}
#chaos-entry .ce-load-track span{display:block;width:35%;height:100%;border-radius:20px;background:#ffd653;animation:ce-load 1.4s ease-in-out infinite alternate}
#chaos-entry .ce-loading p{margin:0;color:#fff4d2;line-height:1.3;max-width:430px;text-shadow:0 2px 2px #14394b;font-size:13px}
#chaos-entry .ce-secondary{border:2px solid #fff1bd;background:#1a4d61;color:#fff8dc;border-radius:12px;padding:8px 17px;min-height:44px;font-weight:800;font-size:13px;box-shadow:0 3px 0 #102b3f}
#chaos-entry .ce-loading-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
a.ce-return{display:inline-flex!important;gap:8px;align-items:center;justify-content:center;border:2px solid currentColor;border-radius:12px;padding:9px 13px;margin:8px 8px 8px 0;min-height:44px;min-width:44px;text-decoration:none;color:inherit;font:800 13px Trebuchet MS,Arial,sans-serif;touch-action:manipulation}
@keyframes ce-load{from{transform:translateX(-30%)}to{transform:translateX(220%)}}
/* Upright phone setup; the race owns its later rotation guide. */
@media (orientation:portrait){
 #chaos-entry .ce-stage{width:100%;height:100%;background-size:100% auto;background-position:center 48%}
 #chaos-entry .ce-page{padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
 #chaos-entry .ce-brand{font-size:clamp(44px,13cqw,68px)}
 #chaos-entry .ce-page[data-page=welcome]{padding-top:8cqh;padding-bottom:10cqh}
 #chaos-entry .ce-page[data-page=menu]{justify-content:flex-start;overflow-y:auto;gap:20px}
 #chaos-entry .ce-menu-head{height:48px}
 #chaos-entry .ce-menu-head h2{font-size:28px}
 #chaos-entry .ce-mini-brand{display:none}
 #chaos-entry .ce-cards{flex-direction:column;width:100%;height:auto;gap:22px;padding-bottom:18px}
 /* Keep the square illustrations intact; captions get their own space instead
    of cropping heads or obscuring characters with an overlaid footer. */
 #chaos-entry .ce-card{width:min(440px,100%);aspect-ratio:auto;min-height:0}
 #chaos-entry .ce-card-art{position:relative;inset:auto;width:100%;aspect-ratio:1;background-size:contain;background-position:center}
 #chaos-entry .ce-card-label{position:relative;bottom:auto;left:auto;right:auto;min-height:82px;padding:14px;background:linear-gradient(#164862,#102c45);border-top:1px solid #fff4c044}
 #chaos-entry .ce-go{width:44px;height:44px}
 #chaos-entry .ce-card-title{font-size:28px}
}
@container (max-height:400px){
 #chaos-entry .ce-brand{font-size:clamp(32px,9cqh,42px)}
 #chaos-entry .ce-page[data-page=welcome]{padding-bottom:25px}
 #chaos-entry .ce-play{min-width:170px;min-height:46px;padding:6px 26px;font-size:24px;border-radius:15px}
 #chaos-entry .ce-kicker{font-size:8px;bottom:6px}
 #chaos-entry .ce-page[data-page=menu]{gap:8px;padding-left:20px;padding-right:20px;padding-top:8px;padding-bottom:12px}
 #chaos-entry .ce-menu-head{height:44px}
 #chaos-entry .ce-menu-head h2{font-size:25px}
 #chaos-entry .ce-mini-brand{font-size:14px}
 #chaos-entry .ce-cards{height:calc(100cqh - 82px);gap:16px}
 #chaos-entry .ce-card{width:min(calc((100% - 32px)/3),calc(100cqh - 96px));border-radius:17px}
 #chaos-entry .ce-card-label{padding:23px 10px 11px;min-height:68px}
 #chaos-entry .ce-card-title{font-size:clamp(19px,5.5cqh,24px)}
 #chaos-entry .ce-card-detail{font-size:10px;margin-top:5px}
 #chaos-entry .ce-go{width:29px;height:29px;font-size:23px;border-radius:9px}
 #chaos-entry .ce-loading{gap:7px;padding-bottom:14px}
 #chaos-entry .ce-loading h2{font-size:17px}
}
@media (prefers-reduced-motion:reduce){#chaos-entry *{animation:none!important;transition:none!important}}
#chaos-entry-fallback{position:fixed;inset:0;display:grid;place-content:center;text-align:center;gap:16px;font:800 24px 'Trebuchet MS',Arial,sans-serif;color:#fff8dc;background:#173d4d radial-gradient(ellipse at center,#286070,#173d4d 78%);z-index:9999;text-shadow:0 2px 3px #13354a}
#chaos-entry-fallback strong{font-weight:1000;font-size:54px;transform:rotate(-4deg);color:#ffe077;text-shadow:0 4px 0 #17364d}
#chaos-entry-fallback button{font:800 16px sans-serif;border:2px solid #fff4c0;border-radius:14px;background:#ffd657;color:#10233c;padding:13px 26px;cursor:pointer}html[data-chaos-entry] noscript{position:fixed;bottom:16px;left:16px;color:#fff5dc;z-index:11000}

/* Landscape full-art framing: contain the original illustration instead of cropping boss heads. */
@media (orientation:landscape){
 #chaos-entry .ce-stage{background-color:#173d4d;background-size:contain;background-position:center;background-image:radial-gradient(ellipse at center,#286070,#173d4d 78%);background-repeat:no-repeat}
 #chaos-entry-fallback{background-size:contain;background-repeat:no-repeat}
}

/* The approved title is one illustration. Keep it intact and align a real
   accessible button with the illustrated Play button. */
#chaos-entry .ce-page.ce-welcome-art-v2[data-page=welcome]{
 display:grid;grid-template:minmax(0,1fr) / minmax(0,1fr);place-items:center;justify-content:initial;gap:0;
 padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
 background:radial-gradient(ellipse at 50% 35%,#153957,#0a1a30 75%);
}
#chaos-entry .ce-title-board{
 position:relative;width:min(100%,calc((100cqh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) * 1.77683316));aspect-ratio:1672 / 941;
}
#chaos-entry .ce-title-art{display:block;width:100%;height:100%;object-fit:contain}
#chaos-entry .ce-title-play{
 position:absolute;left:50%;top:93%;transform:translate(-50%,-50%);
 width:18.5%;height:9.8%;min-width:44px;min-height:44px;
 border:0;padding:0;border-radius:11px;background:transparent;
}
#chaos-entry .ce-title-play:focus-visible{outline:3px solid white;outline-offset:0;box-shadow:0 0 0 5px #132c4b}
