/* Chess Duel "game feel" layer: loading screen, main menu, mode and agent select, VS splash, toasts, pause menu.
   Loaded after the inline styles in index.html so it wins at equal specificity. Desktop fit (100% height) and the
   dedicated mobile layout are untouched; this file only restyles chrome and adds the new screens. */

:root { --gold: #e1c692; --gold-d: #c4a36a; --ink: #0b1014; --teal: #73c9c8; --hot: #ff4d5e; --glass: #101a1fcc; }

/* ---------- app-shell behaviour: it should feel installed, not like a page ---------- */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button, .agent, .mode-tile, .hub-btn { touch-action: manipulation; cursor: pointer; }
.site-footer { display: none !important; }
button { transition: transform .08s ease, filter .12s ease, background-color .15s ease, box-shadow .2s ease, border-color .2s ease; }
button:active:not(:disabled) { transform: translateY(1px) scale(.97); filter: brightness(1.12); }
button:focus-visible, .agent:focus-visible, .mode-tile:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
#board { -webkit-user-select: none; user-select: none; }

/* ---------- loading screen ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at 50% 40%, #16232a, #070b0e 70%); transition: opacity .5s ease, visibility .5s; }
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot img { width: 92px; height: 92px; animation: bootPulse 1.6s ease-in-out infinite; filter: drop-shadow(0 0 22px #c4a36a66); }
.boot b { font: 26px Georgia, serif; letter-spacing: 7px; color: #efe6d2; font-weight: 400; }
.boot b em { color: var(--gold-d); font-style: normal; }
.boot .bar { width: 180px; height: 3px; background: #ffffff14; border-radius: 3px; overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: bootBar 1.1s linear infinite; }
@keyframes bootPulse { 50% { transform: scale(1.06); } }
@keyframes bootBar { from { transform: translateX(-120%); } to { transform: translateX(380%); } }

/* ---------- overlays: screens slide/fade in instead of popping ---------- */
.overlay.show { animation: screenIn .28s ease both; }
@keyframes screenIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
#pick { padding: 0; background: #070b0e; backdrop-filter: none; }
#pick .pickbox { max-width: none; margin: 0; min-height: 100%; }

/* ---------- main menu (hub) ---------- */
.hub { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #eee8da; overflow: hidden; padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) max(22px, env(safe-area-inset-bottom)); }
.hub-bg { position: absolute; inset: -5%; background: url(assets/agents.jpg) center / cover; filter: saturate(.85) brightness(.62); animation: kenburns 46s ease-in-out infinite alternate; z-index: 0; }
.hub::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #070b0efa 0%, #070b0ee0 30%, #070b0e55 68%, #070b0e99 100%), linear-gradient(0deg, #070b0e 0%, transparent 38%); }
.hub > *:not(.hub-bg) { position: relative; z-index: 2; }
@keyframes kenburns { from { transform: scale(1.02) translateX(-1%); } to { transform: scale(1.12) translateX(1.5%); } }
.hub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; animation: riseIn .5s .05s both; }
.hub-profile { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; background: var(--glass); border: 1px solid #d2bc8530; border-radius: 4px 14px 4px 14px; min-height: 52px; max-width: min(420px, 62vw); }
.hub-profile .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-profile b { font: 600 15px Georgia, serif; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-profile small { font-size: 10px; letter-spacing: 1.2px; color: #a9b3ab; }
.hub-profile .rbar { height: 3px; border-radius: 2px; background: #ffffff1c; overflow: hidden; margin-top: 3px; width: 140px; max-width: 100%; }
.hub-profile .rbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold)); }
.hub-profile button { margin-left: 6px; min-height: 34px; padding: 6px 12px; font-size: 11px; }
.hub-quick { display: flex; gap: 8px; }
.hub-quick button { width: 44px; height: 44px; padding: 0; border-radius: 4px 12px 4px 12px; font-size: 16px; }
.hub-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 34px; padding: 3vh 0; max-width: 520px; }
.hub-logo { animation: riseIn .6s .1s both; }
.hub-logo .crest { width: 54px; height: 54px; margin-bottom: 10px; filter: drop-shadow(0 0 16px #c4a36a55); }
.hub-logo h1 { margin: 0; font: clamp(44px, 7vw, 84px) / .95 Georgia, serif; font-weight: 400; letter-spacing: 3px; color: #f3ecda; text-shadow: 0 4px 30px #000a; }
.hub-logo h1 em { display: block; color: var(--gold); font-style: normal; letter-spacing: 8px; }
.hub-logo p { margin: 14px 0 0; font-size: 13px; letter-spacing: 2px; color: #b9c2ba; text-transform: uppercase; }
.hub-menu { display: flex; flex-direction: column; gap: 10px; }
.hub-btn { --cut: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 0 22px; border: 1px solid #d2bc8538; background: linear-gradient(90deg, #131d22e6, #131d22a0); color: #eee8da; font: 700 14px Arial, sans-serif; letter-spacing: 3px; text-transform: uppercase; text-align: left;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); border-radius: 0; animation: riseIn .5s both; }
.hub-btn:nth-child(1) { animation-delay: .18s; } .hub-btn:nth-child(2) { animation-delay: .24s; } .hub-btn:nth-child(3) { animation-delay: .3s; } .hub-btn:nth-child(4) { animation-delay: .36s; } .hub-btn:nth-child(5) { animation-delay: .42s; }
.hub-btn:hover, .hub-btn:focus-visible { background: linear-gradient(90deg, #1d2c33, #17252b); border-color: var(--gold-d); color: #fff; padding-left: 30px; }
.hub-btn span:last-child { color: var(--gold-d); font-size: 16px; }
.hub-btn.primary { min-height: 74px; font-size: 20px; letter-spacing: 6px; color: #1a1408; border: 0; background: linear-gradient(100deg, #f3dca6, #d6b46c 55%, #c19849); box-shadow: 0 0 34px #d6b46c40; animation: riseIn .5s .12s both, playGlow 2.6s 1s ease-in-out infinite; }
.hub-btn.primary:hover, .hub-btn.primary:focus-visible { background: linear-gradient(100deg, #ffe9b8, #e3c27c 55%, #d2a95a); color: #120d03; padding-left: 30px; }
.hub-btn.primary span:last-child { color: #3a2a0b; font-size: 24px; }
.hub-btn small { display: block; font: 400 11px Arial, sans-serif; letter-spacing: .5px; text-transform: none; color: #8f9a91; margin-top: 3px; }
.hub-btn.primary small { color: #5a4416; }
@keyframes playGlow { 50% { box-shadow: 0 0 52px #e3c27c70; } }
.hub-foot { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 2px; color: #7f8b83; animation: riseIn .6s .5s both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- step screens: mode select + agent select ---------- */
.pstep { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) 0; color: #eee8da; background: radial-gradient(ellipse at 50% -10%, #1b2b33, #070b0e 70%); }
.pstep-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #d2bc8522; animation: riseIn .4s both; }
.pstep-head h2 { margin: 0; font: clamp(20px, 3vw, 30px) Georgia, serif; font-weight: 400; letter-spacing: 6px; text-transform: uppercase; flex: 1; }
.pstep-head h2 small { display: block; font: 10px Arial, sans-serif; letter-spacing: 3px; color: var(--gold-d); margin-bottom: 6px; }
.back-btn { min-height: 44px; padding: 0 18px; }
.pstep-body { flex: 1; display: flex; align-items: center; padding: 3vh 0 4vh; }
.modes { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.mode-tile { position: relative; min-height: clamp(280px, 52vh, 460px); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 24px; text-align: left; overflow: hidden; border: 1px solid #d2bc8530; border-radius: 4px 22px 4px 22px; background: #0e171c; color: #eee8da; transition: transform .22s ease, border-color .2s ease, box-shadow .25s ease; animation: riseIn .5s both; }
.mode-tile:nth-child(2) { animation-delay: .08s; } .mode-tile:nth-child(3) { animation-delay: .16s; }
.mode-tile::before { content: ''; position: absolute; inset: 0; background: url(assets/agents.jpg) var(--pos, 0%) 0 / 400% auto; opacity: .5; filter: saturate(.9); transition: opacity .3s, transform .6s; }
.mode-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #070b0efa 8%, #070b0e88 52%, #070b0e33); }
.mode-tile > * { position: relative; z-index: 1; }
.mode-tile:hover, .mode-tile:focus-visible { transform: translateY(-8px); border-color: var(--ac, var(--gold-d)); box-shadow: 0 18px 50px #000a, 0 0 34px color-mix(in srgb, var(--ac, #c4a36a) 40%, transparent); }
.mode-tile:hover::before { opacity: .78; transform: scale(1.05); }
.mode-tile[disabled], .mode-tile.off { opacity: .55; filter: grayscale(.7); }
.mode-tile .ico { font-size: 34px; line-height: 1; }
.mode-tile h3 { margin: 0; font: 400 clamp(22px, 2.6vw, 32px) Georgia, serif; letter-spacing: 5px; text-transform: uppercase; }
.mode-tile p { margin: 0; font-size: 13px; line-height: 1.6; color: #b9c2ba; max-width: 30ch; }
.mode-tile .chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mode-tile .chips span { padding: 6px 12px; font: 700 10px Arial, sans-serif; letter-spacing: 2px; border: 1px solid #d2bc8540; border-radius: 3px; color: #cdd5cc; background: #0b1014aa; }
.mode-tile .chips span.on { background: var(--gold); color: #1a1408; border-color: var(--gold); }
.mode-tile .tag { display: inline-flex; align-items: center; gap: 8px; font: 700 11px Arial, sans-serif; letter-spacing: 1.5px; color: var(--gold); }

.pstep.agents-step .pstep-body { align-items: stretch; padding-bottom: 110px; }
.pstep .agents { width: 100%; align-items: stretch; }
.agent { transition: transform .22s ease, box-shadow .25s ease, border-color .2s ease, filter .2s ease; }
.pstep .agents:has(.agent.sel) .agent:not(.sel) { filter: brightness(.55) saturate(.7); }
.agent.sel { transform: translateY(-8px); border-color: var(--ac); box-shadow: 0 20px 60px #000b, 0 0 44px color-mix(in srgb, var(--ac) 55%, transparent); }
.lockbar { position: sticky; bottom: 0; z-index: 5; margin: 0 calc(-1 * clamp(16px, 4vw, 56px)); padding: 14px clamp(16px, 4vw, 56px) max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px; background: linear-gradient(0deg, #070b0e 60%, #070b0ecc); border-top: 1px solid #d2bc8528; }
.lockbar .sel-name { flex: 1; min-width: 0; font: 400 20px Georgia, serif; letter-spacing: 3px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lockbar .sel-name small { display: block; font: 700 10px Arial, sans-serif; letter-spacing: 2px; color: var(--ac, var(--gold-d)); }
.lock-btn { min-width: 220px; min-height: 56px; font: 800 15px Arial, sans-serif; letter-spacing: 4px; color: #1a1408; border: 0; background: linear-gradient(100deg, #f3dca6, #d6b46c 55%, #c19849); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.lock-btn:disabled { filter: grayscale(1) brightness(.5); cursor: not-allowed; }
.lock-btn:not(:disabled) { animation: playGlow 2s ease-in-out infinite; }

/* ---------- VS splash ---------- */
.vs { position: fixed; inset: 0; z-index: 120; display: none; background: #070b0e; overflow: hidden; }
.vs.show { display: block; animation: vsIn .2s both; }
.vs.out { animation: vsOut .45s both; }
@keyframes vsIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vsOut { to { opacity: 0; transform: scale(1.04); } }
.vs-side { position: absolute; top: 0; bottom: 0; width: 56%; overflow: hidden; }
.vs-me { left: 0; clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); animation: vsLeft .55s cubic-bezier(.2, .9, .3, 1) both; }
.vs-foe { right: 0; clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); animation: vsRight .55s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes vsLeft { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes vsRight { from { transform: translateX(100%); } to { transform: none; } }
.vs-art { position: absolute; inset: 0; background: url(assets/agents.jpg) var(--portrait) 6% / 400% auto; filter: saturate(1.1); }
.vs-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #070b0ef2 2%, transparent 55%), linear-gradient(90deg, color-mix(in srgb, var(--ac) 38%, transparent), transparent 60%); }
.vs-foe .vs-art::after { background: linear-gradient(0deg, #070b0ef2 2%, transparent 55%), linear-gradient(270deg, color-mix(in srgb, var(--ac) 38%, transparent), transparent 60%); }
.vs-plate { position: absolute; bottom: clamp(24px, 9vh, 90px); display: flex; flex-direction: column; gap: 6px; animation: riseIn .5s .35s both; }
.vs-me .vs-plate { left: clamp(20px, 6vw, 90px); } .vs-foe .vs-plate { right: clamp(20px, 6vw, 90px); text-align: right; align-items: flex-end; }
.vs-plate small { font: 700 11px Arial, sans-serif; letter-spacing: 3px; color: var(--ac); }
.vs-plate b { font: 400 clamp(34px, 6.4vw, 78px) / 1 Georgia, serif; letter-spacing: 4px; text-transform: uppercase; color: #fff; text-shadow: 0 4px 30px #000; }
.vs-plate span { font: 12px Arial, sans-serif; letter-spacing: 3px; color: #c6cfc7; text-transform: uppercase; }
.vs-plate i { font-style: normal; display: inline-flex; align-items: center; gap: 8px; font: 700 12px Arial, sans-serif; letter-spacing: 2px; color: #e9e1cd; margin-top: 4px; }
.vs-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; font: italic 900 clamp(70px, 14vw, 180px) / 1 Georgia, serif; color: var(--gold); text-shadow: 0 0 60px #e1c69288, 6px 6px 0 #5a4416; animation: vsSlam .5s .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes vsSlam { from { opacity: 0; transform: translate(-50%, -50%) scale(3); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.vs-foot { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); text-align: center; font: 700 11px Arial, sans-serif; letter-spacing: 6px; color: #c6cfc7; z-index: 3; animation: riseIn .5s .8s both; }
.vs-foot::after { content: ''; display: block; margin: 10px auto 0; width: 120px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: bootBar 1.2s linear infinite; }

/* ---------- toast: "YOUR TURN" ---------- */
.toast { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 45; transform: translate(-50%, -14px); opacity: 0; pointer-events: none; padding: 9px 28px; font: 800 13px Arial, sans-serif; letter-spacing: 6px; color: #1a1408; background: linear-gradient(100deg, #f3dca6, #d6b46c); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); box-shadow: 0 0 30px #d6b46c55; }
.toast.show { animation: toastIn 1.5s ease both; }
@keyframes toastIn { 0% { opacity: 0; transform: translate(-50%, -14px); } 14%, 78% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- in-game bar + pause menu (desktop gets the same drop-down phones already have) ---------- */
@media (min-width: 741px) {
  .masthead { padding-top: 10px; padding-bottom: 10px; }
  .masthead .wordmark small, .masthead .arena-label { display: none; }
  .mobile-settings { display: block; width: 46px; height: 46px; min-width: 46px; padding: 0; background: #131d22; border: 1px solid #d2bc8540; color: var(--gold); border-radius: 4px 12px 4px 12px; font-size: 20px; margin-left: auto; }
  .masthead .controls { display: none; }
  .masthead .controls.mobile-open { display: flex; position: fixed; top: 64px; right: 16px; z-index: 80; flex-direction: column; align-items: stretch; width: 270px; padding: 12px; gap: 8px; border: 1px solid #d2bc8540; border-radius: 4px 18px 4px 18px; background: #0f181dfa; box-shadow: 0 24px 60px #000c; animation: screenIn .18s both; }
  .masthead .controls button { min-height: 46px; width: 100%; max-width: none; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 10px 16px; }
}
.masthead .controls #mute::after { content: none !important; }
.mobile-menu-scrim { background: #030a0dbb; backdrop-filter: blur(3px); }

/* ---------- end card: result screen ---------- */
.endcard { backdrop-filter: blur(6px); background: radial-gradient(ellipse at 50% 40%, #0f181de8, #05080bf2); }
.ec-title { font-family: Georgia, serif !important; font-style: normal !important; letter-spacing: .14em !important; font-weight: 400 !important; font-size: clamp(30px, 6vw, 72px) !important; text-align: center; max-width: 100%; padding: 0 12px; animation: titleSlam .6s both; }
@keyframes titleSlam { from { opacity: 0; transform: scale(2.4); } to { opacity: 1; transform: none; } }
.ec-sub { max-width: 52ch; text-align: center; line-height: 1.6; padding: 0 16px; }
.ec-rank { display: flex; align-items: center; gap: 16px; padding: 12px 22px; border: 1px solid #d2bc8538; border-radius: 4px 16px 4px 16px; background: #0b1014cc; animation: riseIn .5s .5s both; }
.ec-rank .delta { font: 800 22px Arial, sans-serif; letter-spacing: 2px; }
.ec-rank .delta.up { color: #7ee0a0; } .ec-rank .delta.down { color: #ff7d8a; }
.ec-rank .meter { width: 160px; height: 6px; background: #ffffff1c; border-radius: 3px; overflow: hidden; }
.ec-rank .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold)); transition: width 1.1s .7s ease; }
.ec-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ec-btn { min-width: 170px; letter-spacing: 3px; text-transform: uppercase; font-size: 13px !important; }
.ec-btn.alt { background: transparent; color: var(--gold); border: 1px solid #d2bc8566; }

@media (max-width: 740px) {
  .modes { grid-template-columns: 1fr; }
  .mode-tile { min-height: 150px; padding: 16px 18px; justify-content: flex-end; }
  .mode-tile .ico { font-size: 24px; }
  .mode-tile p { font-size: 12px; }
  .hub-main { max-width: none; justify-content: flex-end; gap: 22px; padding-bottom: 2vh; }
  .hub-logo h1 { font-size: 50px; } .hub-logo .crest { width: 40px; height: 40px; }
  .hub-btn { min-height: 50px; font-size: 13px; } .hub-btn.primary { min-height: 66px; font-size: 18px; }
  .hub-foot { display: none; } .hub-profile { max-width: 66vw; } .hub-profile .rbar { width: 100px; }
  .lockbar { gap: 10px; } .lock-btn { min-width: 0; flex: 1; font-size: 13px; letter-spacing: 3px; } .lockbar .sel-name { display: none; }
  .pstep.agents-step .pstep-body { padding-bottom: 96px; }
  .vs-side { width: 100%; height: 50%; bottom: auto; } .vs-me { top: 0; clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%); animation-name: vsTop; } .vs-foe { top: 50%; clip-path: polygon(0 14%, 100% 0, 100% 100%, 0 100%); animation-name: vsBottom; }
  .vs-art { background-position: var(--portrait) 8%; } .vs-plate { bottom: 14px; } .vs-me .vs-plate, .vs-foe .vs-plate { left: 18px; right: auto; text-align: left; align-items: flex-start; } .vs-plate b { font-size: 36px; }
  .toast { top: calc(58px + env(safe-area-inset-top, 0px)); }
}
@keyframes vsTop { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes vsBottom { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hub-bg, .boot img, .hub-btn.primary, .lock-btn:not(:disabled) { animation: none !important; } }
body.fx-off .hub-bg { animation: none !important; }

/* polish */
.vs-plate small, .lock-btn, .toast, .lockbar .sel-name small { text-transform: uppercase; }
.pstep-head h2 small { text-transform: uppercase; }
@media (min-width: 741px) { .side > .section-label:first-child { display: none; } }
@media (max-width: 740px) { .vs-foe .vs-plate { bottom: 58px; } .vs-foot { font-size: 10px; letter-spacing: 4px; } }

/* Forged Arena — physical game surfaces and a shared, local icon family. */
.game-icon {width:22px;height:22px;display:inline-block;vertical-align:middle;flex-shrink:0;object-fit:contain;pointer-events:none;}
.brand-mark img {width:100%;height:100%;}.brand-mark {border:0;background:none;overflow:visible;}
body {background:linear-gradient(#060e16df,#060d14ee),url('assets/arena-menu-v2.jpg') center/cover fixed;}
.masthead {background:linear-gradient(180deg,#14232be8,#0a141be8);border-bottom:1px solid #ac8c4b66;box-shadow:0 6px 28px #0008;max-width:none;}
.wordmark {font-weight:bold;letter-spacing:2px;}
.masthead .controls button {display:flex;align-items:center;gap:12px;}
.mobile-settings {box-shadow:inset 0 0 0 3px #080f14,inset 0 0 0 4px #a48a4c30;}
.hub-bg {inset:0;background-image:url('assets/arena-menu-v2.jpg');background-position:65% center;filter:none;animation:none;}
.hub::before {background:linear-gradient(90deg,#050c14ed,#050c14a6 33%,#050c1400 70%),linear-gradient(0deg,#050b14e8,transparent 35%,transparent 75%,#050b1477);}
.hub::after {content:'';position:absolute;inset:12px;pointer-events:none;z-index:3;border:1px solid #c4a36a30;clip-path:polygon(0 0,25% 0,25% 1px,75% 1px,75% 0,100% 0,100% 100%,75% 100%,75% calc(100% - 1px),25% calc(100% - 1px),25% 100%,0 100%);}
.hub-main {max-width:390px;gap:28px;padding:22px 0;}
.hub-logo .crest {width:68px;height:68px;margin-bottom:14px;}
.hub-logo h1 {font-size:clamp(52px,6.2vw,88px);font-weight:bold;letter-spacing:5px;}
.hub-logo h1 em {letter-spacing:12px;color:#e9cf91;text-shadow:0 2px 0 #786035,0 6px 22px #000;}
.hub-logo p {font-size:10px;letter-spacing:3px;line-height:1.8;color:#becbd0;}
.hub-menu {gap:8px;}
.hub-btn {position:relative;background:linear-gradient(105deg,#20303be8,#101c26de);border-color:#a58b5260;min-height:52px;box-shadow:inset 0 1px #e8dbb11c;letter-spacing:2px;}
.hub-btn::before {content:'';position:absolute;left:0;top:12px;bottom:12px;width:3px;background:#b49a62;box-shadow:0 0 14px #d8bd7466;}
.hub-btn:hover {background:linear-gradient(100deg,#344856,#13252f);}
.hub-btn.primary {min-height:80px;border:1px solid #fff0b8;box-shadow:inset 0 0 0 4px #6d542f55,0 6px 25px #0008;animation:riseIn .5s .12s both;}
.hub-btn.primary .game-icon {filter:brightness(.23);width:27px;height:27px;}
.hub-btn.primary::before {display:none;}
.hub-profile,.hub-quick button {background:linear-gradient(#22333be8,#101b26f2);border-radius:0;border-color:#98825480;box-shadow:inset 0 0 0 3px #070e1555;}
.hub-foot {color:#b8b7a5;font-size:9px;}
.pstep {background:linear-gradient(#08121ae8,#08121af5),url('assets/arena-menu-v2.jpg') center/cover;}
.pstep-head {border-bottom-color:#ac8f4f66;padding-top:6px;}
.pstep-head h2 {font-weight:bold;letter-spacing:3px;}
.mode-tile {border-radius:2px;border:1px solid #9d885c88;box-shadow:inset 0 0 0 4px #060e16,0 20px 38px #0007;padding:28px;}
.mode-tile::before {inset:5px;opacity:.8;}
.mode-tile::after {inset:5px;background:linear-gradient(0deg,#06101b 5%,#07121cc9 35%,#07121c10 90%);}
.mode-tile .ico {width:56px;height:56px;display:grid;place-items:center;border:1px solid #d8bd7477;background:#0b1824b8;transform:rotate(45deg);margin-bottom:12px;}
.mode-tile .ico .game-icon {width:31px;height:31px;transform:rotate(-45deg);}
.mode-tile h3 {font-weight:bold;letter-spacing:2px;}
.pstep .agent {border-color:#8f7b5366;box-shadow:inset 0 0 0 4px #050f16,0 12px 35px #0008;border-radius:1px;}
.pstep .agent.sel {box-shadow:inset 0 0 0 2px var(--ac),0 0 25px color-mix(in srgb,var(--ac) 25%,transparent);}
.agent .role {display:flex;align-items:center;gap:8px;}.agent .role .game-icon {width:19px;height:19px;}
.agent li .game-icon {width:12px;height:12px;}
.agent-index {background:#08121be6;border-color:#bea15a99;min-width:30px;text-align:center;}
.agent h3 {text-transform:uppercase;font-weight:bold;font-size:29px;letter-spacing:1px;}
.agent-choose {text-transform:uppercase;letter-spacing:1px;}
.lockbar {border-top:1px solid #b69c6266;box-shadow:0 -10px 40px #0008;}
.lock-btn {border-radius:0;box-shadow:inset 0 0 0 3px #080f1433;}
/* The boardwrap geometry stays exact; decoration belongs to the parent. */
.arena-plinth {border-color:#c3a76a;background:linear-gradient(135deg,#d2ba7d,#384b4e 6%,#101f28 20%,#101b24 75%,#807044 94%,#d2ba7d);border-radius:2px;box-shadow:0 18px 44px #000c,0 0 45px #3b969b18,inset 0 0 0 3px #08111b,inset 0 0 0 4px #c5a96899,inset 0 0 0 7px #0c1720;}
.arena-plinth::before,.arena-plinth::after {content:'';width:17px;height:17px;top:1px;left:1px;border-top:3px solid #f1d89c;border-left:3px solid #f1d89c;filter:drop-shadow(0 1px 2px #000);}
.arena-plinth::after {top:auto;left:auto;right:1px;bottom:1px;transform:rotate(180deg);}
.sq.l {background:linear-gradient(130deg,#c8c5ac,#a9b09b 65%,#bbc0a7);}
.sq.d {background:linear-gradient(135deg,#3b5e66,#213c49);}
.board {box-shadow:inset 0 0 25px #0008;}
.tok {filter:drop-shadow(2px 5px 2px #0009);}
.section-label {color:#c6b88f;font-weight:700;letter-spacing:1.7px;}
.bar {background:linear-gradient(115deg,#253743eb,#101c28f5);border:1px solid #9b84515e;border-left:3px solid var(--ac,#bea263);border-radius:1px;box-shadow:inset 0 1px #f2db9b10,0 5px 14px #0005;}
.avatar {border:1px solid #d4ba82;box-shadow:0 0 0 2px #060e16;}
.player-identity b {font-weight:bold;letter-spacing:.5px;}.player-role {display:block;margin-left:0;margin-top:3px;font-size:8px;letter-spacing:1px;text-transform:uppercase;}
.turn-strip {background:linear-gradient(100deg,#24403d,#142a30);border:1px solid #72b7a070;border-left:3px solid #84d9bd;box-shadow:inset 0 0 15px #4fc6ac0a;}
.status {font-weight:600;line-height:1.5;}
.ab {position:relative;isolation:isolate;border:1px solid #7a8e9366;border-radius:2px;background:linear-gradient(130deg,#243e4c,#102330);box-shadow:inset 0 0 0 3px #07141d55,0 5px 10px #0004;overflow:hidden;}
.ab .ability-emblem {display:flex;width:32px;height:32px;align-items:center;justify-content:center;border:1px solid #c7bc8b55;background:#091722;float:left;margin:0 8px 5px 0;}
.ab .ability-emblem .game-icon {width:22px;height:22px;}
.ab b {color:#e8e1c8;font-weight:bold;}
.ab .meta {line-height:1.5;}
.ab.ult {background:linear-gradient(110deg,#493a25,#1d2834);border-color:#c5a75c80;}
.ab.off {opacity:.63;filter:saturate(.65);}
.ab:not(.off):hover,.ab.sel {border-color:#9de9df;box-shadow:inset 0 0 18px #48cab21a,0 0 12px #48cab222;}
.ab.ult.ready {border-color:#ebcd83;box-shadow:inset 0 0 22px #d8ad3430,0 0 16px #d8ad3422;}
.card {border-radius:3px;border-color:#b7a675;background:linear-gradient(120deg,#374250,#172733);}
.card::before {border-color:#d9c69055;inset:3px;}
.card-art {border-bottom:2px solid #b69b60;}
.card .cost {clip-path:polygon(50% 0,100% 20%,100% 80%,50% 100%,0 80%,0 20%);background:linear-gradient(135deg,#e4d39a,#806335);color:#07131b;font-weight:bold;}
.card .nm {font-weight:bold;color:#fff0cd;}
.card.off {opacity:.75;filter:saturate(.65);}
.back {background:radial-gradient(ellipse,#a68d4d55,transparent 65%),url('assets/crest.svg') center/70% no-repeat,#112735;border-color:#ad935e;box-shadow:inset 0 0 0 2px #08131d,inset 0 0 0 3px #ad935e66;}
.log {background:#07131c99;border-left:1px solid #9d87544d;padding:8px 10px;}
.mobile-nav {background:linear-gradient(#20313e,#0c1924);border-top-color:#9d8754;}
.mobile-nav .game-icon {width:23px;height:23px;}
@media(min-width:741px) {
 .side .ab {min-height:94px;line-height:1.5;}.side .ab.ult {min-height:86px;}
 .main .hand-section {position:relative;}.main .hand-section::before {content:'';position:absolute;inset:21px -12px 0;background:radial-gradient(ellipse at 50% 100%,#517c852c,transparent 75%);pointer-events:none;}
}
@media(max-width:740px) {
 .hub {padding: max(20px,env(safe-area-inset-top)) 24px max(24px,env(safe-area-inset-bottom));}
 .hub-bg {background-position:65% 20%;}.hub::before {background:linear-gradient(0deg,#050d17 10%,#050d17d9 45%,#050d1733 80%,#050d1755);}
 .hub-main {max-width:none;gap:20px;}.hub-logo .crest {display:none;}.hub-logo h1 {font-size:48px;}.hub-logo h1 em {display:inline;margin-left:8px;letter-spacing:3px;}
 .hub-logo p {font-size:9px;letter-spacing:1.6px;}.hub-btn.primary {min-height:70px;}
 .hub-profile {padding:6px;gap:7px;}.hub-profile button {padding:6px;}.hub-profile small {font-size:8px;letter-spacing:.3px;}.hub-quick {gap:5px;}.hub-quick button {width:38px;height:40px;}
 .mode-tile {padding:18px 20px 18px 94px;min-height:160px;}.mode-tile .ico {position:absolute;left:25px;bottom:45px;width:40px;height:40px;margin:0;}.mode-tile .ico .game-icon {width:25px;height:25px;}
 .mode-tile h3 {font-size:23px;}.mode-tile .chips span {padding:7px 9px;letter-spacing:1px;}
 .pstep-head h2 {letter-spacing:1px;}.pstep-head h2 small {letter-spacing:1px;line-height:1.6;}
 .arena-plinth::before,.arena-plinth::after {width:10px;height:10px;border-width:2px;}
 .ab .ability-emblem {width:29px;height:29px;}.side .player-role {display:inline;margin-left:6px;}
 .card-detail {background:linear-gradient(140deg,#29424e,#0b1a28);border-color:#cfb777;box-shadow:0 -15px 60px #000c,inset 0 3px #d7bf7944;}
}
@media(max-height:650px) and (min-width:741px) {.hub-main {gap:16px;}.hub-logo .crest {display:none;}.hub-logo h1 {font-size:48px;}.hub-btn {min-height:44px;}.hub-btn.primary {min-height:62px;}}
.side .player-role {display:block;margin:3px 0 0;}
.ult-pips {display:inline-flex;gap:4px;vertical-align:middle;letter-spacing:0;}
.ult-pips i {display:block;width:5px;height:10px;border:1px solid #bda56880;background:#07141b;transform:skew(-12deg);}
.ult-pips i.charged {background:#eed08a;border-color:#fff1bc;box-shadow:0 0 6px #f1cb6c66;}
@media(max-width:740px) {#oppbar .player-role {display:inline;margin-left:6px;}.ult-pips {gap:3px;}.ult-pips i {width:4px;height:8px;}}
@media(min-width:741px) {
 .agents-step {height:100dvh;min-height:0;}
 .pstep.agents-step .pstep-body {min-height:0;padding:18px 0;}
 .agents-step .agents {min-height:0;}
 .agents-step .agent {overflow-y:auto;scrollbar-width:thin;scrollbar-color:#9d8754 transparent;}
 .agents-step .agent-art {height:clamp(110px,28dvh,285px);}
 .agents-step .agent-copy {padding:0 14px 12px;}
 .agents-step .agent h3 {font-size:clamp(21px,2.7vw,30px);margin-bottom:8px;}
 .agents-step .agent p {min-height:28px;margin-bottom:10px;}
 .agents-step .agent li.u {min-height:54px;padding-top:7px;}
 .agents-step .agent-choose {margin-top:10px;padding-top:9px;}
 .agents-step .lockbar {flex-shrink:0;}
}
@media(max-width:740px) {
 .mobile-nav button {border-radius:2px;gap:7px;}
 .mobile-nav button>span[data-i18n] {font:700 10px/1 Arial,Helvetica,sans-serif;letter-spacing:1px;text-transform:uppercase;}
 .mobile-nav button[aria-pressed='true'] {background:linear-gradient(#53605d55,#ba9b4822);box-shadow:inset 0 2px #e0c28b,inset 0 0 0 1px #d8bb7b33;}
 .mobile-nav button:not([aria-pressed='true']) .game-icon {opacity:.55;}
}
/* Landscape phones use a wide viewport but the same game navigation. */
.mobile-nav button>span[data-i18n] {font:700 10px/1 Arial,Helvetica,sans-serif;letter-spacing:1px;text-transform:uppercase;}
.mobile-nav button {border-radius:2px;}
.mobile-nav button[aria-pressed='true'] {background:linear-gradient(#53605d55,#ba9b4822);box-shadow:inset 0 2px #e0c28b,inset 0 0 0 1px #d8bb7b33;}
.mobile-nav button:not([aria-pressed='true']) .game-icon {opacity:.55;}

/* MadChess: cursor feedback follows available actions, not decorative surfaces. */
body {cursor:default;}
button:disabled, .lock-btn:disabled, .sheet-use:disabled, .mode-tile.off, .ab.off {cursor:default;}
.sq {cursor:default;}
.sq.own, .sq.tgt {cursor:pointer;}
@media(min-width:741px) and (min-height:561px) {
 .card.off {cursor:help;}
}
/* A mobile card always opens its details, even when it cannot be played. */
@media(max-width:740px), (max-height:560px) and (orientation:landscape) {
 .card.off {cursor:pointer;}
}
.hub-logo h1 em {letter-spacing:6px;}
@media(max-width:740px) {
 .hub-logo h1 {font-size:clamp(34px,10.5vw,48px);white-space:nowrap;letter-spacing:1px;}
 .hub-logo h1 em {margin-left:0;letter-spacing:1px;}
}
/* Hide the native pointer only while idle; pointer movement restores it immediately. */
@media(hover:hover) and (pointer:fine) {
 body[data-pointer-idle='true'], body[data-pointer-idle='true'] * {cursor:none!important;}
}
