
#practiceMenu{margin-left:auto;position:relative;z-index:9800}
#practiceMenu>summary{cursor:pointer;padding:9px 18px;border:1px solid var(--duel-line);border-radius:8px;list-style:none;background:var(--duel-surface);color:var(--duel-text)}
.practice-menu-items{position:absolute;right:0;top:44px;width:min(300px,85vw);max-height:70dvh;overflow:auto;padding:12px;background:var(--duel-surface);border:1px solid var(--duel-line);border-radius:10px;box-shadow:0 10px 30px #0003;display:grid;gap:8px}
.practice-menu-items>button,.practice-menu-items>details{width:100%;text-align:left}
#practiceGuideLine{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0 12px;font-size:14px;color:var(--duel-muted)}
#practiceGuideLine button{flex:none;min-height:40px;padding:8px 20px}
.duel-prep-dialog [hidden]{display:none!important}
.duel-prep-dialog .duel-prep-grid{grid-template-columns:1fr!important}
.duel-prep-dialog .prep-deck-grid{max-height:45dvh;overflow:auto}
.duel-prep-dialog .prep-options{display:grid;gap:12px;border:0;padding:0}
.duel-prep-dialog .prep-options>label{display:flex;align-items:center;gap:10px;padding:14px;border:1px solid var(--duel-line,#68738a);border-radius:8px}
.duel-prep-dialog .prep-options>label:has(input:checked){background:var(--duel-raised,#252e43);outline:1px solid var(--duel-primary,#afc3f4)}
.prep-advanced{margin-top:18px;padding:12px 0;border-top:1px solid var(--duel-line,#68738a)}
.prep-advanced summary{cursor:pointer;margin-bottom:12px}
.prep-advanced section{display:grid;gap:8px;margin-bottom:16px}
.duel-prep-actions{position:sticky;bottom:0;background:var(--duel-surface,#151a28);padding:14px 0 0;display:flex;justify-content:flex-end;gap:8px}
@media(max-height:600px) and (orientation:landscape){#practiceGuideLine{padding:2px 0;font-size:12px}#practiceGuideLine button{min-height:32px;padding:4px 12px}.sim-heading:has(#practiceMenu){display:flex!important}.sim-heading-title{display:none!important}.duel-prep-dialog .prep-deck-grid{max-height:35dvh}}

.sim-heading>.session-actions:empty{display:none!important;margin:0!important}
html[data-theme="light"] .duel-prep-actions{background:#fff;color:#17243b}
html[data-theme="light"] .duel-prep-dialog .prep-options>label:has(input:checked){background:#e9eefb}

/* Simulator: use archive surfaces; keep controls outside the field on phones. */
body.sim-page{--duel-arena:#141a29;--duel-zone:#1d2638;--duel-zone-line:#465574;--duel-zone-inset:#ffffff03;--duel-action:#4059a4}
html[data-theme="light"] body.sim-page{--duel-arena:#e9edf6;--duel-zone:#f4f6fb;--duel-zone-line:#b3bed5;--duel-zone-inset:#ffffff26;--duel-action:#4059a4}
html.sim-compact body.sim-page .m-rail{display:none!important}
html.sim-compact body.sim-page #simDuelControls{flex-shrink:0;box-shadow:none;border:0}
html.sim-compact body.sim-page #simDuelControls>button{flex:1!important;min-width:40px!important;min-height:40px!important;flex-direction:row!important;padding:4px!important}
html.sim-compact body.sim-page #duelPlayers .duel-player{padding:4px 8px!important;min-height:32px!important}
html.sim-compact body.sim-page #duelPlayers .duel-player img{width:28px!important;height:28px!important}
html.sim-compact body.sim-page #duelPlayers .duel-player strong{font-size:15px!important}

html.sim-compact body.sim-page{width:var(--app-w)!important;height:var(--app-h)!important;max-width:none!important}
html.sim-compact body.sim-page #duelPlayers{overflow:hidden;flex-shrink:0;gap:6px!important}
html.sim-compact body.sim-page #duelPlayers #simEngineStatus{display:none!important}
html.sim-compact body.sim-page .sim-board-wrap{border:1px solid var(--duel-zone-line)!important}

html.sim-compact body.sim-page #simDuelControls{justify-content:center!important}
html.sim-compact body.sim-page #simDuelControls>button{max-width:112px!important}
html.sim-compact body.sim-page #duelPlayers .duel-hud{position:static!important;height:38px!important;min-height:0!important;padding:2px 8px!important;display:flex!important;align-items:center!important;gap:6px!important}
html.sim-compact body.sim-page #duelPlayers .hud-cover{width:30px!important;height:30px!important;min-height:0!important}
html.sim-compact body.sim-page #duelPlayers .hud-copy{display:flex!important;align-items:center!important;gap:8px!important}
html.sim-compact body.sim-page #duelPlayers .hud-copy button{font-size:16px!important;line-height:24px!important;min-height:24px!important;padding:0!important}
html.sim-compact body.sim-page #duelPlayers .hud-copy b{font-size:11px!important}

#duelPrepDialog [hidden]{display:none!important}
#duelPrepDialog{background:#151a26!important;color:#e7edf8}
html[data-theme="light"] #duelPrepDialog{background:#fff!important;color:#17243b}

/* Preparation uses the same deck objects and artwork as My Deck. */
#duelPrepDialog{width:min(740px,calc(100vw - 24px))!important;padding:0!important;max-height:92dvh!important}
#duelPrepDialog .duel-prep-box{padding:24px!important;max-width:none!important}
#duelPrepDialog header{display:flex;justify-content:space-between;align-items:flex-start}
#duelPrepDialog h2{font-size:22px;margin:8px 0}
#duelPrepDialog .duel-prep-lead{margin:0 0 24px;font-size:14px}
#duelPrepDialog .prep-options{display:grid!important;grid-template-columns:1fr;gap:10px;margin:0;padding:0;border:0}
#duelPrepDialog .prep-options>label{display:flex!important;justify-content:flex-start!important;align-items:center!important;width:100%!important;box-sizing:border-box;min-height:56px;padding:12px 16px!important;gap:12px!important;white-space:nowrap!important;word-break:keep-all!important;text-align:left!important}
#duelPrepDialog input[type=radio],#duelPrepDialog input[type=checkbox]{width:18px!important;height:18px!important;flex:0 0 18px!important;margin:0!important;padding:0!important}
#duelPrepDialog #prepHandCount{width:72px!important;flex:0 0 72px;min-height:40px}
#duelPrepDialog .prep-options>label:has(#prepHandCount){border:0;padding:0 16px 8px 46px!important;min-height:44px;background:transparent}
#duelPrepDialog .prep-advanced{margin-top:20px;padding-top:16px}
#duelPrepDialog .duel-prep-actions{display:flex;gap:10px;margin-top:24px;padding:16px 0 0;justify-content:flex-end}
#duelPrepDialog .duel-prep-actions button{width:auto!important;min-height:44px;justify-content:center;padding:10px 24px}
#duelPrepDialog #prepDeckGrid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-height:48dvh}
#duelPrepDialog .prep-deck-tile{display:flex!important;flex-direction:column!important;align-items:center!important;padding:10px!important;min-width:0;gap:6px;background:transparent;color:inherit;border:1px solid #56617a}
#duelPrepDialog .prep-deck-tile[aria-pressed=true]{border-color:#aebff0;background:#718ac21c}
#duelPrepDialog .prep-deck-tile .deck-visual{transform:scale(.8);transform-origin:top center;width:210px;height:176px;flex:none;margin:0 -24px}
#duelPrepDialog .prep-deck-tile strong{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
#duelPrepDialog .prep-deck-tile small{font-size:12px}
@media(max-width:600px){#duelPrepDialog .duel-prep-box{padding:16px!important}#duelPrepDialog #prepDeckGrid{grid-template-columns:repeat(2,minmax(0,1fr))}#duelPrepDialog .prep-deck-tile .deck-visual{transform:scale(.65);height:143px}#duelPrepDialog .prep-deck-tile .case-object{left:15px}#duelPrepDialog .representative-fan{left:0}}
#duelPrepDialog .case-base{width:100%;height:100%}
#duelPrepDialog .duel-prep-box{max-height:none!important;overflow:visible!important;border:0;box-shadow:none}
#duelPrepDialog .duel-prep-box>header{position:static!important;background:transparent!important}
#duelPrepDialog .duel-prep-actions{position:static!important;flex-direction:row!important;background:transparent}

/* One aligned setup surface, then a field-first play surface. */
.practice-empty .sim-heading{margin-bottom:24px!important;justify-content:space-between!important}
.practice-empty #practiceMenu{display:none!important}
#duelPrepDialog.prep-inline{position:relative!important;inset:auto!important;width:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;color:inherit}
#duelPrepDialog.prep-inline .duel-prep-box{padding:0!important;background:transparent!important}
#duelPrepDialog.prep-inline #duelPrepClose{display:none!important}
#duelPrepDialog.prep-inline #prepDeckGrid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important;max-height:none!important;overflow:visible}
#duelPrepDialog.prep-inline .duel-prep-grid{display:block!important}
#duelPrepDialog.prep-inline .duel-prep-grid>section>b,#duelPrepDialog.prep-inline #duelPrepMeInfo{display:none}
#duelPrepDialog.prep-inline #prepSearch{max-width:360px;margin:0 0 20px}
#duelPrepDialog.prep-inline .duel-prep-actions{border-top:1px solid var(--duel-line);margin-top:24px;justify-content:flex-end}
#duelPrepDialog.prep-inline .duel-prep-lead{margin-bottom:20px}
#duelPrepDialog .prep-deck-tile{border-radius:12px!important}
#practiceMenu{margin-left:auto;position:relative}
#practiceMenu>.practice-menu-items{position:absolute;right:0;top:calc(100% + 8px);width:240px;z-index:9800}
#practiceMenu .practice-menu-items>details{padding:8px;border-top:1px solid var(--duel-line)}
#practiceMenu .practice-menu-items>details button{display:block;width:100%;margin-top:6px}
.practice-empty .sim-board-wrap,.practice-empty #duelQuickPhase{display:none!important}
@media(max-width:600px){.practice-empty .sim{padding:16px!important}#duelPrepDialog.prep-inline #prepDeckGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}}

#duelPrepDialog.prep-inline .duel-prep-grid>section{border:0;background:transparent;padding:0}
#duelPrepDialog .duel-prep-actions button{flex:0 0 auto!important;width:auto!important;min-width:120px}
#duelPrepDialog #duelPrepEditMe{width:auto!important;padding:10px 18px;margin-top:16px}
#duelPrepDialog .prep-deck-tile{overflow:hidden}
#duelPrepDialog.prep-inline .prep-deck-tile .deck-visual{margin-top:10px}

/* Compact choices: content-sized controls, no accordion for basic setup. */
#duelPrepDialog[data-step="2"]{width:min(560px,calc(100vw - 24px))!important}
#duelPrepDialog .prep-options{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px!important}
#duelPrepDialog .prep-options legend{display:none}
#duelPrepDialog .prep-options>label{width:auto!important;min-height:40px!important;padding:8px 12px!important;gap:8px!important;flex:0 0 auto!important}
#duelPrepDialog .prep-options>label:has(#prepHandCount){padding:0!important;margin-left:4px}
#duelPrepDialog #prepHandCount{width:60px!important;flex-basis:60px;min-height:40px}
#duelPrepDialog .prep-advanced{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:20px;padding-top:16px;border-top:1px solid var(--duel-line)}
#duelPrepDialog .prep-advanced>section{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;padding:0!important;border:0!important;background:transparent!important;width:100%}
#duelPrepDialog .prep-advanced>section>b{font-size:13px}
#duelPrepDialog .prep-advanced>section>b i,#duelPrepDialog .prep-advanced>section>small,#duelPrepDialog #duelPrepOpInfo{display:none}
#duelPrepDialog #duelPrepOp{flex:1;min-width:120px;width:auto!important}
#duelPrepDialog #duelPrepEditOp{width:auto!important;padding:8px 12px!important}
#duelPrepDialog .prep-advanced>label{display:flex;gap:8px;align-items:center;width:auto!important}
#duelPrepDialog .prep-advanced>p{font-size:12px;margin:0;color:var(--muted);flex-basis:100%}
#duelPrepDialog #duelPrepEditMe{justify-self:start!important;align-self:start!important;display:inline-flex!important;width:fit-content!important;max-width:100%;min-width:0!important}
#duelPrepDialog .duel-prep-actions{margin-top:20px!important;padding-top:12px!important}
#duelPrepDialog[data-step="2"] .duel-prep-box{min-height:0!important}
#duelPrepDialog[data-step="2"] #prepPage2{min-height:0!important}
#duelPrepDialog .prep-options>label[hidden]{display:none!important}
