:root {
  color-scheme: dark;
  --bg:#101213; --surface:#191c1d; --well:#131617; --line:#343634;
  --ink:#f1eae0; --muted:#b1aba0; --copper:#e0aa78; --rim:#946342;
  --paper:#e8dac3; --soot:#342b22; --green:#95b6a4;
  --sans:"Microsoft YaHei UI","PingFang SC","Noto Sans CJK SC",system-ui,sans-serif;
  --serif:"Songti SC","Noto Serif CJK SC","SimSun",serif;
  --number:Georgia,"Times New Roman",serif;
  font-family:var(--sans);
  font-size:14px;
  background:var(--bg);
  color:var(--ink);
}
*,*::before,*::after { box-sizing:border-box }
body { margin:0; min-width:320px }
body,button,input,textarea { font-family:var(--sans) }
button,input,textarea { font-size:inherit }
button { cursor:pointer; color:inherit }
button:disabled { opacity:.52; cursor:not-allowed }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible { outline:2px solid #efb58c; outline-offset:3px }
a { color:inherit; text-decoration:none }
p { line-height:1.65 }
h1,h2,h3,p,figure { margin:0 }
main:focus-visible { outline:none }
[hidden] { display:none!important }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
::selection { background:#ac7450; color:#120d0a }
.site-head { border-bottom:1px solid #35322d; background:#151718; position:relative; z-index:4 }
.head-inner { min-height:68px; margin:auto; max-width:1540px; padding:0 4vw; display:grid; align-items:center; grid-template-columns:1fr auto 1fr; gap:24px }
.brand { display:inline-flex; align-items:center; justify-self:start; gap:12px; min-height:44px; white-space:nowrap }
.brand b { font:700 22px/1 var(--number); letter-spacing:.055em }
.brand em { padding-left:8px; color:var(--muted); font-style:normal; font-size:12px }
.brand-mark,.room-icon { position:relative; display:grid; place-items:center; width:32px; aspect-ratio:1; isolation:isolate; flex:none }
.brand-mark::before,.brand-mark::after,.brand-mark i,.room-icon::before,.room-icon i { content:""; position:absolute; border:1px solid var(--rim); rotate:45deg }
.brand-mark::before { inset:4px }
.brand-mark::after { inset:8px; border-color:#63472f }
.brand-mark i { inset:12px; background:var(--copper) }
.main-nav { display:flex; gap:clamp(14px,2.6vw,37px); align-self:stretch; white-space:nowrap }
.main-nav a { display:grid; align-items:center; position:relative; color:#ccc5bb; padding:0 2px; min-height:44px }
.main-nav a:hover,.main-nav a[aria-current] { color:var(--copper) }
.main-nav a[aria-current]::after { content:""; position:absolute; bottom:-1px; left:0; right:0; height:2px; background:var(--copper) }
.head-actions,.title-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end }
.button {
  display:inline-flex; gap:8px; align-items:center; justify-content:center;
  min-height:44px; min-width:44px; border:1px solid transparent; border-radius:4px;
  padding:0 15px; background:transparent; font-weight:600; white-space:nowrap;
  transition:background .16s,border-color .16s,color .16s;
}
.button.primary { background:#dcaa7d; border-color:#dcaa7d; color:#24180f; box-shadow:inset 0 0 0 1px #ffe1b936 }
.button.primary:hover:not(:disabled) { background:#edbf95; border-color:#edbf95 }
.button.paper { background:var(--paper); color:#28211a; border-color:#f1dfc4 }
.button.paper:hover { background:#fbecd3 }
.button.soft { background:#272826; border-color:#3c3d36 }
.button.outline { border-color:#4a453e; background:#1b1e1e }
.button.quiet { color:var(--muted) }
.button.outline:hover:not(:disabled),.button.soft:hover:not(:disabled),.button.quiet:hover:not(:disabled) { color:#f4d5b8; background:#362b23; border-color:#775740 }
.button[aria-pressed="true"] { border-color:var(--rim); color:var(--copper); background:#362a21 }
.wide { width:100% }
.page { width:min(1328px,calc(100% - 8vw)); margin:28px auto 46px }
.overline { display:inline-flex; align-items:center; gap:9px; color:#d0a987; font-size:11px; letter-spacing:.12em; font-weight:700; line-height:1.4 }
.tag { display:inline-flex; min-height:25px; align-items:center; padding:3px 8px; border:1px solid #5a4737; background:#28231e; border-radius:3px; font-size:11px; color:#e4ba95; white-space:nowrap }
.arena-hero {
  position:relative; isolation:isolate; display:flex; align-items:center; overflow:hidden;
  min-height:335px; border:1px solid #5b4636; border-radius:7px;
  background:#211b17; padding:42px clamp(24px,5vw,74px);
}
.arena-hero::before {
  content:""; position:absolute; z-index:-2; inset:0 0 0 25%;
  background:radial-gradient(ellipse at 75% 60%,#a36e42a3,#3b2d23 52%,#201b17 80%);
  background-image:linear-gradient(90deg,#211b17 0%,#211b17bd 16%,#201b1730 52%,#1614120d 100%),url("assets/arena-lobby.png"),radial-gradient(ellipse at 73% 59%,#a36e42a3,#3b2d23 56%,#201b17 80%);
  background-position:center,right 53%,center; background-size:cover; background-repeat:no-repeat;
}
.arena-hero::after { content:""; position:absolute; z-index:-1; inset:9px; border:1px solid #c7a27d27; border-radius:4px; pointer-events:none }
.hero-content { width:min(100%,520px); min-width:0 }
.live-dot,.connection-indicator i { width:7px; height:7px; background:var(--green); border-radius:100%; flex:none; display:inline-block }
.hero-content .live-dot { background:#d7a478; box-shadow:0 0 12px #d7a47885 }
.hero-content h1 { font:700 clamp(50px,6vw,86px)/1.12 var(--serif); margin:17px 0 13px; letter-spacing:.045em; color:#f2e4d3 }
.hero-content p { font-size:17px; color:#e4c9af; margin-bottom:27px }
.hero-content .button { padding:0 18px }
.lobby-format { display:flex; justify-content:space-between; align-items:center; padding:19px 0; gap:16px }
.lobby-format p { color:var(--muted); font-size:12px; margin-top:6px }
.format-switch { display:flex; gap:8px; max-width:100% }
.format-option {
  display:grid; grid-template-columns:auto 1fr auto; min-width:164px; text-align:left; gap:8px; align-items:center;
  min-height:46px; border:1px solid #41403a; border-radius:4px; background:#1c1e1d; padding:0 10px
}
.format-option strong { font:700 20px/1 var(--number); color:#f1e7d7 }
.format-option span { font-size:10px; color:#c6bbaa; overflow-wrap:anywhere }
.format-option i { width:9px; height:9px; border:1px solid #766757; transform:rotate(45deg) }
.format-option[aria-pressed="true"] { background:#30251e; border-color:#9d714f }
.format-option[aria-pressed="true"] i { background:#dcaa7d; border-color:#dcaa7d }
.format-option[aria-pressed="true"] strong,.format-option:hover strong { color:var(--copper) }
.lobby-grid,.editor-grid,.prep-grid { display:grid; grid-template-columns:minmax(0,1.83fr) minmax(290px,1fr); gap:18px; align-items:start }
.surface { border:1px solid var(--line); border-radius:6px; background:var(--surface); padding:22px; min-width:0 }
.surface-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:17px }
.surface h2,.surface-head h2 { font:700 26px/1.25 var(--serif); margin-top:5px; color:#f0e7dc }
input,textarea {
  background:#101314; border:1px solid #464640; border-radius:4px; min-height:44px;
  padding:9px 11px; width:100%; color:var(--ink); min-width:0
}
input::placeholder,textarea::placeholder { color:#ada69c; opacity:1 }
label,.field-label { color:#e1d6ca; font-size:13px; font-weight:600; display:block; margin:0 0 7px }
textarea { line-height:1.6; resize:vertical }
.lookup { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding-bottom:14px; border-bottom:1px solid var(--line) }
.room-row { display:grid; grid-template-columns:40px minmax(0,1fr) auto auto; align-items:center; gap:14px; min-height:68px; border-bottom:1px solid #323532 }
.room-row:last-child { border-bottom:none }
.room-icon { width:34px; border:1px solid #494238; background:linear-gradient(145deg,#3a2f25,#23211d); border-radius:4px }
.room-icon::before { inset:10px; border-color:#bb8c65 }
.room-icon i { inset:14px; background:#bb8c65 }
.room-info,.room-review div:first-child { display:grid; gap:4px; min-width:0; overflow-wrap:anywhere }
.room-info strong,.room-review strong { color:#efe6d8 }
.room-info small,.room-review small,.room-review p { color:var(--muted); font-size:12px }
.room-info small span,.duel-top i { color:#aa805e; font-style:normal }
.seat { display:flex; gap:5px; align-items:center; color:#ddd0bf; font-size:12px; white-space:nowrap }
.seat i { width:8px; height:8px; border:1px solid #a68161; border-radius:2px }
.seat i:first-child { background:#dca77c }
.room-review { margin-top:16px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border:1px solid #705440; background:#2a231f; border-radius:4px; padding:12px; gap:8px }
.review-actions { display:flex; gap:5px }
.create-room .field-label { margin-top:16px }
.segmented { display:flex; gap:7px }
.segmented > .button { flex:1; background:#1c1e1c; border-color:#43423b }
.segmented > .button[aria-pressed="true"] { background:#352a21; border-color:#8a6146 }
.hint { color:var(--muted); font-size:12px; margin:10px 0 14px }
.site-foot { width:min(1328px,calc(100% - 8vw)); margin:0 auto 25px; border-top:1px solid #30312d; padding:14px 0; color:#a7a196; font-size:11px; display:flex; justify-content:space-between; gap:12px }
.title-row { display:flex; align-items:end; gap:20px; justify-content:space-between; margin:34px 0 24px }
.section-title h1 { font:700 clamp(34px,4.5vw,59px)/1.15 var(--serif); margin:7px 0 8px; letter-spacing:.03em }
.section-title p { color:#c2b9ad }
.editor-grid { grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr) }
.library-body { margin-top:17px; display:grid; grid-template-columns:minmax(120px,175px) minmax(0,1fr); gap:16px }
.library-preview { padding:5px 12px 0 0 }
.library-preview .card-face { width:100%; max-width:149px }
.library-preview figcaption { color:var(--muted); font-size:12px; line-height:1.7; margin-top:10px }
.library-labels { display:flex; justify-content:space-between; color:#baaa98; font-size:11px; padding:0 10px 8px }
.library-row { display:flex; align-items:center; min-height:54px; justify-content:space-between; border-top:1px solid #363735 }
.library-row.selected { background:#2b2420; border-color:#78573f }
.library-name { background:none; border:0; text-align:left; flex:1; min-height:50px; display:flex; align-items:center; gap:9px; padding:4px 9px }
.library-name span { display:grid; gap:4px }
.library-name small { color:#bbafa4 }
.library-name i { width:8px; height:8px; border-radius:100%; flex:none }
.pitch-1 { background:#d28468 }.pitch-2 { background:#d4b277 }.pitch-3 { background:#84acc0 }
.quantity { display:flex; align-items:center; gap:4px }
.quantity strong { min-width:11px; text-align:center }
.quantity .button { padding:0; font-size:19px }
.empty { padding:10px }
.pool .format-switch { margin:14px 0 }
.pool .format-option { flex:1; min-width:0 }
.pool-hero { display:flex; align-items:center; gap:11px; border-block:1px solid var(--line); padding:10px 0 }
.pool-hero .card-art { width:50px; height:46px; flex:none; border:1px solid #795b41 }
.pool-hero span:last-child { display:grid; gap:4px }
.pool-hero small { font-size:11px; color:#c3b5a5 }
.pool-meter { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:5px; margin:14px 0 5px; color:var(--muted); font-size:12px }
.pool-meter strong { font:700 36px/1 var(--number); color:var(--paper) }
.pool-meter progress { width:100%; height:8px; accent-color:#d9a87c; margin-top:5px }
.pool-list { margin:5px 0 0 }
.pool-list div { display:flex; justify-content:space-between; border-bottom:1px solid var(--line); padding:9px 0 }
.pool-list dd { margin:0 }
.prep-steps { list-style:none; display:grid; grid-template-columns:repeat(5,1fr); padding:0; margin:0 0 20px; border:1px solid var(--line); border-radius:5px; background:var(--surface) }
.prep-steps li { display:flex; align-items:center; gap:8px; padding:12px; min-height:58px; border-right:1px solid var(--line); color:var(--muted) }
.prep-steps li:last-child { border:0 }
.prep-steps li span { font:700 17px/1 var(--number); color:#a89681 }
.prep-steps li[aria-current] { color:#f4d5b8; background:#2f251e; box-shadow:inset 0 -2px var(--copper) }
.prep-steps li.done span { color:var(--green) }
.prep-grid { grid-template-columns:minmax(0,1fr) minmax(220px,310px) }
.prep-work { min-height:353px }
.prep-work p,.prep-opponent p { color:#c2b9ad; margin:9px 0 16px }
.prep-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:24px }
.prep-choices,.gear-picks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px }
.prep-deck,.gear-choice { min-width:0; text-align:left; display:grid; gap:6px; padding:10px; border:1px solid #49413a; border-radius:4px; background:#211e1a }
.prep-deck[aria-pressed="true"],.gear-choice[aria-pressed="true"] { border-color:var(--copper); background:#382a21 }
.prep-deck:hover:not(.revealed),.gear-choice:hover { border-color:var(--copper) }
.prep-deck small,.gear-choice small,.start-pool small { color:#c3b2a0 }
.prep-deck .card-art,.gear-choice .card-art { height:76px }
.gear-picks { grid-template-columns:repeat(4,minmax(0,1fr)) }
.rival-mark { display:grid; padding-bottom:14px }
.rival-mark .card-art { height:96px; border:1px solid #695641 }
.first-choice { max-width:300px }
.start-pool,.reveal-order { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; padding:10px 0; gap:10px; border-bottom:1px solid var(--line) }
.start-pool div { display:grid; gap:5px }
.reveal-order span { color:var(--copper) }
.drawer {
  height:100dvh; max-height:100dvh; width:min(450px,100%); max-width:100%; color:var(--ink);
  inset:0 0 0 auto; margin:0; padding:0; border:0; border-left:1px solid #856247; background:#1c1e1f; box-shadow:-18px 0 60px #0007
}
.drawer::backdrop { background:#11100fc7 }
.drawer[open] { animation:drawer-in .2s ease-out both }
@keyframes drawer-in { from { opacity:0; transform:translateX(14px) } to { opacity:1; transform:none } }
.drawer-head { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; gap:8px; background:#22211e; border-bottom:1px solid #453b31; padding:18px 23px }
.drawer-head h2 { font:700 24px/1.3 var(--serif); margin-top:6px }
.drawer-body { padding:20px 23px 32px }
.drawer-body > p { color:#cabeb1; margin-bottom:14px }
.drawer-body h3 { margin:18px 0 8px }
.drawer-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-top:12px }
.drawer-form input,.drawer-body > input { margin-bottom:14px }
.drawer-form button[type=submit] { margin-top:4px }
.demo-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px }
.wire-links,.import-preview ul { list-style:none; padding:0; margin:0 }
.wire-links a,.import-preview li { border-top:1px solid var(--line); display:flex; align-items:center; gap:10px; min-height:44px; padding:6px 0 }
.wire-links a > span { color:var(--copper); font:700 15px var(--number) }
.wire-links a:hover { color:var(--copper) }
.wire-links a i { margin-left:auto; font-style:normal; color:var(--muted) }
.import-preview small { margin-left:auto; text-align:right; color:#e2ad87; min-width:64px }
.import-preview li span { overflow-wrap:anywhere }
.code-block { background:#2c261f; border:1px solid #6c543d; padding:8px 10px; border-radius:4px; display:flex; gap:8px; justify-content:space-between; align-items:center; margin-bottom:14px }
.code-block strong { font:700 24px var(--number); letter-spacing:.08em; color:#f1cba6 }
.toaster { position:fixed; bottom:22px; left:50%; translate:-50% 0; z-index:12; white-space:normal; max-width:calc(100% - 24px); pointer-events:none }
.toaster span { display:block; background:#2e251e; color:#f5dfca; border:1px solid #a6734e; padding:9px 14px; border-radius:5px; box-shadow:0 7px 22px #0005; text-align:center }
.card-face {
  display:grid; position:relative; grid-template-rows:minmax(11px,auto) minmax(0,1fr) minmax(10px,auto); gap:3px;
  place-items:stretch; aspect-ratio:5 / 7; border:1px solid #f1dfba; border-radius:5px;
  box-shadow:inset 0 0 0 1px #9a805d,0 3px 5px #0005;
  padding:5px; color:var(--soot); background:linear-gradient(155deg,#f2e3c9,#c8af86);
  text-align:center; min-width:0; min-height:0; overflow:hidden;
}
.card-face:disabled { opacity:1; cursor:default }
.card-name { font-size:clamp(10px,.94vw,13px); font-weight:700; align-self:center; line-height:1.1 }
.card-foot { font-size:10px; align-self:center; white-space:nowrap; line-height:1.1 }
.card-art {
  color:#dbbd8a; display:grid; place-items:center; min-width:0; min-height:0; position:relative;
  isolation:isolate; overflow:hidden; border:1px solid #b293665f; border-radius:2px;
  background:radial-gradient(ellipse at 50% 15%,#514234,#211b16 74%); width:100%
}
.card-art svg {
  width:100%; height:100%; min-height:0; position:absolute; inset:0;
  fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round
}
.card-art svg .art-grid { stroke-width:1; opacity:.32 }
.card-art.ink-1 { color:#f1c5a5; background:radial-gradient(ellipse at 50% 15%,#66483b,#2d201d 75%) }
.card-art.ink-2 { color:#e6cd96; background:radial-gradient(ellipse at 50% 15%,#63543b,#28241b 75%) }
.card-art.ink-3 { color:#cee0d1; background:radial-gradient(ellipse at 50% 15%,#445752,#222a27 75%) }
.card-back {
  display:grid; place-items:center; position:relative; isolation:isolate; aspect-ratio:5 / 7;
  border:1px solid #8b7257; border-radius:4px; background:repeating-linear-gradient(137deg,#22201e 0 3px,#272421 3px 5px);
  box-shadow:inset 0 0 0 2px #302921, 0 2px 4px #0005;
}
.card-back i { width:39%; aspect-ratio:1; border:1px solid #a58059; rotate:45deg; position:relative }
.card-back i::after { content:""; position:absolute; inset:23%; background:#b28a5b; opacity:.65 }
.duel-page { width:min(1540px,calc(100% - 4vw)); margin:0 auto 18px; --rail:245px }
.duel-top { min-height:49px; display:grid; grid-template-columns:1fr auto 1fr; gap:9px; align-items:center; font-size:12px; color:#c2b8a8 }
.duel-top>div { display:flex; align-items:center; gap:9px; min-width:0 }
.duel-top>div>span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.duel-top>strong { font-weight:600; color:#ead8c4; white-space:nowrap }
.connection-indicator { display:flex; align-items:center; gap:6px; justify-self:end; white-space:nowrap }
.connection-indicator i.paused { background:#e0aa78 }
.duel-layout { display:grid; grid-template-columns:minmax(0,1fr) var(--rail); gap:14px; align-items:stretch }
.tabletop {
  display:grid; gap:7px; min-width:0; isolation:isolate; border:1px solid #605242; border-radius:7px;
  padding:9px; background:repeating-linear-gradient(135deg,#1b1c1a22 0 1px,#27252222 1px 3px),radial-gradient(ellipse at 50% 48%,#343028 0%,#242421 56%,#1c1e1c 100%);
  box-shadow:inset 0 0 0 3px #1c1b17, inset 0 0 0 4px #40382c,0 12px 26px #08090890;
}
.foe-hand { height:52px; display:flex; align-items:center; justify-content:center; gap:12px; color:#ccc0ae; font-size:12px }
.foe-hand div { display:flex; gap:5px }
.foe-hand .card-back { width:31px }
.foe-hand b { color:#f0cbab; margin-left:3px }
.board-seat { display:grid; grid-template-columns:101px minmax(0,1.45fr) minmax(0,1fr); gap:10px; align-items:center; background:#14171680; border-block:1px solid #4b4035; padding:9px 7px }
.seat-stats { display:grid; align-self:center; gap:4px; min-width:0 }
.seat-identity { display:grid; gap:3px }
.seat-identity > span { color:#cca989; font-size:11px }
.seat-identity strong { font-size:13px; color:#f1e5d6; white-space:nowrap }
.seat-values { display:grid; grid-template-columns:auto 1fr; justify-items:start; align-items:baseline; color:#c0b5a5; column-gap:5px; row-gap:2px; font-size:11px }
.seat-values b { font:700 34px/1 var(--number); color:#f4dfc4; letter-spacing:-.04em }
.seat-values span:nth-child(n+3) { grid-column:1 / -1; white-space:nowrap }
.seat-values strong { font-weight:700; color:#e8d5c0 }
.equipment { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; align-items:start }
.equipment > div { display:grid; gap:4px; min-width:0 }
.equipment > div > span:last-child { text-align:center; color:#c2b3a3; font-size:10px; min-width:0 }
.board-card { width:100%; padding:3px 2px; gap:2px; grid-template-rows:1fr minmax(0,3fr) 1fr }
.board-card .card-name { font-size:clamp(8px,.75vw,11px); white-space:nowrap; letter-spacing:-.08em }
.board-card .card-foot { font-size:9px }
.board-card.vacant { display:block; aspect-ratio:5 / 7; border:1px dashed #665545; border-radius:5px; background:#17171377 }
.board-card:hover,.combat-card:hover { outline:1px solid var(--copper); outline-offset:2px }
.gear-mobile { display:none }
.zones { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-self:stretch; align-items:center; padding-left:8px; border-left:1px solid #493f34; gap:5px; min-width:0 }
.zone { display:grid; place-items:center; gap:4px; padding:0; min-width:0; width:100%; background:none; border:0; color:#c1b4a4 }
.zone > span:last-child { font-size:10px; white-space:nowrap }
.zone b { color:#f0d4ba }
.zone-mark,.zone-back { display:grid; place-items:center; aspect-ratio:5 / 7; width:100%; border-radius:4px }
.zone-mark { border:1px dashed #685a48; background:#1a1b187d; font:700 22px var(--number); color:#8c7b66 }
.zone-mark.has-cards { border:1px solid #8e745c; background:#30281f; color:#d7ac84 }
.deck-zone .zone-back { box-shadow:inset 0 0 0 2px #302921,2px 2px #141313,3px 3px #846b52,0 3px 4px #0006 }
.zone:hover > span:first-child { border-color:var(--copper) }
.combat { padding:9px 11px 10px; min-width:0; background:#27231d9c }
.combat-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px }
.combat-header > span { display:flex; align-items:center; gap:5px }
.combat-header h2,.hand-head h2 { font:700 21px/1.22 var(--serif); color:#f0e3d1; padding-top:3px }
.combat-header .button { display:none }
.chain-row { display:grid; grid-template-columns:minmax(95px, .19fr) minmax(0,1fr); align-items:stretch; gap:8px }
.chain-prev { display:grid; text-align:left; gap:3px; align-content:center; border:1px solid #514737; border-radius:4px; color:#d9c5ad; background:#1e1d18; padding:7px 9px }
.chain-prev[aria-pressed="true"],.chain-prev:hover { border-color:#9c6b4b }
.chain-prev span,.chain-data > span { font:700 12px var(--number); color:#d2a582 }
.chain-prev small,.chain-extra span { color:#bcab97; font-size:11px }
.chain-hit { display:grid; grid-template-columns:61px minmax(0,1fr) minmax(0,.69fr); gap:12px; align-items:center; padding:7px; border:1px solid #5e503e; border-radius:5px; background:linear-gradient(95deg,#30251e,#22201b) }
.chain-hit.current { border-color:#9f6e4b }
.combat-card { width:100%; padding:3px }
.combat-card .card-name { font-size:10px }
.chain-data h3 { font:700 22px/1.16 var(--serif); margin:4px 0 }
.atk-def { display:flex; flex-wrap:wrap; gap:4px 14px; color:#d4c0a9; font-size:12px }
.atk-def b { color:#fde0c1; font-size:16px; margin-left:2px }
.chain-extra { border-left:1px solid #6d5640; padding-left:9px; display:grid; gap:3px }
.chain-extra strong { color:#f0ccaa }
.hand-area { padding:5px 10px 8px; min-width:0 }
.hand-head { display:flex; justify-content:space-between; align-items:center; gap:6px; margin-bottom:7px }
.hand-head h2 small { font:600 12px var(--sans); color:#cbbaa6; padding-left:3px }
.hand-head .button { margin-left:4px }
.hand-fan { display:flex; align-items:start; justify-content:center; gap:7px; min-width:0 }
.hand-card { width:min(100px,calc((100% - 35px) / var(--n))); position:relative; padding:5px; transition:translate .16s ease,box-shadow .16s ease }
.hand-card:not(:disabled):hover { translate:0 -3px }
.hand-card[aria-pressed="true"] { outline:2px solid #edb187; outline-offset:2px; z-index:1 }
.draft-check { display:none; position:absolute; top:3px; right:3px; border-radius:3px; background:#3b2920; color:#ffe1c4; font-style:normal; padding:1px 3px }
.hand-card[aria-pressed="true"] .draft-check { display:block }
.action-rail { position:relative; min-width:0; border:1px solid #524539; border-radius:6px; padding:13px; background:linear-gradient(155deg,#211e1a,#191b1b 60%); display:grid; grid-template-rows:142px 139px auto 1fr; gap:9px; align-items:start }
.notice { border:1px solid #74553e; border-left:3px solid #bc8b63; padding:11px 9px; border-radius:4px; background:#30251e; height:100%; overflow-wrap:anywhere }
.notice.alert { border-left-color:#e0aa78; background:#36261e }
.notice h2 { font:700 20px/1.2 var(--serif); color:#f2d9c0; margin:6px 0 }
.notice p,.action-body p { color:#cbbbaf; font-size:12px; margin-bottom:4px }
.action-body { min-height:0; max-height:100%; overflow:auto; padding:2px 3px }
.action-body > .button { width:100%; justify-content:space-between }
.draft-tally { display:flex; align-items:baseline; justify-content:space-between; color:#ceb49c; border-bottom:1px solid #51443a; margin-bottom:9px; padding:4px 0 9px }
.draft-tally strong { color:#f3d4b3; font:700 32px/1 var(--number) }
.draft-tally small { font:500 12px var(--sans) }
.duel-buttons { display:flex; flex-direction:column-reverse; gap:6px }
.duel-buttons .button { white-space:normal }
.rail-bottom { display:grid; align-self:end; gap:9px; min-width:0 }
.rail-bottom small { color:#bdb0a0; font-size:11px }
.rail-bottom .button { justify-content:space-between }
.duel-log,.duel-sheet {
  position:absolute; z-index:3; left:10px; right:10px; bottom:64px; border:1px solid #8a6248;
  border-radius:6px; padding:10px; background:#25211e; box-shadow:0 10px 35px #0008;
  max-height:min(370px,48vh); overflow:auto; overscroll-behavior:contain
}
.duel-log ol,.order-list { padding-left:24px; margin:7px 0 }
.duel-log li,.order-list li { padding:6px 0; color:#ded1c3; font-size:12px }
.log-head { display:flex; align-items:center; justify-content:space-between; padding-left:6px }
.duel-sheet { z-index:5; bottom:58px; padding:0; overflow:hidden; display:flex; flex-direction:column }
.sheet-head { display:flex; justify-content:space-between; align-items:center; padding:5px 7px 5px 9px; gap:6px; background:#2c241d; border-bottom:1px solid #63503d }
.sheet-head h2 { font:700 17px/1.25 var(--serif); color:#f1d6bc }
.sheet-content { padding:9px; overflow:auto; min-height:0; overscroll-behavior:contain }
.inspect-body { display:flex; align-items:start; gap:9px; min-width:0 }
.inspect-body .card-face { width:66px; flex:none }
.inspect-body h3 { font-size:14px }
.inspect-body p { font-size:12px; color:#d0c3b4; margin-top:5px }
.hand-list { display:grid; gap:5px }
.hand-list > div { display:flex; gap:5px }
.hand-list > div:empty { display:none }
.hand-list .hand-item { flex:1; justify-content:space-between; min-width:0; padding-inline:9px }
.hand-item small { color:#cebba6 }
[data-page="duel"] .site-foot { width:min(1540px,calc(100% - 4vw)) }
@media (max-width:1000px) {
  .duel-page { --rail:206px }
  .board-seat { grid-template-columns:77px minmax(0,1.4fr) minmax(0,1fr); gap:6px; padding-inline:4px }
  .seat-identity strong { font-size:12px }
  .zones { gap:3px; padding-left:4px }
  .equipment { gap:3px }
  .surface { padding:17px }
}
@media (max-width:850px) {
  .head-inner { gap:12px }
  .main-nav { gap:14px; font-size:13px }
  .brand { gap:6px }
  .head-actions .button { padding-inline:9px }
  .lobby-grid,.editor-grid { grid-template-columns:minmax(0,1fr) minmax(260px,.85fr) }
  .library-body { grid-template-columns:1fr }
  .library-preview { display:none }
}
@media (max-width:700px) {
  .head-inner { padding:0 14px; grid-template-columns:1fr auto; gap:0 7px; min-height:0 }
  .brand,.head-actions { min-height:56px }
  .main-nav { grid-row:2; grid-column:1/-1; justify-content:space-between; border-top:1px solid #302e2a; gap:8px }
  .main-nav a { min-height:44px; justify-content:center; padding:0 3px; font-size:13px }
  .brand b { font-size:19px }
  .brand em { font-size:11px; padding-left:5px }
  .head-actions { gap:4px }
  .head-actions .button { padding-inline:8px; font-size:12px }
  .head-actions .account { max-width:106px; white-space:nowrap; overflow:hidden; display:block; text-overflow:ellipsis }
  .page { width:calc(100% - 26px); margin:13px auto 30px }
  .arena-hero { min-height:272px; padding:25px 20px; border-radius:5px }
  .arena-hero::before { inset:0; background-position:center,64% 55%,center; background-image:linear-gradient(90deg,#211b17f2,#211b1797 40%,#211b1722 100%),url("assets/arena-lobby.png"),radial-gradient(ellipse at 84% 58%,#a36e4290,#403226 56%,#211b17 90%) }
  .hero-content h1 { font-size:51px; margin:12px 0 9px }
  .hero-content p { font-size:14px; margin-bottom:20px }
  .lobby-format { flex-direction:column; align-items:stretch; gap:9px; padding:15px 0 }
  .lobby-format > div:first-child { display:flex; justify-content:space-between; align-items:center; gap:5px }
  .lobby-format p { margin:0 }
  .format-option { flex:1; min-width:0 }
  .lobby-grid,.editor-grid,.prep-grid { grid-template-columns:1fr; gap:13px }
  .surface { padding:14px }
  .surface-head { margin-bottom:12px }
  .surface h2,.surface-head h2 { font-size:24px }
  .lookup .button { padding-inline:7px }
  .room-row { gap:7px; grid-template-columns:34px minmax(0,1fr) auto auto }
  .room-row .button { padding-inline:9px }
  .room-review { grid-template-columns:1fr }
  .review-actions { justify-content:flex-end }
  .title-row { flex-wrap:wrap; align-items:start; gap:11px; margin:17px 0 }
  .title-actions { justify-content:start }
  .prep-steps li { flex-direction:column; justify-content:center; gap:5px; text-align:center; padding:5px 2px; font-size:11px }
  .prep-steps li span { font-size:14px }
  .prep-steps { margin-bottom:12px }
  .prep-work { min-height:0 }
  .gear-picks { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px }
  .gear-choice .card-art { height:52px }
  .prep-deck .card-art { height:60px }
  .prep-opponent .rival-mark { display:none }
  .drawer-head { padding:14px }
  .drawer-body { padding:17px 14px 24px }
  .duel-page { width:calc(100% - 20px); margin-bottom:0; --bottom-controls:calc(63px + env(safe-area-inset-bottom,0px)) }
  .duel-top { min-height:42px; grid-template-columns:minmax(45px,1fr) auto auto; gap:6px; font-size:11px }
  .duel-top>div { gap:5px }
  .duel-top>div>span:last-child { display:none }
  .duel-layout { display:flex; flex-direction:column; gap:6px; padding:0 0 12px }
  .tabletop,.action-rail { display:contents }
  .foe-hand { order:0; height:31px; justify-content:flex-start; gap:7px; padding:0 8px }
  .foe-hand .card-back { width:19px }
  .foe-seat { order:1 }
  .combat { order:2; padding:6px; border:1px solid #67503c; border-radius:5px }
  .notice { order:3; min-height:62px; height:auto; padding:6px 8px }
  .action-body { position:fixed; inset:auto 7px calc(var(--bottom-controls) + 3px); z-index:3; padding:7px; border:1px solid #77573f; border-radius:5px; background:#27211d; }
  .self-seat { order:5 }
  .hand-area { order:6; min-height:141px; padding:3px 5px 6px; border:1px solid #3f3a30; border-radius:5px; background:#1d1f1d }
  .rail-bottom { order:7; display:flex; align-items:center; justify-content:space-between; width:100%; gap:8px }
  .rail-bottom .button { padding-inline:8px }
  .board-seat { min-height:101px; grid-template-columns:minmax(0,1fr) auto; gap:5px 4px; padding:5px 5px 5px; border:1px solid #4e4538; border-radius:5px; background:#1d201f }
  .seat-stats { gap:1px; align-self:start; padding-left:3px }
  .seat-identity { display:flex; align-items:baseline; gap:4px }
  .seat-identity strong { font-size:12px }
  .seat-values { display:flex; align-items:baseline; gap:4px; font-size:10px }
  .seat-values b { font-size:25px }
  .seat-values span:nth-child(n+3) { margin-left:4px }
  .equipment { display:none }
  .gear-mobile { display:inline-flex; font-size:11px; padding-inline:6px; gap:5px; min-width:95px }
  .zones { grid-column:1/-1; padding:0; border:0; gap:4px }
  .zone { min-height:44px; min-width:44px; display:flex; flex-direction:column; justify-content:center; gap:2px; color:#ddd0c0; border:1px solid #49473e; background:#272723; border-radius:3px }
  .zone.deck-zone { background:#302921; border-color:#74604a }
  .zone .zone-back,.zone .zone-mark { display:none }
  .zone > span:last-child { width:100%; min-width:0; display:grid; gap:2px; text-align:center; font-size:10px }
  .zone b { font:700 15px/1 var(--number) }
  .combat-header { margin-bottom:3px; padding-left:2px }
  .combat-header h2,.hand-head h2 { font-size:18px; padding-top:0 }
  .combat-header .button { display:inline-flex; font-size:11px; padding:0 6px }
  .chain-row { grid-template-columns:minmax(0,1fr) }
  .chain-prev { display:none }
  .chain-hit { grid-template-columns:47px minmax(0,1fr) minmax(74px,.48fr); padding:5px; gap:7px }
  .combat-card { width:47px; min-height:44px; gap:1px; padding:2px }
  .combat-card .card-name { font-size:9px }
  .combat-card .card-foot { font-size:8px }
  .chain-data h3 { font-size:17px; margin:2px 0 }
  .chain-data > span { font-size:11px }
  .atk-def { font-size:10px; gap:1px 7px }
  .atk-def b { font-size:13px }
  .chain-extra { padding-left:5px }
  .chain-extra span { font-size:10px }
  .chain-extra strong { font-size:12px }
  .notice .overline { display:none }
  .notice h2 { font-size:17px; margin:0 0 2px }
  .notice p { margin:0; line-height:1.45 }
  .action-body:empty,.action-body:has(.draft-tally) { display:none }
  .order-list { display:flex; gap:22px; margin:3px 0 }
  .hand-head { margin-bottom:4px; padding-left:1px }
  .hand-head .overline { display:none }
  .hand-head > div:last-child { display:flex; gap:3px }
  .hand-head .button { font-size:11px; padding-inline:7px; margin:0 }
  .hand-fan { gap:5px }
  .hand-card { width:min(81px,calc((100% - 15px) / 4)); max-width:none; padding:3px; gap:2px }
  .hand-card .card-name { font-size:10px }
  .hand-card .card-foot { font-size:9px }
  .hand-area.crowded .hand-fan { gap:0; padding:0 4px }
  .hand-area.crowded .hand-card { width:min(73px,calc((100% + 54px) / var(--n))); flex:none }
  .hand-area.crowded .hand-card + .hand-card { margin-left:-10px }
  .hand-area.crowded .hand-card[aria-pressed="true"] { z-index:auto }
  .duel-buttons { display:flex; position:fixed; left:0; right:0; bottom:0; align-items:stretch; flex-direction:row; justify-content:center; min-height:var(--bottom-controls); padding:7px max(10px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left)); z-index:6; background:#171817; border-top:1px solid #67503d; box-shadow:0 -4px 14px #0006 }
  .duel-buttons .button.primary { flex:1 }
  .duel-buttons .button { min-height:48px; padding-inline:10px }
  .duel-log,.duel-sheet { position:fixed; inset:auto 7px calc(var(--bottom-controls) + 3px); max-height:min(52dvh,440px); }
  .duel-sheet { border-radius:9px 9px 4px 4px }
  .sheet-content { padding:10px }
  .inspect-body .card-face { width:80px }
  [data-page="duel"] .site-foot { padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)); margin-bottom:var(--footer-space,67px) }
  [data-page="duel"] .toaster { top:8px; bottom:auto }
}
@media (max-width:350px) {
  .brand em,.head-actions .button span { display:none }
  .head-inner { padding-inline:10px }
  .head-actions .button { padding-inline:7px }
  .duel-page { width:calc(100% - 14px) }
  .zone { min-width:0 }
  .selected-detail { display:none }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition:none!important; animation:none!important }
}
