:root{color-scheme:dark;--bg:#0a0e21;--glass:rgba(14,18,39,.86);--line:rgba(191,174,255,.17);--muted:#8d91b5;--text:#f3f0ff;--gold:#f6cf84;--purple:#a88bf5;--blue:#67cbff;--red:#ff746d;--green:#83df9a}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;width:100%;margin:0;overflow:hidden;background:var(--bg);font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:var(--text);touch-action:none}
button,input{font:inherit}
button{cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .16s ease,opacity .16s ease}
button:active{transform:scale(.98)}
button:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
canvas#arena{display:block;width:100vw;height:100dvh;touch-action:none;cursor:crosshair}
.vignette{pointer-events:none;position:fixed;inset:0;background:radial-gradient(ellipse at center,transparent 38%,rgba(4,5,18,.22) 100%)}
.hud{position:fixed;inset:0;pointer-events:none;z-index:3}
.hud button,.forge-panel button{pointer-events:auto}
.panel-glass{background:linear-gradient(145deg,rgba(19,25,50,.93),rgba(12,14,33,.86));border:1px solid var(--line);box-shadow:0 12px 35px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.035);backdrop-filter:blur(14px)}
.status{position:absolute;top:20px;left:22px;width:298px;padding:16px 17px 13px;border-radius:15px}
.status-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.wordmark{font-family:'Space Grotesk',system-ui,sans-serif;font-weight:700;letter-spacing:-.09em;font-size:45px;line-height:1}.wordmark span{color:var(--gold)}.wordmark i{font-style:normal;color:var(--purple);font-size:14px;vertical-align:top;margin-left:6px}.wordmark.sm{font-size:22px;letter-spacing:-.065em}
.mode-tag{background:rgba(155,134,231,.12);border:1px solid rgba(173,148,248,.22);color:#c9b8ff;padding:5px 8px;border-radius:6px;font-size:9px;letter-spacing:.13em;font-weight:800}
.health-line{display:flex;justify-content:space-between;font-size:10px;font-weight:800;letter-spacing:.1em;color:#bfc2d8;margin-bottom:7px}.health-line span:last-child{color:#f6efff;letter-spacing:0;font-size:11px}
.bar{height:8px;border-radius:8px;overflow:hidden;background:#272c43}.bar .fill{height:100%;width:100%;background:linear-gradient(90deg,#e85c79,#ff9b85);transition:width .17s ease;border-radius:inherit}
.status-values{display:grid;grid-template-columns:1.08fr 1fr 1fr;gap:8px;margin-top:15px}.status-values>div+div{border-left:1px solid var(--line);padding-left:11px}.status-values small,.death-results small{display:block;color:#8e93b1;font-size:9px;letter-spacing:.09em;font-weight:800;margin-bottom:3px}.status-values strong{font-family:'Space Grotesk',system-ui,sans-serif;font-size:18px;font-weight:700}
.leaderboard{position:absolute;top:20px;right:20px;width:229px;border-radius:14px;padding:16px}
.section-eyebrow{color:#cfb5ff;letter-spacing:.15em;font-size:10px;font-weight:800}
.leaderboard ol{list-style:none;margin:13px 0 0;padding:0}.leaderboard li{display:flex;align-items:center;gap:8px;padding:6px 1px;color:#c3c2d9;font-size:12px}.leaderboard li:first-child{color:var(--gold)}.leaderboard li.me{background:rgba(167,130,255,.12);margin:0 -7px;padding-left:8px;padding-right:8px;border-radius:6px;color:#e9dfff}.leaderboard .rank{width:17px;color:#767a9a;flex-shrink:0}.leaderboard .player-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.leaderboard .points{font-family:'Space Grotesk',system-ui,sans-serif;font-variant-numeric:tabular-nums;font-size:12px;font-weight:700;color:#e5e1f7}
.center-top{position:absolute;top:28px;left:50%;transform:translateX(-50%)}.center-message{color:#ffdc9b;background:#26213d;border:1px solid #8f6c64;border-radius:8px;padding:9px 16px;font-size:12px;font-weight:700}
.resource-hud{position:absolute;bottom:23px;left:22px;border-radius:14px;padding:13px 16px;width:367px}
.tiny-heading{display:flex;justify-content:space-between;color:#f3dcab;letter-spacing:.10em;font-size:10px;font-weight:800;margin-bottom:12px}.tiny-heading span{color:#656d95;font-size:9px}
.essences{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.essence{display:flex;align-items:center;gap:9px}.essence small{display:block;color:#888ca9;font-size:9px;font-weight:800;letter-spacing:.09em}.essence strong{font-family:'Space Grotesk',system-ui,sans-serif;font-size:23px;line-height:1.2;display:block;font-variant-numeric:tabular-nums}
.shape{display:inline-block;width:16px;height:16px;flex:0 0 auto}.triangle{background:var(--red);clip-path:polygon(50% 0,100% 100%,0 100%)}.square{background:var(--green);border-radius:2px;transform:rotate(-12deg)}.circle{background:var(--blue);border-radius:50%}.diamond{background:var(--purple);transform:rotate(45deg) scale(.78);border-radius:2px}
.orb-hud{position:absolute;bottom:23px;left:50%;transform:translateX(-50%);border-radius:15px;padding:10px 11px 10px 15px;display:flex;align-items:center;gap:13px;min-width:402px;max-width:90vw}
.orb-sigil{height:49px;width:49px;display:grid;place-items:center;font-size:31px;color:var(--purple);background:radial-gradient(circle at 40% 30%,#302450,#13172c 80%);border:1px solid #574b88;box-shadow:0 0 20px #a68bff1e;border-radius:50%;flex-shrink:0}
.orb-hud-info{min-width:0;flex:1}.orb-name{font-weight:800;font-size:13px;white-space:nowrap}.charge-caption{color:#9398b7;font-size:10px;margin:4px 0 7px;white-space:nowrap}.charge-bar{height:5px}.charge-bar .fill{background:linear-gradient(90deg,#826fe7,#c49bff)}
.forge-open{background:#e8c88b;color:#272034;border:1px solid #ffdf9d;padding:13px 11px;border-radius:9px;font-size:11px;font-weight:900;white-space:nowrap;letter-spacing:.03em}.forge-open:hover{background:#ffdb9b}.forge-open kbd{display:inline-block;background:#0002;border:1px solid #0002;border-radius:4px;padding:2px 4px;margin-left:7px;font-size:10px}
.bottom-right{position:absolute;right:20px;bottom:22px;display:flex;align-items:end;gap:16px}.controls-note{color:#8a8ead;white-space:nowrap;font-size:10px;letter-spacing:.01em;padding-bottom:5px}.controls-note b{color:#c8bee7;font-size:10px}.map-frame{padding:7px;border-radius:12px}.map-frame canvas{width:155px;height:124px;display:block;border-radius:6px}
.forge-backdrop{position:fixed;inset:0;background:rgba(4,5,14,.47);z-index:7;backdrop-filter:blur(2px)}
.forge-panel{position:fixed;top:0;right:0;bottom:0;width:min(474px,100vw);z-index:8;background:linear-gradient(155deg,#19172f 0%,#111529 52%,#101227 100%);border-left:1px solid #53446d;box-shadow:-20px 0 80px #0008;display:flex;flex-direction:column;padding:26px 26px 18px;overflow-y:auto;touch-action:pan-y}
.forge-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.forge-head h2{font-family:'Space Grotesk',system-ui,sans-serif;font-size:28px;letter-spacing:-.045em;margin:8px 0 6px}.forge-head p{font-size:12px;color:#a6a3bb;line-height:1.65;margin:0}.close-button{border:1px solid #484461;background:#23223d;color:#e6dff5;font-size:25px;width:36px;height:36px;border-radius:9px;line-height:1}.close-button:hover{background:#383052}
.forge-resource-line{display:flex;justify-content:space-around;padding:15px 5px;margin:19px 0 10px;background:#ffffff08;border:1px solid #ffffff13;border-radius:11px}.forge-resource-line>div{display:flex;gap:7px;align-items:center;font-family:'Space Grotesk',system-ui,sans-serif;font-size:17px;font-weight:700}.forge-resource-line .shape{width:12px;height:12px}
.forge-content{display:flex;flex-direction:column;gap:10px;padding-bottom:10px}
.forge-choice{border:1px solid #403d5c;border-radius:13px;background:linear-gradient(115deg,#242239bb,#1b1e36);padding:15px 15px 13px}.forge-choice.can-afford{border-color:#665880}.forge-choice-header{display:flex;align-items:center;gap:12px}.choice-orb{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-size:25px;flex-shrink:0;border:1px solid #ffffff4d;background:radial-gradient(circle at 30% 24%,#ffffff5e,transparent 34%),radial-gradient(circle,#8a69a3aa,#201930)}
.choice-detail{min-width:0;flex:1}.choice-detail h3{font-size:15px;margin:0 0 4px;font-family:'Space Grotesk',system-ui,sans-serif;font-weight:700}.choice-detail p{color:#9998b4;font-size:11px;margin:0}.badge-owned{border-radius:7px;background:#b9ffa512;color:#bde9a8;font-size:9px;letter-spacing:.07em;padding:5px 7px}
.costs{display:flex;gap:11px;flex-wrap:wrap;margin:12px 0}.cost-pill{display:inline-flex;gap:5px;align-items:center;color:#dcd8e7;font-size:12px;font-weight:800}.cost-pill.lacking{color:#ff8589}.cost-pill .shape{width:10px;height:10px}
.choice-bottom{display:flex;align-items:center;gap:8px;justify-content:space-between}.choice-bottom .mini-stats{display:flex;flex-wrap:wrap;gap:9px;color:#aaa7c2;font-size:10px}.choice-bottom .mini-stats b{color:#e2daf8}
.choice-button{border:1px solid #cab5f9;border-radius:8px;background:#a88cf3;color:#16132a;font-weight:900;font-size:11px;letter-spacing:.05em;padding:10px 12px}.choice-button:hover:not(:disabled){background:#c3aeff}.choice-button:disabled{cursor:not-allowed;background:#39354c;color:#898397;border-color:#47425c}
.forge-section-title{color:#e4dbe9;font-size:10px;font-weight:800;letter-spacing:.13em;margin:15px 0 2px}.upgrade-card{display:flex;align-items:center;gap:11px;padding:15px 13px;border:1px solid #46405a;border-radius:11px;background:#ffffff06}.upgrade-card .element-icon{width:36px;height:36px;display:grid;place-items:center;background:#ffffff09;border-radius:8px;flex-shrink:0}.upgrade-card .element-icon .shape{width:19px;height:19px}.upgrade-copy{flex:1;min-width:0}.upgrade-copy strong{display:block;font-size:13px}.upgrade-copy span{font-size:11px;color:#9e9dbb}.upgrade-copy small{font-size:10px;color:#d3b9f4;display:block;margin-top:5px}.upgrade-card button{min-width:82px}.level-pips{display:flex;gap:3px;margin-top:5px}.level-pips i{display:block;width:15px;height:3px;background:#3b3955;border-radius:5px}.level-pips i.on{background:#b38af2}
.forge-footnote{color:#777c9d;font-size:10px;line-height:1.6;margin-top:auto;padding-top:12px;border-top:1px solid #ffffff14}.forge-footnote span{display:block}.forge-footnote kbd{font-weight:900;color:#c2bbeb}
.screen{position:fixed;inset:0;z-index:9;display:flex;align-items:center;justify-content:center;overflow:auto;background:radial-gradient(ellipse at 50% 38%,#252046,#101328 56%,#090d1f);text-align:center;touch-action:pan-y}
.start-screen:before{content:'';pointer-events:none;position:absolute;inset:0;opacity:.25;background-image:radial-gradient(#bba8ff 1px,transparent 1px);background-size:43px 43px;mask-image:radial-gradient(ellipse at 50% 50%,black,transparent 74%)}
.ambient-orb{position:absolute;pointer-events:none;filter:blur(55px);opacity:.25;border-radius:50%}.orb-one{width:480px;height:480px;background:#5d3fc8;top:-220px;left:-170px}.orb-two{width:410px;height:410px;background:#1b78ad;bottom:-270px;right:-100px}
.hero-wrap{position:relative;width:min(640px,calc(100vw - 36px));margin:0 auto;z-index:2;padding:18px 0 52px}
.hero-mark{margin:0 auto 11px;position:relative;width:110px;height:110px;display:grid;place-items:center}.hero-rune{position:absolute;inset:10px;border:1px solid #a993da82;border-radius:50%;transform:rotate(-17deg)}.hero-rune.r1:after,.hero-rune.r2:before{content:'✧';position:absolute;left:-5px;top:38px;color:var(--gold);font-size:17px}.hero-rune.r2{inset:0;transform:rotate(37deg);border-color:#c99cf04f;border-style:dashed}.hero-core{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#f8df9b;font-size:37px;background:radial-gradient(circle at 33% 25%,#e5d2fc,#9063c8 22%,#4b2d79 53%,#171430 78%);box-shadow:0 0 43px #a677d888,0 0 90px #9975cb33}
.eyebrow-hero{font-size:10px;letter-spacing:.26em;color:#bca7e9;font-weight:800}.hero-title{font-family:'Space Grotesk',system-ui,sans-serif;font-size:clamp(80px,13vw,125px);line-height:1;letter-spacing:-.10em;margin:8px 0 5px;text-shadow:0 3px 30px #c7a3fc27}.hero-title span{color:var(--gold)}
.hero-tagline{letter-spacing:.23em;font-weight:900;font-size:12px;color:#e2d7f8}.hero-tagline span{color:var(--gold);margin:0 8px;font-size:10px}
.hero-description{max-width:480px;margin:18px auto 25px;font-size:13px;color:#a5a4c2;line-height:1.85}
.menu-controls{max-width:338px;display:grid;gap:9px;margin:0 auto}.menu-controls label{text-align:left;color:#aea7cf;font-weight:800;letter-spacing:.14em;font-size:10px}.menu-controls input{width:100%;background:#11152a;color:#f9f5ff;padding:13px 14px;font-family:'Space Grotesk',system-ui,sans-serif;font-size:15px;text-align:center;border:1px solid #5a4b85;border-radius:9px;outline:none}.menu-controls input:focus{border-color:#cbb1ff}
.primary-button,.secondary-button{width:100%;text-align:center;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:9px;padding:13px 17px;font-weight:900;font-size:12px;letter-spacing:.06em}.primary-button{background:linear-gradient(115deg,#f5da9f,#e4b36b);border:1px solid #fff0be;color:#262034;box-shadow:0 4px 20px #e9bb6d24}.primary-button:hover{background:#ffe5b0;transform:translateY(-1px)}.primary-button span{margin-left:auto;font-size:17px}
.secondary-button{background:#ffffff08;color:#d5c4ee;border:1px solid #625480}.secondary-button:hover:not(:disabled){background:#ffffff17}.secondary-button:disabled{opacity:.45;cursor:not-allowed}.secondary-button span{font-size:9px;letter-spacing:.06em;margin-left:auto;color:#ada7ca}
.menu-error{font-size:11px;color:#ff999a;min-height:12px}
.element-guide{margin:22px auto 0;padding:15px 9px;max-width:490px;border-top:1px solid #9483ae3c;border-bottom:1px solid #9483ae3c;display:flex;justify-content:space-around;gap:10px}.element-guide>div{display:flex;align-items:center;flex-direction:column;gap:4px;min-width:74px}.element-guide .shape{width:17px;height:17px;margin:3px 0 5px}.element-guide b{font-size:10px;letter-spacing:.12em}.element-guide small{font-size:10px;color:#8c91b6}
.menu-tip{color:#8a88a4;font-size:9px;letter-spacing:.05em;margin-top:18px}.menu-tip strong{color:#cfbbea;font-size:10px}
.death-screen{z-index:11;background:#090c1bd9;backdrop-filter:blur(13px)}.death-card{background:linear-gradient(135deg,#1e1a32,#10152a);border:1px solid #75617b;border-radius:22px;padding:35px 45px 28px;width:min(430px,calc(100vw - 30px));box-shadow:0 30px 90px #0009}.death-symbol{font-size:80px;color:#bb9bdf;line-height:1.2;margin:8px 0}.death-card h2{font-family:'Space Grotesk',system-ui,sans-serif;font-size:39px;letter-spacing:-.06em;line-height:1.04;margin:0}.death-card h2 em{font-style:normal;color:#fc9a98}.death-card>p{color:#aaa0b5;font-size:12px;margin:13px 0 22px}.death-results{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:19px 0;border-top:1px solid #ffffff21;border-bottom:1px solid #ffffff21;margin-bottom:20px}.death-results strong{font-family:'Space Grotesk',system-ui,sans-serif;font-size:24px}.death-card .text-button{display:block;margin:14px auto 0;border:0;background:none;color:#a7a0b6;font-size:11px;text-decoration:underline;text-underline-offset:4px}
#toastArea{position:fixed;z-index:12;left:50%;top:11%;transform:translateX(-50%);display:flex;flex-direction:column;gap:7px;pointer-events:none;width:max-content;max-width:90vw}.toast{font-size:12px;font-weight:800;letter-spacing:.02em;text-align:center;border:1px solid #695d8d;background:#27213dda;color:#eee3ff;border-radius:9px;padding:10px 15px;box-shadow:0 4px 24px #0007;animation:toast-enter .23s ease forwards}.toast.good{color:#f5dfad;border-color:#8d7351}.toast.bad{color:#ffafaf;border-color:#98505f}@keyframes toast-enter{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
.mobile-controls{display:none}
@media(max-width:1340px){.controls-note{display:none}.resource-hud{width:340px}.orb-hud{min-width:350px}.bottom-right{bottom:22px}.status{width:278px}}
@media(max-width:950px){.leaderboard{width:183px}.resource-hud{bottom:17px;width:315px}.orb-hud{bottom:120px;left:22px;transform:none;min-width:305px;width:305px}.map-frame{display:none}.status{top:12px;left:12px}.leaderboard{top:12px;right:12px}.bottom-right{display:none}}
@media(max-width:650px){.status{top:8px;left:8px;width:225px;padding:10px}.status-top{margin-bottom:9px}.wordmark.sm{font-size:22px}.mode-tag{font-size:8px;padding:4px}.health-line{font-size:9px}.status-values{margin-top:10px}.status-values strong{font-size:15px}.status-values small{font-size:8px}.leaderboard{display:none}.resource-hud{left:8px;bottom:10px;width:min(292px,calc(100vw - 94px));padding:9px 10px}.tiny-heading{font-size:8px;margin-bottom:8px}.tiny-heading span{font-size:7px}.essences{gap:5px}.essence{gap:5px}.essence strong{font-size:18px}.essence small{font-size:7px}.essence .shape{width:11px;height:11px}.orb-hud{top:9px;bottom:auto;left:auto;right:8px;min-width:0;width:128px;padding:8px;gap:5px;flex-wrap:wrap;justify-content:center}.orb-sigil{width:28px;height:28px;font-size:21px}.orb-hud-info{flex:1}.orb-name{font-size:9px;white-space:normal}.charge-caption{font-size:8px;overflow:hidden;text-overflow:ellipsis;max-width:75px}.forge-open{width:100%;padding:7px 5px;font-size:9px}.forge-open kbd{display:none}.mobile-controls{display:block}.joystick{position:absolute;bottom:98px;left:28px;width:101px;height:101px;background:#ffffff10;border:2px solid #d9c9ff60;border-radius:50%;pointer-events:auto;touch-action:none}.joystick-knob{position:absolute;left:31px;top:31px;height:35px;width:35px;border:2px solid #d9c9ffd1;background:#947ac86b;border-radius:50%;pointer-events:none;box-shadow:0 0 18px #987acb5b}.mobile-fire{position:absolute;bottom:116px;right:23px;width:76px;height:76px;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fac48e,#df795a);border:2px solid #ffe4b1;box-shadow:0 0 24px #fd8c605e;color:#3a2040;font-size:13px;font-weight:900;touch-action:none}.mobile-fire span{font-size:22px}.forge-panel{padding:20px 17px 16px}.forge-head h2{font-size:23px}.hero-wrap{padding:45px 0 32px}.hero-mark{width:86px;height:86px}.hero-core{width:51px;height:51px}.eyebrow-hero{font-size:9px;letter-spacing:.14em}.hero-description{margin:14px auto 22px;max-width:350px;font-size:12px}.hero-title{font-size:83px}.element-guide{margin-top:16px}.menu-tip{font-size:8px}.start-screen{align-items:flex-start}.death-card{padding:25px 20px}.death-card h2{font-size:34px}}
@media(max-height:760px){.hero-mark{width:72px;height:72px;margin-bottom:1px}.hero-core{width:50px;height:50px}.hero-title{font-size:75px}.hero-description{margin:8px auto 13px;line-height:1.55}.element-guide{margin-top:11px;padding:9px}.menu-tip{margin-top:11px}.hero-wrap{padding-top:14px}}
/* Keep the mobile hero and its version footer in a single centered column. */
@media(max-width:650px){
  .start-screen{flex-direction:column;justify-content:flex-start;align-items:center;overflow-y:auto}
  .hero-wrap{flex:0 0 auto;width:calc(100% - 32px);margin:0 auto}
  
}
/* v9.8 mobile HUD cleanup and high-DPI canvas fix follow-up */
@media(max-width:650px){
  .status{top:8px;left:8px;width:min(170px,calc(50vw - 12px));padding:9px 10px;border-radius:12px}
  .status-top{margin-bottom:8px;gap:6px;align-items:flex-start}
  .wordmark.sm{font-size:16px;letter-spacing:-.065em}
  .wordmark i{display:none}
  .mode-tag{font-size:7px;padding:3px 4px;letter-spacing:.09em}
  .arena-share{padding:3px 5px;font-size:8px;margin-left:2px}
  .health-line{font-size:8px;margin-bottom:5px}
  .health-line span:last-child{font-size:10px}
  .bar{height:7px}
  .ward-line{margin-top:6px}
  .status-values{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 8px;margin-top:9px}
  .status-values>div+div{border-left:0;padding-left:0}
  .status-values small{font-size:7px;margin-bottom:2px}
  .status-values strong{font-size:14px}

  .orb-hud{top:8px;right:8px;left:auto;bottom:auto;transform:none;width:min(164px,calc(50vw - 12px));padding:8px;border-radius:12px;gap:6px;align-items:stretch;justify-content:flex-start}
  .orb-sigil{width:24px;height:24px;font-size:18px}
  .orb-hud-info{width:100%}
  .orb-name{font-size:9px;line-height:1.2}
  .charge-caption{display:none}
  .charge-bar{height:4px;margin-top:4px}
  .forge-open,.shop-game-button{width:100%;min-width:0;padding:7px 6px;font-size:9px;min-height:30px}
  .forge-open kbd{display:none}

  .arena-label{top:102px;max-width:calc(100vw - 16px);padding:4px 7px;font-size:7px;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .network-status{top:126px;max-width:calc(100vw - 16px);padding:3px 7px;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .touch-device .arena-label,.touch-device .network-status{left:50%;right:auto;transform:translateX(-50%);max-width:calc(100vw - 16px)}

  .resource-hud{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;padding:8px 10px 9px;border-radius:12px}
  .tiny-heading{margin-bottom:6px;font-size:8px}
  .tiny-heading span{font-size:7px}
  .essences{gap:4px}
  .essence{gap:4px}
  .essence strong{font-size:15px}
  .essence small{font-size:7px}
  .essence .shape{width:10px;height:10px}

  .joystick{left:14px;bottom:106px;width:88px;height:88px}
  .joystick-knob{left:27px;top:27px;width:30px;height:30px}
  .mobile-fire{right:14px;bottom:113px;width:68px;height:68px;font-size:12px}
  .mobile-fire span{font-size:18px}

  .center-top{top:154px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 20px)}
  .center-message{font-size:10px;padding:7px 10px}
}

@media(max-width:430px){
  .status{width:min(158px,calc(50vw - 10px));padding:8px 9px}
  .orb-hud{width:min(156px,calc(50vw - 10px))}
  .resource-hud{padding:7px 9px 8px}
  .tiny-heading span{display:none}
  .joystick{bottom:96px;width:84px;height:84px}
  .joystick-knob{left:25px;top:25px;width:30px;height:30px}
  .mobile-fire{bottom:103px;width:64px;height:64px}
}

@media(max-width:650px) and (max-height:760px){
  .arena-label{top:96px}
  .network-status{top:118px}
  .resource-hud{padding:7px 9px 8px}
  .essence strong{font-size:14px}
  .joystick{bottom:92px;width:82px;height:82px}
  .joystick-knob{left:24px;top:24px;width:30px;height:30px}
  .mobile-fire{bottom:98px;width:62px;height:62px}
}
/* v2: Alchemical allocation forge */
.alchemy-capacity{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:10px;border:1px solid #635375;background:#ffffff09;border-radius:12px;padding:13px}
.alchemy-capacity>div:first-child{display:flex;flex-direction:column;gap:5px}
.alchemy-capacity strong{font-size:11px;letter-spacing:.08em;color:#f6d49d}
.alchemy-capacity span{font-size:11px;color:#b9b1ce}
.attune-cost{flex:0 0 100%;display:flex;flex-wrap:wrap;gap:9px;align-items:center;font-size:11px;color:#a9a3c3}
.alchemy-row{display:flex;align-items:center;gap:10px;background:#ffffff08;border:1px solid #49415e;border-radius:10px;padding:9px 10px}
.alchemy-icon{width:29px;height:29px;border-radius:7px;background:#ffffff0d;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.alchemy-icon .shape{width:16px;height:16px}
.alchemy-info{flex:1;min-width:0}
.alchemy-info strong{font-size:12px;display:block}
.alchemy-info strong small{color:#9f9fb9;font-size:10px;font-weight:400}
.alchemy-info>span{font-size:10px;color:#bcb0d6}
.alchemy-stepper{display:flex;align-items:center;gap:6px}
.alchemy-stepper button{width:28px;height:30px;font-weight:800;font-size:17px;border-radius:6px;background:#66529b;color:#fff;border:1px solid #8d79b4}
.alchemy-stepper button:disabled{opacity:.28;cursor:not-allowed}
.alchemy-stepper b{font-size:15px;min-width:21px;text-align:center;font-variant-numeric:tabular-nums;color:#f0d9ff}
.property-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.property{padding:10px;border:1px solid #635475;background:#171b36;border-radius:9px}
.property>div:first-child{display:flex;justify-content:space-between;gap:5px;align-items:center}
.property strong{font-size:9px;color:#d3bfdc}
.property span{font-size:10px;font-weight:800;font-variant-numeric:tabular-nums;color:#aee7c7;white-space:nowrap}
.property-track{background:#33314d;height:6px;border-radius:10px;margin-top:10px;overflow:hidden}
.property-track i{height:100%;display:block;background:linear-gradient(90deg,#7b8ce9,#a8f1d2);border-radius:inherit}
.property.invalid{border-color:#cb696c}.property.invalid span{color:#ff878c}.property.invalid .property-track i{background:#d96171}
.formula-stats{padding:12px;background:#ffffff08;border:1px solid #534c64;border-radius:10px}
.formula-stats>strong{display:block;font-size:10px;color:#f0d29f;letter-spacing:.08em;margin-bottom:10px}
.formula-stats>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.formula-stats span{font-size:10px;color:#d3cce4}
.alchemy-check{padding:10px;background:#17372d;color:#b7edce;border-radius:8px;font-size:11px;font-weight:700}
.alchemy-check.invalid{background:#422534;color:#ffb8bc}
.formula-actions{padding:12px;background:#ffffff08;border-radius:11px;display:flex;flex-direction:column;gap:12px}
.formula-actions .costs{margin:0;display:flex;justify-content:space-between;gap:7px}
.formula-actions>button{width:100%}
@media(max-width:370px){.property-grid{grid-template-columns:1fr}.alchemy-row{gap:6px}.alchemy-info strong small{display:block}}

.ward-line{margin-top:7px}.ward-line .health-line{color:#90e0bc;margin-bottom:4px;font-size:9px}.ward-bar{height:5px}.ward-bar .fill{background:linear-gradient(90deg,#44ac9a,#aeffda)}

/* v6 — compact level stat and medal-aware leaderboard */
.status-values{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.status-values>div+div{padding-left:7px}
.status-values strong{font-size:16px}
.leaderboard{width:263px}
.leaderboard li{gap:6px}
.leaderboard .rank{width:24px;min-width:24px;text-align:center;font-weight:800;color:#c1b4ff}
.leaderboard .medal-rank{font-size:17px;line-height:1.1}
.leaderboard .leader-level{font-size:10px;color:#c6afff;white-space:nowrap;background:#a88bf518;padding:3px 4px;border:1px solid #a88bf52b;border-radius:5px}
.leaderboard .points{font-size:11px}
@media(max-width:950px){.leaderboard{width:219px}}
@media(max-width:650px){.status-values{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}.status-values strong{font-size:13px}.status-values small{font-size:7px;letter-spacing:0}.status-values>div+div{padding-left:5px}}

@media(min-width:651px){.status-values small{font-size:8px;letter-spacing:.035em}}

/* v7 multiplayer room menu */
.party-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.party-buttons .secondary-button{font-size:10px;padding:11px 4px;min-height:41px}
#partyCodeInput{text-align:center;letter-spacing:.14em;text-transform:uppercase;margin-top:0!important}
.server-status{text-align:center;color:#a7eacb;font-size:11px;letter-spacing:.04em;margin:1px 0 4px}
.arena-share{border:1px solid #9b86e370;background:#7e65bb28;border-radius:6px;padding:4px 6px;font-weight:800;font-size:9px;color:#eddbff;cursor:pointer;margin-left:6px}
.arena-label{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:6;background:#171c33c9;border:1px solid #746aab88;border-radius:12px;padding:6px 12px;font-size:10px;letter-spacing:.06em;color:#d6e4fa;pointer-events:none;white-space:nowrap}
@media(max-width:650px){.arena-label{top:160px;font-size:8px;padding:5px 7px}.party-buttons .secondary-button{font-size:9px}}

/* Subtle live network readout, useful on low-cost servers and high-latency links. */
.network-status{position:absolute;top:39px;left:50%;transform:translateX(-50%);z-index:6;background:#171c33ac;border:1px solid #746aab55;border-radius:8px;padding:4px 9px;font:10px system-ui,sans-serif;color:#c0d5e9;pointer-events:none;white-space:nowrap}
@media(max-width:650px){.network-status{top:185px;font-size:9px}}


/* v7.2 branding */
.rexteq-brand{position:fixed;left:16px;bottom:14px;z-index:11;display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:12px;border:1px solid #7f76aa8c;background:rgba(14,18,38,.82);box-shadow:0 12px 28px rgba(0,0,0,.26);color:#eef2ff;text-decoration:none;backdrop-filter:blur(6px);max-width:min(420px,calc(100vw - 28px))}
.rexteq-brand:hover{background:rgba(20,26,53,.92);border-color:#9f95d6b0}
.rexteq-brand img{width:40px;height:40px;object-fit:contain;flex:0 0 auto;border-radius:10px;background:#ffffff0c;padding:2px}
.rexteq-brand .brand-text{display:flex;flex-direction:column;min-width:0}
.rexteq-brand .brand-text strong{font-size:12px;line-height:1.2;letter-spacing:.02em;color:#fff7fd}
.rexteq-brand .brand-text span{font-size:10px;line-height:1.35;color:#cfd9ef;white-space:normal}
@media(max-width:650px){.rexteq-brand{left:8px;right:8px;bottom:8px;padding:7px 9px;gap:8px}.rexteq-brand img{width:32px;height:32px}.rexteq-brand .brand-text strong{font-size:11px}.rexteq-brand .brand-text span{font-size:9px}}

/* v7.3 — visible placement even when the player is outside the top nine. */
.personal-rank{border-top:1px solid #ffffff21;margin-top:9px;padding-top:9px;color:#cabeea;font:700 10px 'DM Sans',system-ui,sans-serif;letter-spacing:.055em;text-align:center}


/* v7.4: cross-promotion. Inline on phones/smaller desktops; discreet side card on widescreens. */
.doom-promo{
  display:flex; align-items:center; gap:13px; width:min(460px,100%);
  margin:18px auto 0; padding:10px; text-align:left;
  border:1px solid rgba(255,138,87,.45); border-radius:15px;
  background:linear-gradient(145deg,rgba(60,28,38,.97),rgba(20,19,36,.98));
  color:#fff1e5; text-decoration:none; box-shadow:0 12px 26px #0006;
  transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.doom-promo:hover{border-color:#ffb56b;box-shadow:0 16px 32px #0008;transform:translateY(-2px)}
.doom-promo:focus-visible{outline:2px solid #ffd08c;outline-offset:3px}
.doom-promo-art{display:block;width:88px;height:122px;object-fit:cover;object-position:top center;flex:0 0 auto;border-radius:9px;border:1px solid #fd7a5859;background:#140d15}
.doom-promo-copy{display:flex;flex-direction:column;gap:10px;min-width:0}
.doom-promo-eyebrow{color:#ffb679;font-size:9px;font-weight:900;letter-spacing:.1em}
.doom-promo-title{font-size:14px;line-height:1.36;font-weight:600;letter-spacing:-.01em}
.doom-promo-title strong{font-family:'Space Grotesk',system-ui,sans-serif;color:#fff;font-size:17px;display:block}
.doom-promo-link{font-size:10px;font-weight:900;letter-spacing:.08em;color:#ffe4aa}
.doom-promo-link span{font-size:16px;margin-left:4px}
@media(min-width:1200px){
  .doom-promo{position:fixed;z-index:3;right:18px;top:50%;transform:translateY(-50%);width:216px;flex-direction:column;gap:10px;margin:0;padding:11px;text-align:center}
  .doom-promo:hover{transform:translateY(calc(-50% - 2px))}
  .doom-promo-art{width:100%;height:244px;object-position:center 14%}
  .doom-promo-copy{gap:9px;align-items:center}
  .doom-promo-title{font-size:12px}
  .doom-promo-title strong{font-size:16px}
}
@media(max-width:1199px){.start-screen{align-items:flex-start}.hero-wrap{padding-top:20px;padding-bottom:44px}}
@media(max-width:650px){
  .doom-promo{width:min(440px,100%);margin-top:20px;padding:9px;gap:11px}
  .doom-promo-art{width:82px;height:114px}
  .doom-promo-title{font-size:12px}
  .doom-promo-title strong{font-size:15px}
  .doom-promo-eyebrow{font-size:8px}
  .doom-promo-link{font-size:9px}
}
/* Keep the header accessible instead of vertically clipping long menus on laptop displays. */
.start-screen{align-items:flex-start}

/* v8 cosmetics and earned Star Gems. No cosmetic alters damage or movement. */
.shop-menu-button{display:flex;align-items:center;justify-content:center;gap:8px;margin:12px auto 2px;padding:11px 16px;min-width:245px;max-width:100%;background:#242040;color:#fbe29e;border:1px solid #aa874d;border-radius:10px;font-size:12px;font-weight:900;letter-spacing:.075em}
.shop-menu-button span{font-size:10px;font-weight:600;color:#d7c7ef;letter-spacing:normal}
.shop-game-button{padding:8px 10px;min-width:67px;background:#42335f;color:#f3d7a3;border:1px solid #8f76c3;border-radius:7px;font-weight:800;font-size:10px;white-space:nowrap}
.shop-game-button:hover,.shop-menu-button:hover{background:#5c477c}
.shop-backdrop{position:fixed;inset:0;background:#080c1ce8;z-index:30;backdrop-filter:blur(9px)}
.shop-panel{position:fixed;z-index:31;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(790px,calc(100vw - 26px));max-height:min(94vh,1000px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;border:1px solid #716595;border-radius:18px;background:linear-gradient(150deg,#25203e,#11182e);box-shadow:0 30px 100px #000b;padding:24px}
.shop-heading{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}
.shop-heading h2{font:800 30px 'Space Grotesk',system-ui,sans-serif;margin:5px 0 5px;letter-spacing:-.03em}
.shop-heading p{margin:0;font-size:12px;color:#bcb3d9}
.shop-summary{margin:15px 0 5px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#e0bc7730;border:1px solid #e8bb6870;border-radius:9px;padding:11px;font-size:13px;font-weight:800;color:#ffe19f}
.shop-summary span:last-child{color:#e9dcfa}
.shop-save-note{font-size:11px;color:#b6accd;margin:7px 0 16px;line-height:1.5}
.skin-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.skin-card{border:1px solid #5c5479;background:#14172e;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px;min-width:0}
.skin-card.selected{border-color:#f7d27b;background:#353147}
.skin-preview{height:95px;position:relative;border-radius:9px;background:radial-gradient(ellipse at center,#76618c2e,#101225);display:grid;place-items:center;overflow:hidden}
.skin-hat{position:absolute;width:73px;height:74px;top:8px;background:linear-gradient(115deg,var(--skin-top),var(--skin-base) 61%,var(--skin-edge));clip-path:polygon(50% 0,84% 72%,100% 86%,100% 97%,0 97%,0 86%,17% 72%);filter:drop-shadow(0 2px 5px #0008)}
.skin-hat:after{content:'';position:absolute;top:66%;left:11%;width:78%;height:7px;background:var(--skin-band);border-radius:4px}
.skin-emblem{position:absolute;top:62px;left:50%;transform:translateX(-50%);font-size:19px;color:var(--skin-band);text-shadow:0 0 7px #0c0d25}
.skin-name{font-size:13px;font-weight:900;line-height:1.2;color:#fff4eb}
.skin-info{font-size:11px;line-height:1.35;color:#b8b6d1;min-height:43px}
.skin-kind{font-size:9px;font-weight:900;letter-spacing:.07em;color:#f8d29a}
.skin-action{width:100%;margin-top:auto;padding:9px 5px;border:1px solid #a686d6;background:#694b9c;color:white;border-radius:6px;font-size:10px;font-weight:900;min-height:35px}
.skin-action:disabled{background:#35334f;border-color:#534967;color:#a9a4c1;cursor:default}
.skin-card.selected .skin-action:disabled{background:#455c53;border-color:#69937f;color:#aff4c6}
.shop-footnote{font-size:11px;color:#bcb0d0;line-height:1.55;margin:16px 0 2px}
.menu-ad-section{max-width:480px;min-height:125px;margin:165px auto 34px;padding:15px;border:1px solid #ffffff25;background:#080d1db8;border-radius:12px;text-align:center}
.ad-label{color:#a6aab9;font-size:10px;font-weight:800;letter-spacing:.15em;margin-bottom:12px}
#adsenseSlot{min-height:90px;width:100%;overflow:visible}
@media(max-width:720px){.skin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.shop-panel{padding:17px 13px}.shop-heading h2{font-size:24px}.shop-heading p{font-size:11px}.skin-card{padding:10px}.skin-preview{height:86px}.shop-game-button{min-width:0;padding:7px 5px;font-size:9px}.orb-hud{gap:4px}}
@media(max-width:650px){.menu-ad-section{margin-top:170px;margin-bottom:25px}.shop-panel{max-height:calc(100dvh - 24px)}}
.legal-links{text-align:center;font-size:11px;color:#b0aacb;margin-top:16px}
.legal-links a{color:#d4bdfb;text-underline-offset:3px}

/* v9: checkout and distinctive cosmetic preview shapes */
.gem-terms-panel{z-index:130;max-width:660px;max-height:90vh;overflow:auto}
.purchase-agreement{max-height:33vh;overflow:auto;background:#0e1426;border:1px solid #66729a;border-radius:10px;padding:15px;line-height:1.5;color:#e7e9ff;font-size:13px}
.purchase-agreement p{margin:9px 0}.purchase-agreement h3{margin:0 0 10px}.gem-consent{display:flex;gap:12px;align-items:flex-start;padding:12px 0;color:#fff;font-size:13px}.gem-consent input{width:20px;height:20px;flex-shrink:0}
.gem-pack-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.gem-pack{display:flex;flex-direction:column;align-items:center;gap:5px;border:1px solid #9b85dc;border-radius:10px;background:#2b2450;color:white;padding:13px 5px;cursor:pointer}.gem-pack:disabled{opacity:.4;cursor:not-allowed}
.skin-preview.shape-crown .skin-hat{clip-path:polygon(0 18%,25% 47%,50% 0,75% 47%,100% 18%,90% 100%,10% 100%);border-radius:0}
.skin-preview.shape-afro .skin-hat{border-radius:50% 50% 44% 44%;width:75px;height:70px;transform:translateY(6px)}
.skin-preview.shape-viking .skin-hat{border-radius:60% 60% 10% 10%;width:68px;height:42px;transform:translateY(16px)}
.skin-preview.shape-viking:before,.skin-preview.shape-viking:after{content:' ';position:absolute;width:19px;height:38px;background:#e7d9b5;clip-path:polygon(50% 0,100% 100%,0 90%);top:11px;z-index:1}.skin-preview.shape-viking:before{left:12px;transform:rotate(-34deg)}.skin-preview.shape-viking:after{right:12px;transform:rotate(34deg)}
.skin-preview.shape-unicorn .skin-hat{border-radius:50% 50% 18% 18%;height:57px;width:65px}.skin-preview.shape-unicorn:before{content:' ';position:absolute;top:2px;left:calc(50% - 8px);width:16px;height:40px;background:repeating-linear-gradient(30deg,#ffe7ff,#ffe7ff 5px,#bc78e5 6px,#bc78e5 9px);clip-path:polygon(50% 0,100% 100%,0 100%);z-index:1}
.skin-preview.shape-spikes .skin-hat{clip-path:polygon(0 100%,0 30%,16% 58%,22% 0,37% 50%,50% 0,63% 50%,80% 0,85% 60%,100% 20%,100% 100%);border-radius:0}
.skin-preview.shape-patchwizard .skin-hat{transform:rotate(16deg);border-radius:55% 12% 20% 20%}
.skin-preview.shape-starwizard .skin-hat{transform:rotate(-13deg)}.skin-preview.shape-tallwizard .skin-hat{height:83px;transform:translateY(-8px)}
@media(max-width:550px){.gem-pack-grid{grid-template-columns:1fr}.gem-terms-panel{max-height:92vh}.purchase-agreement{max-height:32vh}}


/* v9.1 additional cosmetic preview silhouettes */
.skin-preview.shape-crown .skin-hat{clip-path:polygon(0 18%,25% 47%,50% 0,75% 47%,100% 18%,90% 100%,10% 100%);border-radius:0}
.skin-preview.shape-afro .skin-hat{border-radius:50%;width:74px;height:68px;transform:translateY(8px)}
.skin-preview.shape-afro:before{content:'';position:absolute;right:20px;top:46px;width:7px;height:19px;background:#f6c47f;box-shadow:-2px -5px 0 0 #f6c47f,-4px -5px 0 0 #f6c47f,-6px -5px 0 0 #f6c47f,-8px -5px 0 0 #f6c47f;transform:rotate(38deg)}
.skin-preview.shape-viking .skin-hat{border-radius:58% 58% 10% 10%;width:68px;height:42px;transform:translateY(16px)}
.skin-preview.shape-viking:before,.skin-preview.shape-viking:after{content:' ';position:absolute;width:19px;height:38px;background:#e7d9b5;clip-path:polygon(55% 0,100% 100%,0 90%);top:11px;z-index:1}.skin-preview.shape-viking:before{left:12px;transform:rotate(-34deg)}.skin-preview.shape-viking:after{right:12px;transform:rotate(34deg)}
.skin-preview.shape-unicorn .skin-hat{border-radius:56% 44% 28% 18%;height:57px;width:68px;transform:translateY(4px) translateX(2px)}.skin-preview.shape-unicorn:before{content:' ';position:absolute;top:1px;left:calc(50% - 2px);width:16px;height:40px;background:repeating-linear-gradient(30deg,#ffe7ff,#ffe7ff 5px,#bc78e5 6px,#bc78e5 9px);clip-path:polygon(50% 0,100% 100%,0 100%);z-index:1}.skin-preview.shape-unicorn:after{content:'';position:absolute;left:58%;top:43px;width:7px;height:7px;border-radius:50%;background:#221536;box-shadow:-25px -4px 0 15px rgba(255,145,204,.0)}
.skin-preview.shape-spikes .skin-hat{clip-path:polygon(0 100%,0 30%,16% 58%,22% 0,37% 50%,50% 0,63% 50%,80% 0,85% 60%,100% 20%,100% 100%);border-radius:0}
.skin-preview.shape-patchwizard .skin-hat{transform:rotate(16deg);border-radius:55% 12% 20% 20%}
.skin-preview.shape-patchwizard:before,.skin-preview.shape-patchwizard:after{content:'';position:absolute;border-radius:50%;background:#24190f;width:5px;height:5px;top:42px;z-index:2}.skin-preview.shape-patchwizard:before{left:33px}.skin-preview.shape-patchwizard:after{left:45px;width:4px;height:4px;top:40px}
.skin-preview.shape-patchwizard .skin-emblem{top:55px;font-size:18px;transform:translateX(-50%) rotate(8deg)}
.skin-preview.shape-starwizard .skin-hat{transform:rotate(-13deg)}
.skin-preview.shape-starwizard:before{content:'✦ ✦';position:absolute;top:22px;left:29px;color:var(--skin-band);font-size:15px;letter-spacing:18px;text-shadow:0 0 8px #0c0d25}.skin-preview.shape-starwizard:after{content:'☾ ☽';position:absolute;top:46px;left:21px;color:var(--skin-band);font-size:13px;letter-spacing:18px;text-shadow:0 0 8px #0c0d25}
.skin-preview.shape-tallwizard .skin-hat{height:86px;transform:translateY(-10px);clip-path:polygon(50% 0,61% 8%,64% 24%,69% 38%,63% 50%,52% 57%,57% 67%,66% 76%,70% 88%,100% 100%,0 100%,0 84%,20% 72%,31% 56%,34% 42%,38% 24%,43% 9%)}
.skin-preview.shape-tallwizard:before{content:'';position:absolute;right:18px;bottom:29px;width:15px;height:3px;background:#4b2f1f;border-radius:2px;box-shadow:14px -2px 0 2px #5e3826}
.skin-preview.shape-space .skin-hat{width:66px;height:66px;top:12px;border-radius:50%}.skin-preview.shape-space:before{content:'';position:absolute;top:27px;left:calc(50% - 17px);width:34px;height:24px;border-radius:45% 45% 48% 48%;background:rgba(129,232,255,.55);z-index:1}.skin-preview.shape-space:after{content:'';position:absolute;bottom:18px;left:calc(50% - 18px);width:36px;height:8px;background:var(--skin-band);border-radius:6px}
.skin-preview.shape-roman .skin-hat{width:66px;height:56px;top:16px;border-radius:58% 58% 18% 18%}.skin-preview.shape-roman:before{content:'';position:absolute;top:0;left:calc(50% - 7px);width:14px;height:34px;background:var(--skin-band);clip-path:polygon(50% 0,100% 70%,70% 100%,30% 100%,0 70%);z-index:1}.skin-preview.shape-roman:after{content:'';position:absolute;left:calc(50% - 33px);top:50px;width:66px;height:10px;background:var(--skin-edge);border-radius:6px}
.skin-preview.shape-drinking .skin-hat{width:54px;height:34px;top:28px;border-radius:55% 55% 45% 45%}.skin-preview.shape-drinking:before,.skin-preview.shape-drinking:after{content:'';position:absolute;top:22px;width:11px;height:26px;background:var(--skin-band);border-radius:2px;z-index:1}.skin-preview.shape-drinking:before{left:16px}.skin-preview.shape-drinking:after{right:16px}.skin-preview.shape-drinking .skin-emblem{top:21px;font-size:16px}
.skin-preview.shape-cap .skin-hat{width:66px;height:34px;top:28px;border-radius:52% 52% 44% 44%;clip-path:none;transform:none}.skin-preview.shape-cap:before{content:'';position:absolute;left:calc(50% - 28px);top:39px;width:56px;height:14px;background:var(--skin-edge);border-radius:12px 12px 16px 16px;z-index:1}.skin-preview.shape-cap:after{content:'';position:absolute;left:calc(50% - 8px);top:38px;width:32px;height:14px;background:var(--skin-top);border-radius:0 0 18px 18px;transform:skewX(-18deg);z-index:2}.skin-preview.shape-cap .skin-emblem{top:22px;font-size:15px;color:#fff6d4}
.skin-preview.shape-afro .skin-emblem{display:none}
.skin-preview.shape-viking .skin-emblem{top:29px;font-size:15px}
.skin-preview.shape-patchwizard .skin-hat{width:72px;height:82px;top:7px;transform:rotate(14deg);clip-path:polygon(47% 0,60% 8%,65% 18%,70% 35%,66% 48%,57% 58%,61% 70%,70% 80%,74% 100%,6% 100%,2% 86%,18% 72%,31% 58%,35% 40%,39% 22%,43% 8%);border-radius:0}
.skin-preview.shape-patchwizard:before,.skin-preview.shape-patchwizard:after{content:'';position:absolute;border-radius:50%;background:#24190f;width:6px;height:6px;top:43px;z-index:2}.skin-preview.shape-patchwizard:before{left:34px}.skin-preview.shape-patchwizard:after{left:47px;width:5px;height:5px;top:40px}
.skin-preview.shape-patchwizard .skin-emblem{top:58px;left:50%;transform:translateX(-50%) rotate(10deg);font-size:20px;color:#2b170d;text-shadow:none}

/* v9.3 secure email accounts, order recovery */
.account-panel{z-index:85;max-width:520px;max-height:94dvh}
#accountBackdrop{z-index:84}
.account-menu-button{max-width:520px;margin:7px auto;display:block}
.account-tabs{display:flex;gap:7px;margin:14px 0;flex-wrap:wrap}
.account-tabs button{border:1px solid #8b79bf;border-radius:8px;background:#393052;padding:10px;color:#f7e7ff;cursor:pointer;font:700 12px system-ui}
.account-tabs button.selected{border-color:#f2cb8c;background:#634c80}
.account-form{display:flex;flex-direction:column;gap:13px;margin-top:15px}
.account-form label{font:700 12px system-ui;color:#f4eafc;display:flex;flex-direction:column;gap:6px}
.account-form input{padding:12px 13px;border:1px solid #7e76a8;border-radius:8px;background:#0d1227;color:white;font:14px system-ui;min-width:0;width:100%;box-sizing:border-box}
.account-message{color:#e5d1a3;font-size:12px;line-height:1.5;max-width:510px;margin:10px auto;white-space:pre-wrap}
.account-orders{max-height:200px;overflow:auto;color:#f4e5f1;font-size:12px;line-height:1.5}
.account-order{padding:8px 2px;border-bottom:1px solid #5d547a;display:flex;justify-content:space-between;gap:10px}
.account-order strong{color:#ffe3a8}
.shop-account-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.shop-account-actions .secondary-button{flex:1;font-size:12px;padding:11px 8px}
#accountPanel [hidden],#accountPanel form[hidden]{display:none!important}
@media(max-width:650px){.account-panel{padding:18px 14px}.account-tabs button{padding:8px 5px;font-size:10px}.shop-account-actions .secondary-button{font-size:10px}}

/* v9.4: monetization beta notices and compact version in RexTeq copyright */
.development-notice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;max-width:560px;margin:5px auto 14px;padding:11px 13px;background:#6e57301d;border:1px solid #d9ac6375;border-radius:9px;color:#f4dbb2;font-size:11px;line-height:1.45;text-align:center}
.development-notice strong{font-size:12px;letter-spacing:.13em;color:#ffde9f}
.development-notice span{color:#dbc5a8}
.development-notice-menu{max-width:420px;margin:13px auto 11px;padding:10px 12px}
.shop-panel .development-notice{margin-top:0;margin-bottom:15px;flex-shrink:0}
@media(max-width:650px){.development-notice-menu{max-width:min(360px,100%);margin:12px auto 9px}.development-notice strong{font-size:11px}.development-notice span{font-size:10px}}

/* v9.6: craft while moving; mobile joystick must remain reachable with forge open.
   The panel takes the upper part of the display and leaves a dedicated touch
   control zone below. The backdrop is decorative on phones, not a touch trap. */
@media (max-width:650px){
  .forge-backdrop{pointer-events:none;backdrop-filter:none;background:rgba(4,5,14,.18)}
  .forge-panel{top:0;right:0;bottom:auto;left:0;width:100%;height:min(64dvh,560px);max-height:calc(100dvh - 215px);border-left:0;border-bottom:1px solid #53446d;box-shadow:0 15px 45px #0009}
}


/* v9.7 — two-thumb touch controls in portrait and landscape (including
   wide-screen tablets whose CSS width exceeds the old 650px cutoff). */
.mobile-tip{display:none}
.touch-device .mobile-controls{display:block}
.touch-device .mobile-tip{display:block}
.touch-device .desktop-tip{display:none}
.touch-device .joystick{
  position:absolute;left:max(18px,env(safe-area-inset-left));
  bottom:calc(102px + env(safe-area-inset-bottom));
  width:106px;height:106px;border:2px solid #d9c9ff9e;
  border-radius:50%;background:#ffffff19;pointer-events:auto;touch-action:none;
  box-shadow:0 0 18px #15123355;user-select:none;-webkit-user-select:none
}
.touch-device .joystick-knob{left:34px;top:34px;height:35px;width:35px}
.touch-device .mobile-fire{
  position:absolute;right:max(18px,env(safe-area-inset-right));
  bottom:calc(113px + env(safe-area-inset-bottom));
  width:82px;height:82px;border-radius:50%;pointer-events:auto;
  touch-action:none;user-select:none;-webkit-user-select:none;
  font-size:13px
}
.touch-device .mobile-fire:active,.touch-device .joystick:active{filter:brightness(1.25)}
@media(max-width:650px){
  .touch-device .joystick{bottom:calc(100px + env(safe-area-inset-bottom))}
  .touch-device .mobile-fire{bottom:calc(115px + env(safe-area-inset-bottom))}
}
@media(max-width:370px){
  .status{width:calc(100vw - 142px);min-width:155px;padding:8px}
  .wordmark.sm{font-size:17px}
  .status-values{grid-template-columns:repeat(2,1fr)}
  .orb-hud{width:117px}
  .resource-hud{width:calc(100vw - 89px)}
}
@media (max-height:520px) and (min-width:651px){
  .touch-device .leaderboard,.touch-device .map-frame,.touch-device .bottom-right{display:none}
  .touch-device .status{top:6px;left:max(8px,env(safe-area-inset-left));width:205px;padding:8px 10px}
  .touch-device .status-top{margin-bottom:5px}
  .touch-device .status-values{margin-top:7px;gap:3px}
  .touch-device .status-values strong{font-size:12px}
  .touch-device .wordmark.sm{font-size:19px}
  .touch-device .orb-hud{top:6px;bottom:auto;right:max(8px,env(safe-area-inset-right));left:auto;transform:none;min-width:0;width:175px;padding:7px;gap:4px;flex-wrap:wrap}
  .touch-device .orb-sigil{width:26px;height:26px;font-size:18px}
  .touch-device .orb-name{font-size:9px;white-space:normal}
  .touch-device .charge-caption{font-size:8px;max-width:115px}
  .touch-device .forge-open{padding:5px 8px;font-size:10px}
  .touch-device .forge-open kbd{display:none}
  .touch-device .shop-game-button{padding:6px;font-size:9px}
  .touch-device .resource-hud{bottom:5px;left:50%;transform:translateX(-50%);width:310px;padding:6px 9px}
  .touch-device .tiny-heading{margin-bottom:3px;font-size:8px}
  .touch-device .tiny-heading span{display:none}
  .touch-device .essence strong{font-size:15px}
  .touch-device .arena-label{top:4px;max-width:35vw;overflow:hidden;text-overflow:ellipsis;font-size:8px}
  .touch-device .network-status{top:22px;font-size:8px}
  .touch-device .joystick{left:max(20px,env(safe-area-inset-left));bottom:calc(16px + env(safe-area-inset-bottom));width:98px;height:98px}
  .touch-device .joystick-knob{left:30px;top:30px}
  .touch-device .mobile-fire{right:max(20px,env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));width:82px;height:82px}
  .touch-device .forge-backdrop{pointer-events:none;backdrop-filter:none;background:#080d1d55}
  .touch-device .forge-panel{top:0;right:0;left:auto;bottom:0;width:min(56vw,430px);height:100dvh;max-height:none;padding:10px 12px;box-shadow:-12px 0 40px #000a}
  .touch-device .forge-head h2{font-size:20px}
  .touch-device .alchemy-row{padding:6px}
  .touch-device .forge-footnote{font-size:8px}
  .touch-device .forge-content{padding-bottom:20px}
}
@media (max-height:520px) and (max-width:650px){
  .touch-device .joystick{bottom:calc(12px + env(safe-area-inset-bottom))}
  .touch-device .mobile-fire{bottom:calc(20px + env(safe-area-inset-bottom))}
  .touch-device .forge-panel{height:55dvh;max-height:55dvh}
}
/* Touch tablets also need their movement thumb free when the forge is open. */
.touch-device .forge-backdrop{pointer-events:none;backdrop-filter:none;background:rgba(4,5,14,.18)}
/* Keep score labels legible on narrow touch HUDs and avoid the introductory
   message obscuring health/forge buttons. */
@media(max-width:650px){
  .touch-device .status-values{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 7px}
  .touch-device .status-values small{font-size:8px;letter-spacing:.01em}
  .touch-device .status-values>div:nth-child(3){border-left:0;padding-left:0}
  .touch-device .center-top{top:184px;width:min(93vw,420px);pointer-events:none}
  .touch-device .center-message{font-size:10px;line-height:1.4;padding:6px 10px}
}
@media(max-height:520px) and (min-width:651px){
  .touch-device .status-values{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 7px}
  .touch-device .status-values>div:nth-child(3){border-left:0;padding-left:0}
  .touch-device .center-top{top:150px;max-width:40vw;pointer-events:none}
  .touch-device .center-message{font-size:10px;line-height:1.4;padding:6px 9px}
}

/* v9.8 late mobile overrides to beat earlier touch-device rules */
@media(max-width:650px){
  .touch-device .arena-label{top:102px;left:50%;right:auto;transform:translateX(-50%);max-width:calc(100vw - 16px);font-size:7px;overflow:hidden;text-overflow:ellipsis}
  .touch-device .network-status{top:126px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 16px);font-size:8px;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:650px) and (max-height:760px){
  .touch-device .arena-label{top:96px}
  .touch-device .network-status{top:118px}
}

/* v10: minimal HUD across mobile Safari/Chrome portrait + landscape.
   These rules follow earlier responsive overrides intentionally. */
.touch-device #gameHud .leaderboard,
.touch-device #gameHud .bottom-right,
.touch-device #gameHud .arena-label,
.touch-device #gameHud .network-status,
.touch-device #gameHud .center-top,
.touch-device #gameHud .shop-game-button {display:none!important}
.touch-device #gameHud .status {
  top:calc(8px + env(safe-area-inset-top));
  left:calc(8px + env(safe-area-inset-left));
  width:min(205px,53vw);padding:8px 10px;border-radius:12px;
  box-shadow:0 4px 12px #0005;backdrop-filter:none;
}
.touch-device #gameHud .status-top {margin-bottom:7px;justify-content:flex-start;flex-wrap:wrap;gap:4px}
.touch-device #gameHud .status-top .wordmark {display:none}
.touch-device #gameHud .mode-tag {font-size:8px;padding:3px 5px;letter-spacing:.025em}
.touch-device #gameHud .arena-share {font-size:8px;padding:3px 6px}
.touch-device #gameHud .health-line {font-size:8px;margin-bottom:5px}
.touch-device #gameHud .health-line span:last-child{font-size:9px}
.touch-device #gameHud .bar{height:5px}
.touch-device #gameHud .status-values{
  margin-top:7px;display:grid;grid-template-columns:1fr 1fr;gap:5px;
}
.touch-device #gameHud .status-values>div+div{padding:0;border:0}
.touch-device #gameHud .status-values>div:nth-child(2),
.touch-device #gameHud .status-values>div:nth-child(3){display:none}
.touch-device #gameHud .status-values small{font-size:7px;letter-spacing:.01em;margin:0}
.touch-device #gameHud .status-values strong{font-size:13px}
.touch-device #gameHud .orb-hud {
  top:calc(8px + env(safe-area-inset-top));
  right:calc(8px + env(safe-area-inset-right));left:auto;bottom:auto;
  width:min(130px,34vw);min-width:0;max-width:none;
  transform:none;display:block;padding:0;border:0;
  background:none;box-shadow:none;backdrop-filter:none;
}
.touch-device #gameHud .orb-sigil,
.touch-device #gameHud .orb-hud-info {display:none}
.touch-device #gameHud .forge-open{
  display:block;width:100%;min-height:42px;padding:9px 5px;
  font-size:11px;letter-spacing:.015em;border-radius:11px;
  box-shadow:0 5px 14px #0007;
}
.touch-device #gameHud .forge-open kbd{display:none}
.touch-device #gameHud .resource-hud{
  position:absolute;left:calc(8px + env(safe-area-inset-left));
  right:calc(8px + env(safe-area-inset-right));bottom:calc(7px + env(safe-area-inset-bottom));
  transform:none;width:auto;max-width:none;border-radius:10px;
  padding:6px 10px 7px;box-shadow:0 4px 12px #0005;backdrop-filter:none;
}
.touch-device #gameHud .tiny-heading{margin-bottom:4px;font-size:8px}
.touch-device #gameHud .tiny-heading span{display:none}
.touch-device #gameHud .essences{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
.touch-device #gameHud .essence{gap:5px}
.touch-device #gameHud .essence small{font-size:8px;letter-spacing:0}
.touch-device #gameHud .essence strong{font-size:15px;line-height:1.05}
.touch-device #gameHud .essence .shape{width:10px;height:10px}
.touch-device #gameHud .joystick{
  left:calc(19px + env(safe-area-inset-left));
  bottom:calc(90px + env(safe-area-inset-bottom));
  width:96px;height:96px;border-width:2px;background:#a793c629;
  box-shadow:none;
}
.touch-device #gameHud .joystick-knob{left:29px;top:29px;width:34px;height:34px}
.touch-device #gameHud .mobile-fire{
  right:calc(19px + env(safe-area-inset-right));
  bottom:calc(101px + env(safe-area-inset-bottom));
  width:75px;height:75px;font-size:13px;box-shadow:0 0 10px #fd8c603c;
}
.touch-device #gameHud .mobile-fire span{font-size:20px}
@media(max-width:370px){
  .touch-device #gameHud .status{width:min(185px,53vw);padding:7px 8px}
  .touch-device #gameHud .orb-hud{width:min(112px,36vw)}
  .touch-device #gameHud .forge-open{font-size:9px;min-height:39px}
  .touch-device #gameHud .joystick{width:82px;height:82px;bottom:calc(85px + env(safe-area-inset-bottom))}
  .touch-device #gameHud .joystick-knob{left:24px;top:24px;width:30px;height:30px}
  .touch-device #gameHud .mobile-fire{width:66px;height:66px;bottom:calc(91px + env(safe-area-inset-bottom))}
  .touch-device #gameHud .essence small{font-size:7px}
}
@media(max-height:520px) and (min-width:651px){
  .touch-device #gameHud .status{top:calc(5px + env(safe-area-inset-top));width:185px;padding:5px 9px}
  .touch-device #gameHud .resource-hud{
    left:50%;right:auto;transform:translateX(-50%);width:min(320px,calc(100vw - 240px));
    bottom:calc(6px + env(safe-area-inset-bottom));
  }
  .touch-device #gameHud .joystick{
    left:calc(18px + env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));
    width:87px;height:87px;
  }
  .touch-device #gameHud .joystick-knob{left:26px;top:26px;width:32px;height:32px}
  .touch-device #gameHud .mobile-fire{
    right:calc(18px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));
    width:77px;height:77px;
  }
  .touch-device .forge-panel{width:min(56vw,430px);height:100dvh;max-height:100dvh;top:0;bottom:0;left:auto;right:0}
}
/* The desktop fire-button gradient was scoped to narrow CSS viewports.
   Reapply it for touch-screen landscape widths (e.g., iPhone 13 at 844px). */
.touch-device #gameHud .mobile-fire{
  background:radial-gradient(circle at 35% 25%,#fac48e,#df795a);
  border:2px solid #ffe4b1;color:#3a2040;
  font-weight:900;border-radius:50%;
}

/* v10.2 — minimal mobile Quick Forge; no separate capacity upgrade. */
.touch-device .forge-backdrop:has(+ .forge-panel.quick-forge){background:transparent;backdrop-filter:none;pointer-events:none}
.touch-device .forge-panel.quick-forge{
  box-sizing:border-box;position:fixed;top:clamp(110px,16dvh,146px);right:max(8px,env(safe-area-inset-right));bottom:auto;left:auto;
  width:min(294px,calc(100vw - 16px));height:auto;max-height:calc(100dvh - 205px);min-height:0;
  padding:10px 10px 11px;border:1px solid #8370ab;border-radius:14px;
  background:linear-gradient(155deg,rgba(28,25,52,.98),rgba(16,21,42,.98));
  box-shadow:0 12px 35px #050819c9;overflow-y:auto;overscroll-behavior:contain;
  touch-action:pan-y;-webkit-overflow-scrolling:touch
}
.touch-device .forge-panel.quick-forge .forge-head{align-items:center;gap:9px;margin:0 0 7px}
.touch-device .forge-panel.quick-forge .forge-head h2{font-size:17px;letter-spacing:-.03em;line-height:1.1;margin:0}
.touch-device .forge-panel.quick-forge .forge-head p,
.touch-device .forge-panel.quick-forge .forge-head .section-eyebrow,
.touch-device .forge-panel.quick-forge .forge-resource-line,
.touch-device .forge-panel.quick-forge .forge-footnote{display:none}
.touch-device .forge-panel.quick-forge .close-button{width:30px;height:30px;min-width:30px;font-size:22px}
.touch-device .forge-panel.quick-forge .forge-content{gap:5px;padding:0}
.touch-device .forge-panel.quick-forge .quick-capacity{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 8px;border:1px solid #625679;border-radius:8px;background:#ffffff0b}
.touch-device .forge-panel.quick-forge .quick-cap-label{min-width:0;flex:1}
.touch-device .forge-panel.quick-forge .quick-cap-label>b{display:block;color:#f5dbab;font-size:10px;line-height:1.15}
.touch-device .forge-panel.quick-forge .attune-cost{display:flex;align-items:center;gap:4px;flex-wrap:wrap;margin-top:2px;font-size:9px;color:#bab2d1}
.touch-device .forge-panel.quick-forge .attune-cost .cost-pill{font-size:9px;gap:3px}
.touch-device .forge-panel.quick-forge .attune-cost .shape{width:8px;height:8px}
.touch-device .forge-panel.quick-forge .choice-button{min-height:32px;padding:6px 10px;font-size:10px;white-space:nowrap;touch-action:manipulation}
.touch-device .forge-panel.quick-forge .quick-elements{display:flex;flex-direction:column;gap:4px}
.touch-device .forge-panel.quick-forge .quick-element{display:flex;align-items:center;gap:8px;min-height:36px;padding:3px 6px;border:1px solid #4c4566;border-radius:8px;background:#ffffff0a}
.touch-device .forge-panel.quick-forge .quick-element>.shape{width:14px;height:14px;flex:none}
.touch-device .forge-panel.quick-forge .quick-element-name{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}
.touch-device .forge-panel.quick-forge .quick-element-name>b{font-size:11px;color:#fff3fa;line-height:1.05}
.touch-device .forge-panel.quick-forge .quick-element-name>small{font-size:9px;color:#aaa3bd;white-space:nowrap;line-height:1.05}
.touch-device .forge-panel.quick-forge .quick-element-name>small.ready{color:#96f2b5}
.touch-device .forge-panel.quick-forge .alchemy-stepper{gap:4px}
.touch-device .forge-panel.quick-forge .alchemy-stepper button{width:32px;height:32px;min-width:32px;font-size:17px;touch-action:manipulation}
.touch-device .forge-panel.quick-forge .alchemy-stepper b{min-width:24px;font-size:12px}
.touch-device .forge-panel.quick-forge .quick-forge-status{padding:6px 7px;min-height:25px;font-size:10px;line-height:1.25;display:flex;align-items:center}
.touch-device .forge-panel.quick-forge .quick-formula-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:6px;padding:5px 6px;border:1px solid #514667;border-radius:8px}
.touch-device .forge-panel.quick-forge .quick-formula-actions .costs{display:flex;justify-content:flex-start;flex:1;gap:5px;min-width:0;margin:0;flex-wrap:nowrap}
.touch-device .forge-panel.quick-forge .quick-formula-actions .cost-pill{font-size:10px;gap:2px}
.touch-device .forge-panel.quick-forge .quick-formula-actions .cost-pill .shape{width:9px;height:9px}
.touch-device .forge-panel.quick-forge .quick-formula-actions>button{flex:0 0 auto;width:auto;padding:6px 11px}
.touch-device .forge-open.craft-ready{background:linear-gradient(110deg,#b5efb1,#72cfa4);border-color:#c4ffd0;color:#16382e;box-shadow:0 0 0 2px #92f7aa3d}
.touch-device .forge-open.craft-ready:before{content:'●';color:#27774a;font-size:9px;margin-right:3px}
@media(max-height:520px) and (min-width:651px){
  .touch-device .forge-panel.quick-forge{top:max(7px,env(safe-area-inset-top));left:50%;right:auto;bottom:auto;transform:translateX(-50%);width:min(302px,42vw);height:auto;max-height:calc(100dvh - 14px);padding:7px 9px}
  .touch-device .forge-panel.quick-forge .quick-elements{gap:2px}
  .touch-device .forge-panel.quick-forge .quick-element{min-height:33px;padding:2px 5px}
  .touch-device .forge-panel.quick-forge .quick-capacity{padding:4px 6px}
  .touch-device .forge-panel.quick-forge .forge-head{margin-bottom:4px}
}
@media(max-width:370px){
  .touch-device .forge-panel.quick-forge{right:6px;width:min(288px,calc(100vw - 12px));padding:8px}
  .touch-device .forge-panel.quick-forge .quick-element{gap:5px}
  .touch-device .forge-panel.quick-forge .alchemy-stepper{gap:2px}
  .touch-device .forge-panel.quick-forge .alchemy-stepper button{width:30px;height:30px;min-width:30px}
}
@media(max-width:370px) and (max-height:650px){
  /* Keep the compact forge above the joystick even on a short 320px phone. */
  .touch-device .forge-panel.quick-forge{top:82px;max-height:calc(100dvh - 240px)}
}
/* One-tap 2×2 mobile upgrades replace the tall four-row stepper editor. */
.touch-device .forge-panel.quick-forge .quick-forge-caption{font-size:9px;font-weight:800;letter-spacing:.12em;color:#aeb2d2;text-align:center;margin:1px 0 0}
.touch-device .forge-panel.quick-forge .quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.touch-device .forge-panel.quick-forge .quick-action{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;min-width:0;
  min-height:54px;padding:8px 10px;background:#25223e;border:1px solid #51456d;border-radius:9px;
  text-align:left;color:#e2d8f0;touch-action:manipulation
}
.touch-device .forge-panel.quick-forge .quick-action:disabled{opacity:.68;cursor:not-allowed}
.touch-device .forge-panel.quick-forge .quick-action.quick-ready{background:#204238;border-color:#82e2af;color:#e7ffe9;box-shadow:inset 0 0 12px #80f7aa17}
.touch-device .forge-panel.quick-forge .quick-action-name{display:flex;align-items:center;gap:7px;white-space:nowrap}
.touch-device .forge-panel.quick-forge .quick-action-name .shape{width:13px;height:13px}
.touch-device .forge-panel.quick-forge .quick-action-name b{font-size:11px;letter-spacing:.01em}
.touch-device .forge-panel.quick-forge .quick-action small{font-size:9px;color:#c3bbd5;line-height:1}
.touch-device .forge-panel.quick-forge .quick-action.quick-ready small{color:#9bf4c0}
.touch-device .forge-panel.quick-forge .quick-forge-status{min-height:24px}
@media(max-height:520px) and (min-width:651px){
  .touch-device .forge-panel.quick-forge .quick-action{min-height:48px;padding:6px 8px}
}

/* elixar.io branding: keep six-letter wordmark legible across phone widths */
.hero-title{font-size:clamp(64px,11vw,100px);letter-spacing:-.085em}
@media(max-width:650px){.hero-title{font-size:clamp(54px,13vw,82px)}.status .wordmark.sm{font-size:clamp(13px,4vw,17px);white-space:nowrap}.hero-tagline{letter-spacing:.12em}}
@media(max-width:360px){.status .wordmark.sm{font-size:13px;letter-spacing:-.08em}}

/* Use exact arena hat art as skin previews; suppress older approximate CSS shapes. */
.skin-preview.canvas-preview::before,.skin-preview.canvas-preview::after{display:none!important}
.skin-preview-canvas{position:relative;display:block;width:100%;height:100%;max-width:120px;image-rendering:auto}

/* Preserve the new brand wordmark instead of letting the arena mode badge overlap it on narrow phones. */
@media(max-width:650px){.status .mode-tag{display:none!important}.status-top{justify-content:flex-start}.status .wordmark.sm{font-size:clamp(13px,4vw,17px)}}

/* v10.6 — unobtrusive, scrollable-menu-only AdSense unit and mobile-friendly post-game interstitial flow. */
.menu-ad-section{display:block;width:min(100%,728px);max-width:728px;min-height:0;margin:30px auto 24px;padding:12px 12px 14px;border-radius:12px;overflow:visible;text-align:center}
.menu-ad-section[hidden]{display:none!important}
.menu-ad-section .ad-label{margin-bottom:10px}
#adsenseSlot{min-height:0;width:100%;overflow:visible}
#adsenseSlot > ins.adsbygoogle{display:block;width:100%;min-width:0}
.death-ad-notice{font-size:10px!important;color:#b6a9ca!important;line-height:1.5;margin:0 0 12px!important}
.death-ad-status{min-height:0;margin:6px 0 0!important;font-size:11px!important;color:#e6ce99!important}
.death-ad-status:empty{display:none}
.death-card{max-height:calc(100dvh - 26px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
@media(max-width:650px){
  .menu-ad-section{width:100%;margin:22px auto 22px;padding:10px 7px 12px;min-height:0}
  .menu-ad-section .ad-label{font-size:9px;letter-spacing:.1em;margin-bottom:8px}
  .death-card{width:calc(100vw - 22px);max-width:430px;padding:20px 18px 18px}
  .death-card .death-symbol{font-size:50px;margin:3px 0}
  .death-card h2{font-size:clamp(27px,8vw,34px)}
  .death-card>p{margin:9px 0 12px}
  .death-results{padding:12px 0;margin-bottom:10px}
  .death-results strong{font-size:20px}
  .death-card .primary-button{min-height:44px;touch-action:manipulation}
  .death-ad-notice{margin-bottom:9px!important}
}
@media(max-height:430px){
  .death-card{padding:12px 16px;max-height:calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  .death-card .death-symbol{display:none}
  .death-card h2{font-size:24px}
  .death-card .death-results{padding:7px 0;margin-bottom:8px}
  .death-card .death-results strong{font-size:17px}
  .death-card .death-ad-notice{font-size:9px!important;margin-bottom:7px!important}
}

/* v11.3: The public menu has one prominent multiplayer start action. The hidden solo
   control remains solely to support the standalone and development test harness. */
#playSolo{display:none!important}
#playOnline.primary-button:disabled{opacity:.55;cursor:wait;transform:none}

/* v11.6 — explicit confirmation for Esc and the death-screen menu button.
   A separate high-level overlay covers the arena, forge, and death screen.
   Keep the actions comfortably tappable on narrow or landscape phones. */
.quit-confirm-overlay{
  position:fixed;inset:0;z-index:150;display:grid;place-items:center;
  background:rgba(6,8,22,.8);backdrop-filter:blur(9px);
  padding:calc(14px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right))
          calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  overflow-y:auto;overscroll-behavior:contain;
}
.quit-confirm-dialog{
  width:min(420px,100%);max-height:100%;overflow-y:auto;
  padding:clamp(20px,4vw,31px);border-radius:18px;
  border:1px solid #9582b2;
  background:linear-gradient(145deg,#25203f,#12182d);
  color:#f5efff;text-align:center;box-shadow:0 25px 90px #000b;
}
.quit-confirm-dialog h2{font:800 clamp(22px,5vw,29px)/1.15 'Space Grotesk',system-ui,sans-serif;margin:12px 0;letter-spacing:-.035em}
.quit-confirm-dialog p{font-size:13px;line-height:1.6;color:#c3bbd7;margin:0 0 23px}
.quit-confirm-actions{display:flex;gap:10px}
.quit-confirm-actions>button{flex:1;min-width:0;min-height:46px;padding:12px 9px;touch-action:manipulation}
.quit-confirm-dialog :focus-visible{outline:3px solid #e7ce97;outline-offset:3px}
@media(max-width:390px){
  .quit-confirm-actions{flex-direction:column}
  .quit-confirm-dialog{padding:20px 16px}
}
@media(max-height:450px){
  .quit-confirm-dialog{padding:14px 18px}
  .quit-confirm-dialog h2{margin:6px 0;font-size:22px}
  .quit-confirm-dialog p{font-size:11px;line-height:1.4;margin-bottom:11px}
  .quit-confirm-actions>button{min-height:42px}
}
