/* Shared application chrome. Board geometry and ownership colors stay in the board styles. */
@font-face{font-family:'Rift Shell';src:url('/modern/fonts/barlow-regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:'Rift Shell';src:url('/modern/fonts/barlow-semibold.ttf') format('truetype');font-weight:600 900;font-display:swap}
@font-face{font-family:'Rift Heading';src:url('/modern/fonts/cinzel.ttf') format('truetype');font-weight:400 900;font-display:swap}
:root{--shell-bg:#080f18;--shell-panel:#101d2a;--shell-raised:#172938;--shell-line:#2a4050;--shell-text:#edf3f5;--shell-muted:#a4b7c6;--shell-teal:#80dfd0;--shell-gold:#e6c58b;--shell-font:'Rift Shell','Segoe UI',sans-serif;--shell-heading:'Rift Heading',Georgia,serif;--shell-arena:url('/modern/assets/generated-v9/rift-terrace.png');--shell-workshop:url('/modern/assets/generated-v9/arcane-workshop.png')}
.app-shell{--paper:var(--shell-bg);--ink:var(--shell-text);--muted:var(--shell-muted);--line:var(--shell-line);--white:var(--shell-panel);--panel:var(--shell-panel);--green:var(--shell-teal);--lime:var(--shell-teal);--gold:var(--shell-gold);font:16px/1.5 var(--shell-font);color:var(--shell-text)}
.app-shell:not(.immersive){background:radial-gradient(ellipse at 80% 0,#17344366,transparent 50%),var(--shell-bg);min-height:100dvh}
.app-shell :is(button,input,select,textarea){font-family:var(--shell-font)}
.app-shell :is(button,.button){text-decoration:none;transition:background .16s,border-color .16s,box-shadow .16s}
.app-shell :is(input,select,textarea){background:#0b1621;color:var(--shell-text);border:1px solid #395162;border-radius:8px;padding:11px 12px}
.app-shell :is(input,textarea)::placeholder{color:#91a6b8}
.app-shell :is(input[type=checkbox],input[type=range]){accent-color:var(--shell-teal)}
.app-shell :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--shell-teal);outline-offset:4px}
.app-shell :is(h1,h2){color:var(--shell-text)}
.app-shell .primary{background:linear-gradient(125deg,#a2eddd,#66cdbc);color:#08251f;border:1px solid #a2eddd;box-shadow:0 4px 18px #4fbdad14;font-weight:700}
.app-shell .primary:hover:not(:disabled){background:#b9f4e7;box-shadow:0 4px 24px #4fbdad30;filter:none}
.app-shell :is(.secondary,.button.secondary,.card-add){background:#1a2d3c;border:1px solid #3a5365;color:#e0edf4}
.app-shell :is(.secondary,.card-add):hover:not(:disabled){background:#264153;border-color:#78a0b0;filter:none}
.app-shell .danger{background:#3b222c;color:#ffc5c1;border-color:#8a4953}
.app-shell .icon{color:var(--shell-teal)}
.app-shell .eyebrow{color:var(--shell-gold);font:600 11px/1.5 var(--shell-font);letter-spacing:.16em}
.app-shell .fine,.app-shell .filterline{color:var(--shell-muted);font-size:12px}
.app-shell>header{min-height:80px;padding:14px max(24px,calc((100vw - 1400px)/2));background:#0a131ee8;border-bottom:1px solid #263b49;gap:24px}
.app-shell .brand{font-size:25px;color:var(--shell-teal);letter-spacing:.08em;gap:12px}
.app-shell .brand .soft{color:var(--shell-text);font-weight:600}
.app-shell .brand small{color:var(--shell-muted);font-size:9px;letter-spacing:.13em;border-color:var(--shell-line)}
.app-shell nav[aria-label="Main navigation"]{align-self:stretch;align-items:center;gap:8px}
.app-shell .nav{font-size:15px;color:var(--shell-muted);padding:12px 20px;border:1px solid transparent;border-radius:8px}
.app-shell .nav.active{background:#17352f;color:#baf3e5;border-color:#315d54;box-shadow:none}
.app-shell .edition{font-size:10px;color:#a6bfc9;letter-spacing:.12em}
.app-shell .edition::before{content:'';display:inline-block;width:6px;height:6px;background:var(--shell-teal);border-radius:50%;margin-right:9px}
.app-shell:not(.immersive)>main{max-width:1448px;padding:28px 24px 48px;margin:auto}
.app-shell:not(.immersive)>main:has(>#build:not([hidden])){max-width:none;width:100%;padding-inline:clamp(12px,1.5vw,32px)}
.app-shell .skip-link{position:fixed;top:8px;left:8px;z-index:9999;transform:translateY(-160%);background:var(--shell-teal);color:#08251f;padding:12px;border-radius:8px}
.app-shell .skip-link:focus{transform:none}
.app-shell #notice:not(:empty){background:#18332f;border-color:#46766b;color:#d6fff0;font-size:15px}
.app-shell:not(.immersive) #play:not([hidden]){display:grid;grid-template-columns:minmax(300px,.78fr) minmax(0,1.22fr);gap:24px;align-items:start}
.lobby-hero{grid-column:1/-1;position:relative;isolation:isolate;overflow:hidden;border:1px solid #385363;border-radius:18px;min-height:250px;padding:38px 40px;background:linear-gradient(90deg,#07131bef 0%,#091822aa 42%,#09182208 78%),var(--shell-arena) center/cover,#102432}
.lobby-hero h1{font:600 clamp(28px,3.2vw,46px)/1.2 var(--shell-heading);letter-spacing:-.025em;margin:12px 0;color:#f4eee0;max-width:620px}
.lobby-hero p{max-width:430px;font-size:16px;color:#c0d2dc;margin:0}
.hero-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}
.hero-tags span{padding:5px 10px;border:1px solid #6a8b944a;border-radius:5px;font-size:11px;color:#c9dce2;letter-spacing:.06em;background:#0c1c2580}
.app-shell #resume-match{grid-column:1/-1;display:flex;align-items:center;gap:18px;padding:16px 22px;background:linear-gradient(100deg,#16372f,#11252c);border:1px solid #356155;border-radius:12px}
.app-shell #resume-match h2{font:600 17px var(--shell-font);margin:0;color:#d2f4e8}
.app-shell #resume-match p{margin:0;font-size:13px}
.app-shell #resume-match .primary{width:auto;margin-left:auto;white-space:nowrap;font-size:14px}
.app-shell #resume-room-code{font-weight:600;letter-spacing:.08em;color:#d1e3e9}
.app-shell :is(#deck-picker,#lobby){margin:0;padding:24px;background:linear-gradient(145deg,#142433,#0f1b27);border:1px solid var(--shell-line);border-radius:16px;box-shadow:0 12px 40px #0002}
.app-shell #play>.lobby-hero{order:0}
.app-shell #play>#resume-match{order:1}
.app-shell #play>#deck-picker{grid-column:1;order:2}
.app-shell #play>#lobby{grid-column:2;order:3}
.app-shell #play>#room{order:4}
.app-shell .picker-heading{align-items:flex-start;gap:14px}
.app-shell .picker-heading h2{font:600 25px/1.2 var(--shell-font);margin:0 0 8px;letter-spacing:-.02em}
.app-shell .picker-heading p{color:var(--shell-muted);font-size:14px}
.app-shell .picker-heading .secondary{padding:8px 12px;white-space:nowrap;font-size:13px;min-height:40px}
.app-shell #picked-deck{flex-direction:column;align-items:stretch;background:radial-gradient(ellipse at 50% 0,#32576c75,transparent 70%),#0a1621;border:1px solid #355060;border-radius:12px;padding:22px;margin:22px 0 18px;gap:22px}
.app-shell #picked-deck .picked-art{justify-content:center;gap:18px}
.app-shell #picked-deck .picker-card{width:clamp(90px,9vw,140px);color:#b9cbd6}
.app-shell .picker-card img{box-shadow:0 12px 24px #0006;border-radius:7px}
.app-shell .picker-card:hover img{box-shadow:0 8px 24px #72d6c32b}
.app-shell #picked-deck h3{font:600 23px/1.25 var(--shell-font);color:#f3e5c9;margin:8px 0}
.app-shell #picked-deck p{font-size:13px;color:#b1c6d3;line-height:1.65;margin:8px 0 12px}
.app-shell #picked-deck small{color:#bacbd6;font-size:12px}
.app-shell #picked-deck .eyebrow{color:var(--shell-teal);font-size:10px}
.app-shell :is(#deck-picker summary,.ai-search-control summary){color:#d9e9ee;font-size:14px}
.app-shell #deck-library summary span{display:block;margin:3px 0 0 17px;font-size:12px}
.app-shell .deck-tile{background:#142636;border:1px solid #355060;color:var(--shell-text);border-radius:8px}
.app-shell .deck-tile:hover{background:#1d3947;border-color:#80baad}
.app-shell .deck-tile.picked{background:#1b3b36;border-color:#80dfd0;box-shadow:inset 0 0 0 1px #80dfd050}
.app-shell .deck-tile-select>strong{color:#e9f3f4}
.app-shell .deck-tile-select>small,.app-shell .deck-tile-select>span:not(.tile-art){color:#adc1cf}
.app-shell #player-record{color:#bed1d9}
.app-shell #player-record strong{color:var(--shell-teal)}
.app-shell .play-mode-sections{grid-template-columns:1fr 1fr;gap:12px;margin:22px 0}
.app-shell .play-mode-section:has(#standard-play-title){grid-column:1 / -1}
.app-shell .play-mode-section{background:#0a1621;border:1px solid #304957;border-radius:12px;padding:16px}
.app-shell .play-mode-section h3{color:#edf3f5;font-size:18px;margin:0 0 6px}
.app-shell .play-mode-section>p{color:var(--shell-muted);font-size:12px;min-height:36px}
.app-shell .play-mode-section:has(button[aria-pressed=true]){border-color:#60b3a1;background:linear-gradient(145deg,#15332e,#0d1d26)}
.app-shell .play-mode-section .play-modes{grid-template-columns:1fr;gap:8px;margin-top:12px}
.app-shell .play-modes button{color:#c1d3dd;border:1px solid #365161;font-size:14px;background:#152533;min-height:42px}
.app-shell .play-modes button[aria-pressed=true]{color:#c8ffee;border-color:#73cbbb;background:#26554b;box-shadow:none}
.app-shell .play-modes button[aria-pressed=true]::before{content:'\2713';margin-right:7px;font-weight:700}
.app-shell .match-settings{gap:16px}
.app-shell .match-settings label,.app-shell .play-panel label{font-size:13px;color:#d6e3e9}
.app-shell .play-panel{margin-top:20px;padding-top:20px;border-color:var(--shell-line)}
.app-shell .play-panel h3{color:#eef4f4;font:600 23px/1.3 var(--shell-font)}
.app-shell .play-panel p{color:var(--shell-muted);font-size:14px;margin-bottom:16px}
.app-shell .play-panel>.primary{margin-top:20px;min-height:48px;font-size:16px}
.app-shell .play-panel .fine{font-size:12px}
.app-shell .lobby-footer{border-color:var(--shell-line);margin-top:20px;padding-top:16px}
.app-shell .lobby-footer strong{color:#d7e5eb}
.app-shell #play:has(>#room:not([hidden])){grid-template-columns:1fr}
.app-shell #play:has(>#room:not([hidden]))>.lobby-hero,.app-shell.immersive .lobby-hero{display:none}
.app-shell #room{min-width:0}
.app-shell .room-top{padding:24px;border:1px solid #36525e;border-radius:14px;background:linear-gradient(90deg,#0c1b28f5,#0c1b28b0),var(--shell-arena) center/cover}
.app-shell .room-top h2{font:600 28px var(--shell-font)}
.app-shell #connection{color:var(--shell-teal)}
.app-shell #waiting{background:#10202d;border:1px solid var(--shell-line);border-radius:16px;padding:24px}
.app-shell #room-deck-picker #deck-picker{margin:0 0 24px;box-shadow:none}
.app-shell #room-deck-picker #picked-deck{flex-direction:row;align-items:center}
.app-shell .room-status-actions .primary{width:auto;min-width:210px}
.app-shell #build>.intro{min-height:220px;padding:32px 36px;margin:0 0 24px;align-items:center;border:1px solid #385363;border-radius:18px;background:linear-gradient(90deg,#091722f5,#091722a0 60%,#09172250),var(--shell-workshop) center/cover,#102432}
.app-shell #build h1{font:600 clamp(27px,3vw,40px)/1.25 var(--shell-heading);letter-spacing:-.025em;margin:12px 0}
.app-shell #build .intro p{color:#b9cdd7;font-size:15px}
.app-shell #build .intro .primary{flex-shrink:0}
.app-shell .workshop{grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
.app-shell .library{min-width:0}
.app-shell .builder-import{margin:0 0 24px;padding:16px 20px;background:#132332;border:1px solid var(--shell-line);border-radius:12px}
.app-shell .builder-import>summary{cursor:pointer;color:var(--shell-teal);font-size:17px;font-weight:600}
.app-shell .builder-import>summary span{display:inline-block;margin-left:12px;color:var(--shell-muted);font-size:13px;font-weight:400}
.app-shell .builder-import>input{display:block;width:100%;max-width:520px}
.app-shell .builder-import>textarea{max-width:800px}
.app-shell .toolbar{padding:14px;background:#132332;border:1px solid var(--shell-line);border-radius:12px}
.app-shell .toolbar input{font-size:16px}
.app-shell .filterline{padding:0 4px;gap:12px;align-items:center;font-size:13px}
.app-shell .card-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:16px}
.app-shell .library :is(.card,.illustrated.card){background:#112331;border:1px solid #304857;border-radius:10px;box-shadow:0 5px 18px #0003;min-height:0}
.app-shell .library .card:hover{border-color:#75a69f}
.app-shell .library .card h3{font:600 16px/1.25 var(--shell-font);color:#edf3f5}
.app-shell .library .card-bottom{color:#b2c8d4;font-size:12px;gap:6px;flex-wrap:wrap}
.app-shell .library .card-add{font-size:12px;min-height:32px}
.app-shell .library .card-remove{font-size:12px;min-height:32px;padding:5px 11px}
.app-shell .deckpanel{background:#11212e;border:1px solid #36515f;border-radius:14px;padding:22px;position:static;max-height:none;overflow:visible}
.app-shell .deck-name{font:600 26px/1.3 var(--shell-font);background:transparent;border:0;border-bottom:1px solid var(--shell-line);border-radius:0;color:#eff4f4;padding:12px 0}
.app-shell .deck-tools{display:flex;flex-direction:column;gap:12px}
.app-shell .deck-tools select{font-size:13px}
.app-shell .intro-actions{display:flex;align-items:center;gap:12px;flex-shrink:0;flex-wrap:wrap}
.app-shell #new-deck{display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:48px;padding:12px 22px;font-size:17px;line-height:1.2;border-radius:10px}
.app-shell #new-deck span{font-size:22px;line-height:0;margin-right:9px}
.app-shell .deck-row{border-color:var(--shell-line);font-size:13px;padding:8px 0}
.app-shell .deck-row button{color:#a5e4d5;min-width:28px;min-height:28px}
.app-shell .deck-section{color:#a4bac8;font-size:11px}
.app-shell .pill{background:#21453d;border-color:#467367;color:#c6f1df}
.app-shell .sleeve-editor,.app-shell #playmat-editor{border-color:var(--shell-line)}
.app-shell #deck-appearance{border:1px solid var(--shell-line);border-radius:9px;padding:12px;margin:18px 0 0}
.app-shell #deck-appearance>summary{cursor:pointer;color:#d5e8ec;font-size:14px;font-weight:600}
.app-shell #deck-appearance>summary span{display:block;margin:3px 0 0 16px;color:var(--shell-muted);font-size:12px;font-weight:400}
.app-shell .deck-actions{position:static;margin:16px -4px 0;padding:12px 4px;background:#11212ef5;z-index:2}
.app-shell .deck-actions :is(button,.button){min-height:40px;font-size:13px}
.app-shell :is(#table-drawer,#card-inspector,#table-chat){background:#10202d;color:var(--shell-text);border:1px solid #456172;border-radius:14px;box-shadow:0 24px 80px #0008}
.app-shell #table-drawer{background:linear-gradient(#0c1b2aeb,#0c1b2afc),var(--shell-workshop) top/auto 230px no-repeat;max-height:90dvh;overflow:auto}
.app-shell dialog::backdrop{background:#030a13bb}
.app-shell:not(.immersive)>footer{max-width:1400px;margin:0 auto;padding:24px 0 32px;border-color:var(--shell-line);color:#9cb2c0;font-size:10px;gap:20px}
.app-shell.immersive #game-hud{background:#0d1d2cf2;border-color:#395463}
.app-shell.immersive #game-hud #quick-pass{background:#25564b;border-color:#6cc4b2;color:#d7ffef}
.app-shell.immersive #table-guide{background:#0c1a27;color:#cbdce5}
.app-shell .decision-panel{background:#112331;border-color:#36515f}
/* Modern match menus and support screens share the lobby's material and type. */
.match-shell #devbar{background:#0b1825;border-bottom-color:#34505f;font-family:var(--shell-font)}
.match-shell .devbar__brand{color:var(--shell-teal);letter-spacing:.08em}
.match-shell .devbar__legacy{color:#cef4e9;border-color:#3a675e;background:#17352f}
.match-shell :is(#game-menu.table-menu,#modern-sideboard,#modern-reveal){background:linear-gradient(#0d1d2aee,#0d1d2afd),var(--shell-workshop) center top/cover;border:1px solid #486575;border-radius:16px;color:var(--shell-text);font-family:var(--shell-font)}
.match-shell #game-menu.table-menu summary{color:#d7ecef}
.match-shell #game-menu.table-menu details{border-color:#344e5e;background:#12283999}
.match-shell #game-menu.table-menu button{background:#1a3241;border-color:#4a6675;color:#e2eff2;border-radius:8px}
.match-shell #game-menu.table-menu .menu-danger{background:#3b222c;border-color:#8a4953;color:#ffc5c1}
.match-shell #game-menu.table-menu :is(input,select){background:#0a1722;border-color:#3e5b6a;color:#e4eff4}
.match-shell :is(#game-menu,#modern-sideboard,#modern-reveal) h2{color:#f1e4c9}
.match-shell #gameover .end-summary{padding:18px;border:1px solid #3c5465;border-radius:14px;background:#0b1b29e8}
.lab-shell #bar{background:#101e2b;border-color:#324b5c;padding:14px;gap:12px 16px;font-family:var(--shell-font)}
.lab-shell #bar :is(label,output){color:#bdd0dc}
.lab-shell #bar :is(button,select){background:#1b3040;border-color:#456171;color:#e4eff3;min-height:36px}
.lab-shell #bar button.primary{background:var(--shell-teal);color:#08251f}
.lab-shell #stage{background:linear-gradient(#081521dc,#081521f5),var(--shell-arena) center/cover}
.lab-shell .brand{color:var(--shell-teal)}
.lab-shell #status{background:#0c1925;color:#c1d3dd;border-color:#36515f}
@media(min-width:1500px){.app-shell .library .card-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1050px){.app-shell>header{padding:14px 24px}.app-shell .edition{display:none}.app-shell .workshop{grid-template-columns:minmax(0,1fr) 310px}.app-shell .play-mode-sections{grid-template-columns:1fr}.app-shell .play-mode-section>p{min-height:0}.app-shell .play-mode-section .play-modes{grid-template-columns:1fr 1fr}.app-shell #build>.intro{padding:28px;flex-wrap:wrap}.app-shell:not(.immersive)>footer{margin:0 24px}}
@media(max-width:760px){.app-shell:not(.immersive) #play:not([hidden]){grid-template-columns:1fr;gap:18px}.app-shell #play>#deck-picker,.app-shell #play>#lobby{grid-column:1}.app-shell #picked-deck{flex-direction:row;align-items:center;gap:20px}.app-shell #picked-deck .picker-card{width:85px}.app-shell .picker-heading{flex-direction:row}.lobby-hero{min-height:220px;padding:28px;background-position:65% center}.lobby-hero h1{max-width:420px}.lobby-hero p{max-width:330px}.app-shell #resume-match{flex-wrap:wrap;gap:10px 16px}.app-shell #resume-match .primary{margin-left:auto}.app-shell .workshop{grid-template-columns:1fr}.app-shell .deckpanel{position:static;max-height:none;grid-row:auto}.app-shell .deckpanel #deck-list{max-height:none;overflow:visible}.app-shell .deck-actions{position:static}.app-shell .library{order:2}.app-shell .deckpanel{order:1}.app-shell .library .card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.app-shell .room-top{flex-wrap:wrap}.app-shell #room-deck-picker #picked-deck{flex-direction:column;align-items:stretch}}
@media(max-width:480px){.app-shell>header{padding:16px;gap:12px;flex-wrap:wrap}.app-shell .brand{font-size:23px}.app-shell .brand small{display:block}.app-shell nav[aria-label="Main navigation"]{width:100%;margin:0;display:grid;grid-template-columns:1fr 1fr}.app-shell .nav{padding:10px;font-size:14px}.app-shell:not(.immersive)>main{padding:16px 14px 32px}.lobby-hero{padding:26px 22px;background-position:60% center}.lobby-hero h1{font-size:28px}.lobby-hero p{font-size:14px;max-width:255px}.hero-tags{gap:5px;margin-top:18px}.hero-tags span{font-size:10px;padding:4px 7px}.app-shell :is(#deck-picker,#lobby,#waiting){padding:18px}.app-shell #picked-deck{flex-direction:column;align-items:stretch;padding:18px}.app-shell #picked-deck .picker-card{width:clamp(80px,25vw,110px)}.app-shell .match-settings{grid-template-columns:1fr}.app-shell #resume-match .primary{margin:4px 0 0;width:100%;text-align:center}.app-shell .picker-heading h2{font-size:23px}.app-shell #build>.intro{padding:24px 20px}.app-shell #build .intro .primary{width:100%}.app-shell .library .card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.app-shell .toolbar{padding:10px;gap:8px;flex-wrap:wrap}.app-shell .toolbar input{flex-basis:100%}.app-shell .toolbar select{width:100%;max-width:none}.app-shell .filterline{font-size:12px;align-items:flex-start}.app-shell:not(.immersive)>footer{margin:0 14px;flex-direction:column;gap:8px}.app-shell .room-top{padding:18px}.app-shell .room-status-actions .primary{width:100%;margin-bottom:0}}
@media(prefers-reduced-motion:reduce){.app-shell :is(button,.button){transition:none}}

.app-shell .art-preference{padding:18px 22px;margin:0 0 20px;background:#102c2a;border:1px solid #4c9a86;border-radius:12px}
.art-preference label{display:flex;align-items:center;gap:12px;cursor:pointer;flex-wrap:wrap}
.art-preference input[role=switch]{appearance:none;width:44px;height:26px;min-width:44px;border:1px solid #71857d;border-radius:20px;background:#293b36;padding:3px;cursor:pointer;margin:0}
.art-preference input[role=switch]::before{content:'';display:block;width:18px;height:18px;background:#c5d2cd;border-radius:50%;transition:transform .15s}
.art-preference input[role=switch]:checked{background:#4ca78b}
.art-preference input[role=switch]:checked::before{transform:translateX(18px);background:#fff}
.art-preference .art-state{font-size:12px;color:#a9efdb;border:1px solid #4c9a86;border-radius:20px;padding:3px 9px}
.art-preference p{margin:10px 0 5px;color:#dae9e3}
.art-preference small{color:#b1c8be}

.app-shell .play-mode-section .standard-queues{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:480px){.app-shell .play-mode-section .standard-queues{grid-template-columns:1fr}}

/* Guided deck workshop */
.app-shell .deck-guide{margin:0 0 24px;padding:24px;border:1px solid #395162;border-radius:14px;background:#11212e}
.app-shell .builder-steps{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:8px;margin-bottom:24px}
.app-shell .builder-steps button{min-height:52px;padding:10px;font-size:15px;white-space:normal}
.app-shell .builder-heading{display:flex;align-items:center;justify-content:space-between;gap:24px}
.app-shell .builder-heading h2{margin:0 0 8px;font-size:26px}
.app-shell .builder-heading p{margin:0 0 10px;color:var(--shell-muted);max-width:700px}
.app-shell .builder-heading strong{color:var(--shell-teal)}
.app-shell .builder-navigation{display:flex;gap:10px;flex-shrink:0}
.app-shell .builder-navigation button{min-height:48px;padding:12px 20px}
.app-shell .builder-warning{padding:14px;border:1px solid #b99555;border-radius:8px;color:#ffe0a4;background:#3b3020}
.app-shell .rune-allocation:not([hidden]){display:flex;flex-wrap:wrap;gap:16px;margin-top:20px}
.app-shell .rune-allocation p{flex-basis:100%;margin:0;font-weight:600}
.app-shell .rune-allocation label{display:flex;align-items:center;gap:16px;padding:16px;background:#0b1621;border:1px solid #395162;border-radius:10px}
.app-shell .rune-allocation input{width:80px;font-size:20px}
.app-shell .deck-guide button:disabled,.app-shell .card-add:disabled{opacity:.5;cursor:default}
@media(max-width:900px){.app-shell .builder-steps{grid-template-columns:repeat(3,minmax(0,1fr))}.app-shell .builder-heading{align-items:flex-start;flex-direction:column}}
@media(max-width:480px){.app-shell .deck-guide{padding:16px}.app-shell .builder-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.app-shell .builder-navigation{width:100%}.app-shell .builder-navigation button{flex:1}.app-shell .rune-allocation label{width:100%;justify-content:space-between}}
.app-shell .rune-allocation small{display:block;color:var(--shell-muted);margin-top:4px;font-size:13px}
@media(max-width:760px){.app-shell #build .library{order:1}.app-shell #build .deckpanel{order:2}}

.app-shell .library--appearance>:is(.toolbar,.filterline,#cards,#more){display:none}
.app-shell #builder-appearance #deck-appearance{margin:0;padding:24px;background:#11212e}
.app-shell #builder-appearance #deck-appearance>summary{font-size:22px}

/* Full-deck contact sheet. Nine steps read as an even 3x3 rather than 4+4+1. */
.app-shell .builder-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
.app-shell .workshop[hidden],.app-shell .deck-overview[hidden]{display:none}
.app-shell .deck-overview{padding:20px;margin-bottom:24px;border:1px solid #395162;border-radius:16px;background:linear-gradient(145deg,#142433,#0a131e);box-shadow:0 12px 40px #0004}
.app-shell .overview-title{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}
.app-shell .overview-title h2{margin:0;flex:1 1 auto;min-width:0;font-size:26px;overflow-wrap:anywhere}
.app-shell .overview-title p{margin:6px 0 0;color:var(--shell-muted)}
.app-shell .overview-name{font:inherit;color:inherit;width:min(460px,100%);max-width:100%;padding:2px 8px;margin:-2px -8px;background:transparent;border:1px solid transparent;border-radius:8px;cursor:text}
.app-shell .overview-name::placeholder{color:var(--shell-muted)}
.app-shell .overview-name:hover{border-color:#3f5f72;background:#ffffff08}
.app-shell .overview-name:focus{border-color:#a2eddd;background:#06131dcc}
.app-shell .overview-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.app-shell .overview-head h3{margin:0}
.app-shell .overview-sort{display:flex;align-items:center;gap:6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--shell-muted)}
.app-shell .overview-sort select{padding:5px 8px;font-size:12px;letter-spacing:normal;text-transform:none;border-radius:7px;border:1px solid #47657a;background:#081723;color:#dcebf3}
.app-shell .overview-actions{display:flex;gap:10px;flex-shrink:0}
.app-shell .overview-actions button{padding:12px 18px;min-height:44px}
.app-shell .deck-overview h3{margin:0 0 10px;font-size:14px;color:#e6c58b}
.app-shell .deck-overview h3 span{font-size:12px;font-weight:400;color:var(--shell-muted);margin-left:8px}
.app-shell .overview-main,.app-shell .overview-side{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:8px}
.app-shell .overview-card{display:block;position:relative;min-width:0;width:100%;aspect-ratio:5/7;padding:3px;border:1px solid #52616d;border-radius:9px;background:#060e16;overflow:hidden;box-shadow:0 2px 6px #0008;cursor:zoom-in}
.app-shell .overview-card img{display:block;width:100%;height:100%;object-fit:contain;border-radius:5px}
.app-shell .overview-card:hover{border-color:#a2eddd;box-shadow:0 0 0 2px #a2eddd55}
.app-shell .overview-card.overview-champion{border:3px solid #e6bd59;box-shadow:0 0 10px #e6bd5944}
.app-shell .overview-badge{position:absolute;bottom:4px;right:4px;background:#08111dee;color:#f4df9d;border:1px solid #a1884b;border-radius:4px;padding:2px 5px;font-size:clamp(9px,1vw,13px);font-weight:600}
.app-shell .overview-lower{display:grid;grid-template-columns:1fr 5fr;gap:12px;margin-top:18px}
.app-shell .overview-resources{display:grid;grid-template-columns:3fr 2fr;gap:12px;margin-bottom:14px}
.app-shell .overview-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.app-shell .overview-card.overview-field{aspect-ratio:7/5}
.app-shell .overview-runes{display:flex;gap:8px;flex-wrap:wrap}
.app-shell .overview-rune{max-width:70px}
.app-shell .overview-empty{grid-column:1/-1;color:var(--shell-muted);font-size:14px;padding:12px;margin:0;background:#ffffff05;border-radius:6px}
.app-shell .overview-missing{display:grid;place-items:center;height:100%;color:var(--shell-muted);font-size:12px}
.app-shell #view-full-deck{width:100%;min-height:44px;margin:0;font-size:15px}
.app-shell #view-full-deck[aria-expanded="true"]{border-color:#a2eddd;background:#23443f}
.app-shell #view-full-deck-hint{display:block;margin:5px 0 14px;color:var(--shell-muted);text-align:center}
.app-shell #builder-full-deck-popup{position:fixed;z-index:900;margin:0;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;pointer-events:auto;box-shadow:0 20px 80px #000c}
.app-shell #builder-full-deck-popup .overview-title{margin-bottom:14px}
.app-shell #builder-full-deck-popup .overview-title h2{font-size:21px}
.app-shell #builder-full-deck-dialog{margin:auto;width:min(1380px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);padding:24px;border:1px solid #567184;border-radius:16px;background:#101d2a;color:#edf3f5;box-shadow:0 24px 90px #0009;overflow:auto;overscroll-behavior:contain}
.app-shell #builder-full-deck-dialog::backdrop{background:#030910cc}
@media(max-width:760px){.app-shell .overview-main,.app-shell .overview-side{grid-template-columns:repeat(5,minmax(0,1fr))}.app-shell .overview-lower{grid-template-columns:1fr 3fr}.app-shell .overview-resources{grid-template-columns:1fr}.app-shell .overview-title{align-items:flex-start;flex-direction:column}.app-shell .overview-badge{font-size:10px}}
@media(max-width:480px){.app-shell .builder-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.app-shell .deck-overview{padding:12px}.app-shell .overview-main,.app-shell .overview-side{gap:5px}.app-shell .overview-lower{grid-template-columns:1fr}.app-shell .overview-legend>.overview-card{max-width:120px}.app-shell .overview-title h2{font-size:22px}.app-shell .overview-badge{font-size:8px;padding:1px 2px}}

/* Let library artwork define each card's shape without a surrounding panel. */
.app-shell .library #cards{align-items:start}
.app-shell .library #cards .card{background:transparent;border:0;border-radius:0;box-shadow:none;min-height:0;overflow:visible}
.app-shell .library #cards .art-button{background:transparent;border:0;border-radius:8px;padding:0;line-height:0}
.app-shell .library #cards .card-image{width:100%;height:auto;aspect-ratio:auto;object-fit:contain;border-radius:8px}
.app-shell .library #cards .card-body{padding:6px 0 0;flex:0;background:transparent}
.app-shell .library #cards .card-body h3,.app-shell .library #cards .card-bottom>span{display:none}
.app-shell .library #cards .card-bottom{justify-content:flex-end;margin:0}

/* Reserve image space so lazy-loaded cards never collapse before loading. */
.app-shell .library #cards .card-image{aspect-ratio:744/1039}
.app-shell .library #cards .card--battlefield .card-image{aspect-ratio:1039/744}

.app-shell .overview-zoom{position:fixed;z-index:1000;pointer-events:none;box-sizing:border-box;padding:4px;border:1px solid #a2eddd;border-radius:12px;background:#060e16;box-shadow:0 16px 60px #000c}
.app-shell .overview-zoom[hidden]{display:none}
.app-shell .picker-full-deck-actions{display:flex;justify-content:flex-end;margin-top:20px}
.app-shell :is(#picker-full-deck,.deck-tile-full-deck)[aria-pressed="true"]{border-color:#a2eddd;background:#23443f}
.app-shell #picker-full-deck-popup{position:fixed;z-index:900;left:50%;transform:translateX(-50%);width:min(1120px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;margin:0;box-shadow:0 20px 80px #000b}
.app-shell #picker-full-deck-close{flex-shrink:0}
.app-shell .overview-zoom img{display:block;width:100%;height:100%;object-fit:contain;border-radius:8px}

/* Play setup: deck, mode, and match settings remain readable at wide sizes. */
.app-shell:not(.immersive)>main:has(>#play:not([hidden])){max-width:1900px;padding:30px 32px 48px}
.app-shell:not(.immersive) #play:not([hidden]){grid-template-columns:minmax(340px,.72fr) minmax(0,1.8fr);gap:28px}
.app-shell #play>.lobby-hero{min-height:230px;padding:30px 40px;background-position:center 54%}
.app-shell #play>.lobby-hero h1{font-size:clamp(36px,3vw,54px);max-width:800px}
.app-shell #play>.lobby-hero p{font-size:20px;line-height:1.55;max-width:640px}
.app-shell #play .hero-tags{margin-top:18px}
.app-shell #play .hero-tags span{font-size:13px;padding:6px 12px}
.app-shell #play>:is(#deck-picker,#lobby){padding:28px}
.app-shell #play .picker-heading h2{font-size:32px;line-height:1.2}
.app-shell #play .picker-heading p{font-size:18px;line-height:1.5;margin:8px 0 0}
.app-shell #play .eyebrow{font-size:13px;margin-bottom:8px}
.app-shell #play .picker-heading .secondary{font-size:16px;min-height:48px;padding:10px 16px}
.app-shell #play #picked-deck{padding:22px 18px;gap:20px;margin:24px 0}
.app-shell #play #picked-deck .picked-art{gap:16px}
.app-shell #play #picked-deck .picker-card{width:44%;max-width:190px;font-size:15px}
.app-shell #play #picked-deck h3{font-size:28px;line-height:1.3}
.app-shell #play #picked-deck p{font-size:17px;line-height:1.5}
.app-shell #play #picked-deck small{font-size:15px}
.app-shell #play #picked-deck .eyebrow{font-size:12px}
.app-shell #play #deck-picker summary{font-size:19px;padding:14px 0}
.app-shell #play #deck-library summary span{font-size:15px;margin-top:6px}
.app-shell #play #deck-picker .fine{font-size:15px;line-height:1.6}
.app-shell #play #deck-search{font-size:18px;min-height:50px}
.app-shell #play .deck-search-label{font-size:16px}
.app-shell #play .deck-tile-select>strong{font-size:18px}
.app-shell #play .deck-tile-select>:is(small,span:not(.tile-art)){font-size:14px}
.app-shell #play .lobby-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:24px;align-items:start;margin-top:26px}
.app-shell #play .play-mode-sections{display:grid;grid-template-columns:1fr;gap:16px;margin:0}
.app-shell #play .play-mode-section{padding:20px;border-radius:12px}
.app-shell #play .play-mode-section h3{font-size:22px;line-height:1.3}
.app-shell #play .play-mode-section>p{font-size:16px;line-height:1.5;min-height:0;margin:8px 0 18px}
.app-shell #play .play-mode-section .play-modes{grid-template-columns:1fr;gap:10px;margin:0}
.app-shell #play .play-modes button{min-height:54px;font-size:18px;line-height:1.35;padding:12px;white-space:normal}
.app-shell #play .play-modes button[aria-pressed=true]{border-width:2px;font-weight:600}
.app-shell #play .match-configuration{min-width:0;padding:24px;background:#091620;border:1px solid #395464;border-radius:12px}
.app-shell #play .match-settings{display:block;margin:0 0 18px}
.app-shell #play :is(.match-settings,.play-panel) label{font-size:17px;line-height:1.5;display:block}
.app-shell #play :is(input:not([type=hidden]):not([type=range]):not([type=checkbox]),select){font-size:18px;min-height:52px;max-width:100%;width:100%;margin-top:6px}
.app-shell #play .play-panel{margin-top:22px;padding-top:22px}
.app-shell #play .play-panel h3{font-size:27px;margin:0 0 12px}
.app-shell #play .play-panel p,.app-shell #play .play-panel li{font-size:17px;line-height:1.55}
.app-shell #play .play-panel .fine{font-size:15px;line-height:1.5}
.app-shell #play .play-panel>.primary{width:100%;min-height:62px;font-size:21px;padding:15px 20px;margin-top:22px}
.app-shell #play .ai-search-control summary{font-size:17px;padding:10px 0}
.app-shell #play .lobby-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px;font-size:16px;margin-top:26px;padding-top:20px}
.app-shell #play .lobby-footer button{font-size:16px;min-height:44px}
.app-shell #play .match-configuration>.fine{font-size:14px;line-height:1.5}
.app-shell #play:has(>#room:not([hidden])){grid-template-columns:1fr}
@media(max-width:1350px){.app-shell #play .lobby-content{grid-template-columns:1fr}.app-shell #play .play-mode-sections{grid-template-columns:1fr 1fr}.app-shell #play .play-mode-section:has(#standard-play-title){grid-column:1/-1}.app-shell #play .play-mode-section .standard-queues{grid-template-columns:repeat(3,minmax(0,1fr))}.app-shell #play .match-configuration{padding:22px}}
@media(max-width:1000px){.app-shell:not(.immersive) #play:not([hidden]){grid-template-columns:1fr}.app-shell #play>#deck-picker,.app-shell #play>#lobby{grid-column:1}.app-shell #play #picked-deck{flex-direction:row;align-items:center}.app-shell #play #picked-deck .picked-art{width:48%;flex-shrink:0}.app-shell #play #picked-deck .picker-card{width:44%}.app-shell #play .lobby-content{grid-template-columns:1fr 1fr}.app-shell #play .play-mode-sections{grid-template-columns:1fr}.app-shell #play .play-mode-section .standard-queues{grid-template-columns:1fr}}
@media(max-width:700px){.app-shell:not(.immersive)>main:has(>#play:not([hidden])){padding:20px 14px 32px}.app-shell #play>.lobby-hero{padding:26px 22px}.app-shell #play>.lobby-hero p{font-size:18px}.app-shell #play>:is(#deck-picker,#lobby){padding:20px}.app-shell #play .lobby-content{grid-template-columns:1fr}.app-shell #play .play-mode-sections{grid-template-columns:1fr 1fr}.app-shell #play .play-mode-section .standard-queues{grid-template-columns:1fr}.app-shell #play .picker-heading{flex-wrap:wrap}.app-shell #play #picked-deck{flex-direction:column;align-items:stretch}.app-shell #play #picked-deck .picked-art{width:100%}.app-shell #play .match-configuration{padding:18px}}
@media(max-width:440px){.app-shell #play .play-mode-sections{grid-template-columns:1fr}.app-shell #play .picker-heading h2{font-size:28px}}

.app-shell #presets[hidden]{display:none}
.app-shell #load-deck{width:100%;min-height:48px;text-align:left;font-size:17px;padding:12px 16px}
.app-shell #deck-browser{width:min(1380px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);padding:24px;border:1px solid #567184;border-radius:16px;background:#101d2a;color:#edf3f5;box-shadow:0 24px 90px #0009;overflow:auto}
.app-shell #deck-browser::backdrop{background:#030910cc}
.app-shell .deck-browser-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}
.app-shell .deck-browser-heading h2{margin:0;font-size:28px}
.app-shell .deck-browser-heading p{margin:6px 0 0;font-size:16px;color:var(--shell-muted)}
.app-shell #deck-browser-close{padding:12px 18px;min-height:44px;font-size:16px}
.app-shell .deck-browser-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;align-items:start;gap:20px}
.app-shell #deck-browser-preview{margin:0;padding:16px}
.app-shell #deck-browser-preview>h2{font-size:23px;margin:0 0 16px}
.app-shell .deck-browser-list{display:flex;flex-direction:column;gap:8px;max-height:calc(100dvh - 180px);overflow:auto;padding:2px 8px 8px 2px}
.app-shell .deck-browser-list h3{font-size:15px;color:var(--shell-gold);margin:14px 0 4px}
.app-shell .deck-browser-list button{text-align:left;padding:12px 14px;min-height:46px;font-size:17px;white-space:normal}
.app-shell .deck-browser-list .is-previewed{border-color:#80dfd0;background:#214b42;color:#defff6}
.app-shell .deck-browser-list p{font-size:15px;color:var(--shell-muted)}
@media(max-width:850px){.app-shell #deck-browser{padding:16px;width:calc(100vw - 20px)}.app-shell .deck-browser-layout{grid-template-columns:minmax(0,1fr) 210px;gap:12px}.app-shell #deck-browser-preview .overview-main,.app-shell #deck-browser-preview .overview-side{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:600px){.app-shell .deck-browser-layout{grid-template-columns:1fr}.app-shell .deck-browser-list{grid-row:1;max-height:230px}.app-shell #deck-browser-preview{padding:12px}.app-shell .deck-browser-heading{align-items:flex-start}}

/* Deck setup: compact current selection and a readable, searchable library. */
.app-shell #play #deck-picker{min-width:0}
.app-shell #play #deck-picker .picker-heading{flex-direction:row;align-items:flex-start}
.app-shell #play #deck-picker .picker-heading h2{font-size:26px}
.app-shell #play #deck-picker .picker-heading p{font-size:15px}
.app-shell #play #picked-deck{display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;align-items:center;padding:16px;margin:20px 0;border-color:#518c80;background:linear-gradient(140deg,#193831,#0b1b25)}
.app-shell #play #picked-deck .picked-art{width:100%;gap:6px;align-items:center}
.app-shell #play #picked-deck .picker-card{width:47px;max-width:none;min-width:0}
.app-shell #play #picked-deck .picker-card small{font-size:10px}
.app-shell #play #picked-deck h3{font-size:21px;margin:5px 0 8px;overflow-wrap:anywhere}
.app-shell #play #picked-deck .picked-deck-counts{display:block;font-size:12px;line-height:1.6}
.app-shell #play #picked-deck .picker-full-deck-actions{justify-content:flex-start;margin-top:12px}
.app-shell #play #picked-deck .picker-full-deck-actions button{min-height:40px;font-size:14px;padding:8px 12px}
.app-shell #play #deck-library{padding-top:6px}
.app-shell #play #deck-library summary{font-size:20px}
.app-shell #play #deck-library summary span{font-size:13px;font-weight:400;line-height:1.5;margin-left:0;color:var(--shell-muted)}
.app-shell .deck-filters{display:flex;gap:6px;padding:4px;margin:6px 0 16px;border:1px solid #304957;border-radius:10px;background:#091620}
.app-shell .deck-filters button{flex:1;min-width:0;min-height:40px;padding:8px;border:1px solid transparent;border-radius:6px;background:transparent;color:#b8ccd6;font-size:14px}
.app-shell .deck-filters button[aria-pressed="true"]{border-color:#73cbbb;background:#26554b;color:#dcfff4}
.app-shell #play #deck-search{font-size:15px;min-height:46px}
.app-shell #play .deck-search-label{font-size:13px}
.app-shell #play #deck-results{font-size:12px;margin:10px 0;color:var(--shell-muted)}
.app-shell #play #deck-tiles{grid-template-columns:minmax(0,1fr);gap:8px;max-height:480px;padding:3px 6px 6px 3px;scrollbar-gutter:stable;scroll-padding:6px}
.app-shell #play #deck-tiles .deck-tile{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;border-radius:10px}
.app-shell #play #deck-tiles .deck-tile[hidden]{display:none}
.app-shell #play .deck-tile-select{display:grid;grid-template-columns:66px minmax(0,1fr);column-gap:10px;row-gap:4px;align-items:center;background:transparent;border:0;padding:0;min-height:64px}
.app-shell #play .deck-tile-select .tile-art{grid-column:1;grid-row:1/5;gap:4px;align-self:center}
.app-shell #play #deck-tiles .tile-art img{width:31px;height:44px;border-radius:3px}
.app-shell #play .deck-tile-select>strong{grid-column:2;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
.app-shell #play .deck-tile-select>:is(small,span:not(.tile-art)){grid-column:2;font-size:11px;line-height:1.4;margin:0}
.app-shell #play .deck-tile.picked .deck-tile-select>small{color:#a2eddd}
.app-shell #play .deck-tile-full-deck{margin:0;align-self:center;min-height:40px;padding:8px 10px;font-size:12px;white-space:nowrap}
.app-shell #play #deck-picker .record-details{margin-top:16px}
.app-shell #play #deck-picker .record-details summary{font-size:15px}
@media(min-width:1001px) and (max-width:1200px){.app-shell #play #deck-tiles .deck-tile{grid-template-columns:1fr}.app-shell #play .deck-tile-actions{justify-self:start;margin-left:76px}}
@media(max-width:440px){.app-shell #play #picked-deck{grid-template-columns:76px minmax(0,1fr);gap:12px}.app-shell #play #picked-deck .picker-card{width:35px}.app-shell #play #picked-deck h3{font-size:19px}.app-shell #play #deck-tiles .deck-tile{grid-template-columns:1fr}.app-shell #play .deck-tile-actions{justify-self:start;margin-left:76px}.app-shell #play #deck-picker .picker-heading .secondary{font-size:13px;padding:8px;min-height:40px}}

/* Full-height desktop setup, with typography that grows with the viewport. */
.app-shell .tutorial-course-details{margin:8px 0}
.app-shell .tutorial-course-details summary{cursor:pointer;color:var(--shell-muted);font-size:15px}
@media(min-width:1100px) and (min-height:700px){
.app-shell:not(.immersive):has(#play:not([hidden])>#lobby:not([hidden])){height:100dvh;display:flex;flex-direction:column}
.app-shell:not(.immersive)>main:has(>#play:not([hidden])>#lobby:not([hidden])){width:100%;max-width:none;margin:0;flex:1;min-height:0;padding:16px 24px;display:flex;flex-direction:column}
.app-shell:not(.immersive) #play:has(>#lobby:not([hidden])){flex:1;min-height:0;grid-template-columns:minmax(340px,1fr) minmax(0,2.25fr);grid-template-rows:minmax(0,1fr);gap:16px;align-items:stretch}
.app-shell:not(.immersive) #play:has(>#lobby:not([hidden])):has(>#resume-match:not([hidden])){grid-template-rows:auto minmax(0,1fr)}
.app-shell #play:has(>#lobby:not([hidden]))>.lobby-hero{display:none}
.app-shell #play #resume-match{margin:0;padding:10px 18px;gap:16px}
.app-shell #play #resume-match h2{font-size:18px}
.app-shell #play #resume-match p{font-size:15px}
.app-shell #play #resume-match .primary{min-height:40px;padding:8px 14px;font-size:16px}
.app-shell #play>:is(#deck-picker,#lobby){padding:clamp(16px,1.2vw,28px);margin:0;min-height:0;display:flex;flex-direction:column;overflow:auto}
.app-shell #play .picker-heading{flex-shrink:0}
.app-shell #play .picker-heading h2,.app-shell #play #deck-picker .picker-heading h2{font-size:clamp(26px,1.5vw,38px);margin:0}
.app-shell #play .picker-heading p,.app-shell #play #deck-picker .picker-heading p{font-size:clamp(15px,.9vw,21px);margin:6px 0 0;line-height:1.4}
.app-shell #play .picker-heading .eyebrow{display:none}
.app-shell #play .picker-heading .secondary{font-size:16px;min-height:42px;padding:8px 14px}
.app-shell #play #picked-deck{flex-shrink:0;padding:14px;margin:16px 0;grid-template-columns:100px minmax(0,1fr)}
.app-shell #play #picked-deck h3{font-size:clamp(20px,1.15vw,28px)}
.app-shell #play #picked-deck .picked-deck-counts{font-size:14px}
.app-shell #play #picked-deck .picker-full-deck-actions{margin-top:8px}
.app-shell #play #picked-deck .picker-full-deck-actions button{font-size:16px}
.app-shell #play #deck-library{flex:1;min-height:140px;margin:0;padding:0}
.app-shell #play #deck-library[open]{display:flex;flex-direction:column}
.app-shell #play #deck-library[open]::details-content{display:contents}
.app-shell #play #deck-library summary{flex-shrink:0;padding:10px 0;font-size:20px}
.app-shell #play #deck-library summary span{display:none}
.app-shell #play .deck-filters{flex-shrink:0;margin:0 0 10px}
.app-shell #play .deck-filters button{font-size:16px;min-height:42px}
.app-shell #play .deck-search-label{font-size:15px;margin:0}
.app-shell #play #deck-search{flex-shrink:0;font-size:16px;min-height:42px;margin-top:4px}
.app-shell #play #deck-picker #deck-results{flex-shrink:0;font-size:14px;margin:8px 0}
.app-shell #play #deck-tiles{flex:1;min-height:72px;max-height:none;align-content:start}
.app-shell #play #deck-tiles .deck-tile{grid-template-columns:minmax(0,1fr) auto;padding:12px}
.app-shell #play .deck-tile-select>strong{font-size:clamp(17px,1vw,24px)}
.app-shell #play .deck-tile-select>:is(small,span:not(.tile-art)){font-size:13px}
.app-shell #play .deck-tile-full-deck{font-size:14px;margin:0;min-height:42px}
.app-shell #play #deck-picker .record-details{flex-shrink:0;padding:0;margin-top:10px}
.app-shell #play #deck-picker .record-details summary{font-size:16px;padding:10px 0}
.app-shell #play .lobby-content{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:20px;margin-top:20px;align-items:stretch}
.app-shell #play .play-mode-sections{min-height:0;grid-template-columns:1fr;grid-template-rows:minmax(min-content,1.5fr) minmax(min-content,1fr) minmax(min-content,1fr);gap:14px}
.app-shell #play .play-mode-section{display:flex;flex-direction:column;padding:clamp(14px,1.1vw,26px);min-height:0}
.app-shell #play .play-mode-section h3{flex-shrink:0;font-size:clamp(20px,1.2vw,29px)}
.app-shell #play .play-mode-section>p{flex-shrink:0;font-size:clamp(15px,.85vw,20px);line-height:1.4;margin:8px 0 12px}
.app-shell #play .play-mode-section .play-modes{flex:1;min-height:0;grid-template-columns:1fr;grid-auto-rows:1fr;gap:8px}
.app-shell #play .play-modes button{min-height:42px;padding:8px 12px;font-size:clamp(17px,1.1vw,26px)}
.app-shell #play .match-configuration{min-height:0;padding:clamp(16px,1.2vw,28px);display:flex;flex-direction:column;overflow:auto}
.app-shell #play .match-settings{margin-bottom:14px}
.app-shell #play :is(.match-settings,.play-panel) label{font-size:clamp(16px,1vw,23px)}
.app-shell #play :is(input:not([type=hidden]):not([type=range]):not([type=checkbox]),select){min-height:46px;font-size:clamp(16px,1vw,23px);padding:10px 12px}
.app-shell #play .play-panel{margin-top:12px;padding-top:16px}
.app-shell #play .play-panel h3{font-size:clamp(24px,1.4vw,34px);margin:0 0 10px}
.app-shell #play .play-panel p,.app-shell #play .play-panel li{font-size:clamp(15px,.9vw,21px);line-height:1.4;margin:8px 0 12px}
.app-shell #play .play-panel .fine,.app-shell #play .match-configuration>.fine{font-size:clamp(13px,.75vw,18px);line-height:1.4}
.app-shell #play .play-panel>.primary{min-height:54px;font-size:clamp(20px,1.25vw,30px);padding:12px;margin-top:20px}
.app-shell #play .lobby-footer{margin-top:auto;padding-top:16px;font-size:16px}
.app-shell #play .lobby-footer p{margin:10px 0}
.app-shell #play .lobby-footer button{font-size:16px}
.app-shell:not(.immersive):has(#play:not([hidden])>#lobby:not([hidden]))>footer{flex-shrink:0;width:100%;max-width:none;margin:0;padding:6px 24px;font-size:10px;line-height:1.4}
}
@media(min-width:1100px) and (min-height:700px) and (max-height:850px){
.app-shell:not(.immersive)>main:has(>#play:not([hidden])>#lobby:not([hidden])){padding:10px 18px}
.app-shell #play>:is(#deck-picker,#lobby){padding:14px}
.app-shell #play .picker-heading p{margin-top:4px}
.app-shell #play #picked-deck{margin:10px 0;padding:10px}
.app-shell #play #picked-deck .picked-details{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;align-items:center}
.app-shell #play #picked-deck .picked-details>.eyebrow,.app-shell #play #picked-deck .picked-deck-counts{grid-column:1/-1}
.app-shell #play #picked-deck .picker-full-deck-actions{grid-column:2;grid-row:2;margin:0}
.app-shell #play #picked-deck h3{font-size:18px}
.app-shell #play .lobby-content{gap:14px;margin-top:12px}
.app-shell #play .play-mode-sections{gap:10px}
.app-shell #play .play-mode-section{padding:12px}
.app-shell #play .play-mode-section>p{margin:5px 0 8px;font-size:14px}
.app-shell #play .play-mode-section .play-modes{gap:6px}
.app-shell #play .play-mode-section .standard-queues{grid-template-columns:repeat(3,minmax(0,1fr))}
.app-shell #play .play-mode-section .play-modes:not(.standard-queues){grid-template-columns:1fr 1fr}
.app-shell #play .match-configuration{padding:14px}
.app-shell #play .match-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;flex-shrink:0}
.app-shell #play .match-settings{margin-bottom:8px}
.app-shell #play .play-panel{margin-top:8px;padding-top:10px}
.app-shell #play .play-panel>.primary{margin-top:10px;min-height:46px}
.app-shell #play .lobby-footer{display:none}
}

/* Keep queue labels and live counts together inside their button. */
.app-shell #play .standard-queues button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:68px;padding:9px 12px;line-height:1.2}
.app-shell #play .standard-queues .standard-queue-count{flex-shrink:0;margin:0;font-size:14px;line-height:1.25;color:#bed1dc;opacity:1}
.app-shell #play .standard-queues button[aria-pressed=true]::before{position:absolute;left:12px;top:50%;transform:translateY(-50%);margin:0}

.app-shell #play .deck-tile-actions{flex-direction:column;align-items:stretch}
.app-shell #play .deck-tile-actions button{margin:0;min-height:40px;padding:8px 10px;font-size:14px;white-space:nowrap}
@media(max-width:440px){.app-shell #play .deck-tile-actions{flex-direction:row;flex-wrap:wrap}}

/* Desktop workshop: use the available space and keep deck controls in reach. */
@media(min-width:761px) and (min-height:541px){
 .app-shell #build>.intro{min-height:112px;padding:18px 24px;margin-bottom:16px}
 .app-shell #build .builder-import{margin-bottom:16px}
 .app-shell #build .deck-guide{padding:18px;margin-bottom:16px}
 .app-shell #build .builder-steps{margin-bottom:16px}
 .app-shell #build .library .card-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
 .app-shell #build .deckpanel{position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow:auto;scrollbar-gutter:stable}
}
@media(min-width:1200px) and (min-height:541px){
 .app-shell #build .builder-steps{grid-template-columns:repeat(9,minmax(0,1fr))}
}

/* ---- Private table: decide first, browse second ------------------------------------
 * The room used to open with the deck library expanded above everything else, which put
 * "Lock in this deck" roughly 2700px down the page - past the fold on every screen. The
 * status and its one button now lead and stay pinned while you scroll, the library folds
 * away behind its summary, and the tile list gets a height again so the page stays short.
 */
.app-shell #waiting{display:flex;flex-direction:column;gap:16px;padding:0;border:0;background:none}
.app-shell .room-status{position:sticky;top:6px;z-index:6;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px 24px;padding:18px 22px;border:1px solid #3a6b78;border-radius:16px;background:#0f2130f7;box-shadow:0 14px 34px #04101a99;backdrop-filter:blur(8px)}
.app-shell .room-status-copy{min-width:0}
.app-shell .room-status h2{margin:0;font:600 clamp(20px,1.5vw,27px)/1.25 var(--shell-font);color:#eaf3f6}
.app-shell #waiting-hint{margin:7px 0 0;color:var(--shell-muted);font-size:14px;line-height:1.45}
.app-shell #waiting-hint:empty{display:none}
.app-shell #players-ready{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}
.app-shell .seat-status{display:inline-flex;align-items:baseline;gap:9px;min-width:0;padding:7px 14px;border:1px solid #2f4a58;border-radius:999px;background:#0b1a26}
.app-shell .seat-status strong{font-size:14px;color:#dbe9ef;overflow-wrap:anywhere}
.app-shell .seat-status small{font-size:13px;color:var(--shell-muted)}
.app-shell .seat-status.ready{border-color:#3f8f70;background:#0e2620}
.app-shell .seat-status.ready small{color:#83d9ae}
.app-shell .seat-status.open{border-style:dashed;opacity:.72}
.app-shell .room-status-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
.app-shell .room-status-actions .primary{min-height:50px;padding:13px 22px;font-size:17px}
.app-shell .room-status-actions .secondary{min-height:50px;font-size:15px}
.app-shell #room-deck-picker #deck-picker{margin:0}
.app-shell #room-deck-picker .picker-heading .eyebrow{display:none}
.app-shell #room-deck-picker #deck-library{flex:none;min-height:0;margin:0;padding:0;border-top:0}
.app-shell #room-deck-picker #deck-library summary{padding:13px 16px;border:1px solid #2f4a58;border-radius:12px;background:#0d1d29;font-size:17px}
.app-shell #room-deck-picker #deck-library summary:hover{border-color:#43707f;background:#102534}
.app-shell #room-deck-picker #deck-library[open] summary{margin-bottom:14px}
.app-shell #room-deck-picker #deck-library summary span{display:inline;margin-left:10px;color:var(--shell-muted);font-size:14px;font-weight:400}
.app-shell #room-deck-picker #deck-tiles{flex:0 1 auto;max-height:min(44vh,400px);overflow:auto}
/* While the library is open the selected deck steps back so the tiles it is being
   compared against fill the card. A single flex row overflows here - #picked-deck is a
   shell grid whose art column is sized by the shell - so this only trims it. */
.app-shell #room-deck-picker #deck-picker:has(#deck-library[open]) #picked-deck{padding:10px 14px;margin:14px 0;gap:12px;grid-template-columns:74px minmax(0,1fr)}
.app-shell #room-deck-picker #deck-picker:has(#deck-library[open]) #picked-deck .picker-card{width:33px}
.app-shell #room-deck-picker #deck-picker:has(#deck-library[open]) #picked-deck .picked-details .eyebrow{display:none}
.app-shell #room-deck-picker #deck-picker:has(#deck-library[open]) #picked-deck h3{margin:0 0 4px;font-size:19px}
@media(max-width:820px){
.app-shell .room-status{position:static;grid-template-columns:1fr;padding:16px 18px}
.app-shell .room-status-actions{justify-content:stretch}
.app-shell .room-status-actions>button{flex:1 1 100%}
.app-shell #room-deck-picker #deck-library summary span{display:block;margin:4px 0 0}
.app-shell #room-deck-picker #deck-tiles{max-height:min(52vh,420px)}
}

/* Deck import: one box that reads anything, with a live read-out of the deck beside it. */
#deck-import-dialog{margin:auto;width:min(980px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);box-sizing:border-box;padding:0;border:1px solid #3d5a6b;border-radius:14px;background:#0c1823;color:#edf3f5;box-shadow:0 24px 90px #000a;overflow:hidden}
#deck-import-dialog[open]{display:flex}
#deck-import-dialog::backdrop{background:#030910cc}
#deck-import-dialog .deck-import-form{display:flex;flex-direction:column;width:100%;min-height:0;max-height:calc(100dvh - 24px);margin:0}
#deck-import-dialog .deck-import-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 22px 14px;border-bottom:1px solid #22384a}
#deck-import-dialog .deck-import-eyebrow{margin:0;color:#8fb3c4;font-size:11px;letter-spacing:.14em;text-transform:uppercase}
#deck-import-dialog h2{margin:2px 0 0;font-size:22px;line-height:1.2;color:#edf3f5}
#deck-import-dialog .deck-import-x{width:36px;height:36px;padding:0;border:1px solid #3d5a6b;border-radius:8px;background:transparent;color:#edf3f5;font-size:22px;line-height:1}
#deck-import-dialog .deck-import-body{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr);gap:16px;padding:16px 22px;min-height:0;overflow:auto}
#deck-import-dialog .deck-import-input{display:flex;flex-direction:column;min-width:0}
#deck-import-dialog .deck-import-input>label{margin:0 0 6px;font-weight:600;font-size:14px}
#deck-import-dialog textarea{flex:1;min-height:300px;width:100%;box-sizing:border-box;resize:vertical;margin:0;padding:12px;font:13px/1.55 ui-monospace,Consolas,monospace;background:#07121b;color:#edf3f5;border:1px solid #3d5a6b;border-radius:10px}
#deck-import-dialog textarea.is-dropping{border-color:var(--shell-teal);box-shadow:0 0 0 3px #80dfd033}
#deck-import-dialog .deck-import-file{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:10px 0 0;color:#a4b7c6;font-size:12.5px}
#deck-import-dialog .deck-import-file input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
#deck-import-dialog .deck-import-file-button{display:inline-block;margin:0;padding:6px 12px;border:1px solid #3d5a6b;border-radius:8px;color:#edf3f5;font-size:13px;font-weight:600;cursor:pointer}
#deck-import-dialog .deck-import-file-button:hover,#deck-import-dialog .deck-import-file input:focus-visible+span{border-color:var(--shell-teal)}
#deck-import-dialog .deck-import-preview{min-width:0;padding:14px 16px;border:1px solid #22384a;border-radius:10px;background:#101f2c;font-size:13.5px;overflow:auto}
#deck-import-dialog .deck-import-kicker{margin:0 0 10px;color:var(--shell-teal);font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
#deck-import-dialog .deck-import-accepts{margin:0 0 12px;padding-left:18px;color:#c9d7df}
#deck-import-dialog .deck-import-accepts li{margin:0 0 6px}
#deck-import-dialog .deck-import-note{margin:0;color:#8fa6b5;font-size:12.5px}
#deck-import-dialog .deck-import-core{display:grid;gap:8px;margin:0 0 12px}
#deck-import-dialog .deck-import-core div{display:grid;grid-template-columns:78px 1fr;gap:8px}
#deck-import-dialog .deck-import-core dt{color:#8fa6b5}
#deck-import-dialog .deck-import-core dd{margin:0;font-weight:600}
#deck-import-dialog .deck-import-core em{color:#e6c58b;font-style:normal;font-weight:400}
#deck-import-dialog .deck-import-tally{display:grid;gap:4px;margin:0 0 10px;padding:0;list-style:none}
#deck-import-dialog .deck-import-tally li{display:grid;grid-template-columns:1fr auto 76px;gap:8px;align-items:baseline;padding:5px 8px;border-radius:6px;background:#0b1822}
#deck-import-dialog .deck-import-tally b{font-variant-numeric:tabular-nums}
#deck-import-dialog .deck-import-tally small{text-align:right;font-size:12px}
#deck-import-dialog .deck-import-tally .is-done small{color:#7fdcb0}
#deck-import-dialog .deck-import-tally .is-open small{color:#e6c58b}
#deck-import-dialog .deck-import-legal{margin:0 0 10px;color:#a4b7c6;font-size:12.5px}
#deck-import-dialog .deck-import-legal.is-good{color:#7fdcb0}
#deck-import-dialog .deck-import-legal.is-bad,#deck-import-dialog .deck-import-error{color:#ffb4a4}
#deck-import-dialog .deck-import-notes{margin:0 0 8px}
#deck-import-dialog .deck-import-notes summary{cursor:pointer;font-weight:600;color:#e6c58b}
#deck-import-dialog .deck-import-notes.is-bad summary{color:#ffb4a4}
#deck-import-dialog .deck-import-notes ul{margin:6px 0 0;padding-left:18px;color:#c9d7df;font-size:12.5px}
#deck-import-dialog .deck-import-foot{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;padding:14px 22px;border-top:1px solid #22384a}
#deck-import-dialog .deck-import-name{display:flex;align-items:center;gap:8px;margin:0;font-size:13px;font-weight:600}
#deck-import-dialog .deck-import-name input{width:220px;max-width:50vw;padding:7px 10px;border:1px solid #3d5a6b;border-radius:8px;background:#07121b;color:#edf3f5}
#deck-import-dialog .deck-import-status{flex:1 1 180px;margin:0;color:#e6c58b;font-size:12.5px}
#deck-import-dialog .deck-import-actions{display:flex;gap:8px;margin-left:auto}
#deck-import-dialog .deck-import-actions button{padding:9px 18px;font-size:14px}
#deck-import-dialog #import-paste:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:720px){#deck-import-dialog .deck-import-body{grid-template-columns:1fr}#deck-import-dialog textarea{min-height:180px}#deck-import-dialog .deck-import-name{flex:1 1 100%}#deck-import-dialog .deck-import-name input{flex:1;width:auto;max-width:none}}

/* Deck export: a menu under whichever Export button opened it. */
.deck-export-menu{position:fixed;z-index:1000;width:300px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:8px;border:1px solid #3d5a6b;border-radius:12px;background:#0f1d29;color:#edf3f5;box-shadow:0 18px 50px #000a}
.deck-export-menu[hidden]{display:none}
.deck-export-menu .deck-export-title{margin:4px 8px 8px;color:#8fb3c4;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
.deck-export-menu button{display:block;width:100%;margin:0 0 4px;padding:9px 12px;text-align:left;border:1px solid transparent;border-radius:8px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.deck-export-menu button:hover,.deck-export-menu button:focus-visible{border-color:#3d5a6b;background:#172938;outline:none}
.deck-export-menu button b{display:block;font-size:14px}
.deck-export-menu button small{display:block;color:#a4b7c6;font-size:12px}
.deck-export-menu button.is-copied small{color:#7fdcb0}
