#worldMenu.world-deck-active {
  --wd-paper:#efe3cd;
  --wd-ink:#272c2f;
  --wd-muted:#625b52;
  --wd-dark:#252b2e;
  --wd-light:#faefdd;
  --wd-gold:#d6a76a;
  background:var(--wd-paper); font-family:system-ui,sans-serif;
}
.world-deck-active > :is(.world-header,#worldTabs) { display:none !important; }
#worldMenu.world-deck-active #worldContent { display:flex; min-height:0; overflow:hidden; padding:0; }
#worldMenu.world-deck-active #worldNotice:not(:empty) { background:var(--wd-dark); }
.wd-screen {
  width:100%; min-height:0; display:flex; flex-direction:column; color:var(--wd-ink);
  background:linear-gradient(90deg,#e9d9bd 0 10px,transparent 10px calc(100% - 10px),#e9d9bd calc(100% - 10px));
  --wd-gutter:clamp(12px,5vw,20px);
}
.wd-header {
  display:flex; align-items:flex-start; gap:12px; padding:calc(17px + env(safe-area-inset-top)) var(--wd-gutter) 20px;
  background:var(--wd-dark) url('assets/deck-ui/header.png') center bottom / 100% 100% no-repeat;
  color:var(--wd-light);
}
#worldContent .wd-header h1 { margin:0; font-family:serif; font-size:clamp(1.3rem,6.5vw,1.75rem); line-height:1.35; }
.wd-header > div { flex:1; min-width:0; }
.wd-deck-select { display:block; margin-top:2px; }
#worldMenu .wd-deck-select select {
  max-width:100%; background:var(--wd-dark); color:#efce9c; border:0; font-size:.9rem; font-weight:bold;
}
#worldMenu .wd-button {
  font:inherit; min-width:44px; min-height:44px; padding:2px 6px; border:0; border-radius:6px;
  background:var(--wd-button-color,#efdfc3) var(--wd-skin,none) center / 100% 100% no-repeat;
  color:var(--wd-button-text,#272c2f); box-shadow:none; cursor:pointer;
}
#worldMenu .wd-button[aria-disabled="true"] {
  --wd-button-color:#e3d8c7; --wd-skin:url('assets/deck-ui/add_disabled.png'); --wd-button-text:#625548;
  cursor:default; font-size:.625rem; padding-inline:1px;
}
#worldMenu .wd-button:focus-visible, .wd-dock:focus-visible { outline:2px solid #3b73a0; outline-offset:2px; }
.wd-back { --wd-skin:url('assets/deck-ui/icon_back.png'); --wd-button-color:#3c4341; width:44px; }
.wd-close { --wd-skin:url('assets/deck-ui/icon_close.png'); --wd-button-color:#3c4341; width:44px; }
.wd-copy { align-self:center; --wd-skin:url('assets/deck-ui/detail_button.png'); }
.wd-tools { flex:none; padding:12px var(--wd-gutter) 2px; }
.wd-search-line { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:10px; }
.wd-search-line label { min-width:0; }
#wdSearch {
  box-sizing:border-box; width:100%; min-height:44px; padding:0 10px 0 39px; border:0; border-radius:8px;
  background:#fbf3e4 url('assets/deck-ui/search_field.png') left center / 100% 100% no-repeat; color:var(--wd-ink);
  font:inherit; font-size:16px;
}
#wdSearch::placeholder { font-size:.84rem; color:var(--wd-muted); }
.wd-filter { --wd-skin:url('assets/deck-ui/filter_button.png'); }
.wd-chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
#worldMenu .wd-chip { --wd-skin:url('assets/deck-ui/chip_72.png'); font-size:.78rem; padding:2px 8px; }
#worldMenu .wd-chip.wd-active {
  --wd-button-color:#a64031; --wd-skin:url('assets/deck-ui/chip_72_active.png'); --wd-button-text:#fff5e5;
  background:var(--wd-button-color) var(--wd-skin) center / 100% 100% no-repeat;
}
.wd-list-header { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.wd-tools .wd-list-header { padding-top:8px; margin-top:6px; border-top:1px solid #cbb99a; }
.wd-list-header span { font-size:.75rem; }
#worldContent .wd-list-header h2, .wd-list-header h3 { font-size:1rem; margin:0; }
.wd-results { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px var(--wd-gutter) 12px; }
.wd-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.wd-empty { grid-column:1/-1; }
.wd-card {
  position:relative; min-width:0; padding:4px 4px 6px; border:1px solid #b69e7c; border-radius:8px;
  background:#faf0df; display:flex; flex-direction:column;
}
.wd-card-art,.wd-detail-art,.wd-row-art { position:relative; overflow:hidden; background:#dfcfb2; }
.wd-card-art { aspect-ratio:163/133; border-radius:4px 4px 0 0; border-bottom:1px solid #bfa183; }
.wd-art { width:100%; height:100%; display:block; object-fit:cover; object-position:center 14%; }
.wd-cost {
  position:absolute; top:5px; left:5px; width:30px; height:30px; display:grid; place-items:center; color:#fff7e7;
  background:#273f47 url('assets/deck-ui/cost_badge.png') center / contain; border-radius:8px; font-weight:bold;
}
.wd-card strong { display:block; padding:4px 4px 0; font-size:.86rem; line-height:1.35; overflow-wrap:anywhere; }
.wd-card small { display:flex; flex-wrap:wrap; justify-content:space-between; gap:0 4px; padding:2px 4px 4px; font-size:.69rem; color:var(--wd-muted); }
.wd-card-actions { margin-top:auto; border-top:1px solid #dbc6a8; padding:4px 2px 0; display:grid; gap:5px; grid-template-columns:minmax(0,1fr) 44px; }
.wd-detail { --wd-skin:url('assets/deck-ui/detail_button.png'); }
.wd-add { --wd-skin:url('assets/deck-ui/add.png'); --wd-button-color:#a64031; --wd-button-text:transparent; }
.wd-remove { --wd-skin:url('assets/deck-ui/remove_dark.png'); --wd-button-color:#3c4341; --wd-button-text:transparent; }
#worldMenu .wd-dock {
  flex:none; display:grid; align-items:center; grid-template-columns:auto 1fr auto; gap:7px 12px;
  min-height:88px; border:0; border-top:2px solid var(--wd-gold); border-radius:0;
  background:var(--wd-dark); color:var(--wd-light); font:inherit; text-align:left; cursor:pointer;
  padding:10px var(--wd-gutter) calc(12px + env(safe-area-inset-bottom));
}
.wd-dock-icon,.wd-dock-arrow {
  width:44px; height:44px; background-image:url('assets/deck-ui/deck_dock.png'); background-repeat:no-repeat; background-size:390px 98px;
}
.wd-dock-icon { height:52px; background-position:-20px -12px; }
.wd-dock-arrow { background-position:-326px -14px; }
.wd-dock-info { display:grid; gap:1px; min-width:0; font-size:.86rem; }
.wd-dock-info b { font-size:1.4rem; padding-inline:7px 3px; }
.wd-dock-info small { color:#efcc9c; font-size:.74rem; overflow-wrap:anywhere; }
.wd-progress { grid-column:1/-1; height:4px; border-radius:2px; background:#555c53 url('assets/deck-ui/progress_track.png') center / 100% 100%; overflow:hidden; }
.wd-progress span { display:block; height:100%; background:var(--wd-gold) url('assets/deck-ui/progress_fill.png') left / 100% 100%; }
#worldDeckPanel {
  box-sizing:border-box; position:fixed; inset:auto 0 0; margin:0 auto; width:min(100%,640px); max-width:none;
  max-height:calc(100dvh - max(12px,env(safe-area-inset-top))); padding:0; border:1px solid var(--wd-gold); border-bottom:0; border-radius:16px 16px 0 0;
  background:var(--wd-dark); color:var(--wd-light); overflow:hidden;
}
#worldDeckPanel[open] { display:flex; flex-direction:column; }
#worldDeckPanel::backdrop { background:rgb(18 21 22 / .59); }
.wd-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:17px 18px 8px; position:relative; }
.wd-panel-head::before { content:''; position:absolute; width:38px; height:3px; border-radius:2px; top:7px; left:calc(50% - 19px); background:#a49476; }
.wd-panel-head h2,.wd-detail-name { font:700 1.45rem/1.35 serif; margin:0; }
.wd-panel-body { overflow:auto; overscroll-behavior:contain; padding:0 18px calc(20px + env(safe-area-inset-bottom)); }
.wd-sheet-sub { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; margin:0 0 12px; font-size:.82rem; color:#e3ccaa; }
.wd-sheet-sub b { color:var(--wd-light); }
.wd-summary,.wd-effect { background:#303837; border:1px solid #565a4a; border-radius:8px; padding:10px 12px; }
.wd-summary { margin-bottom:12px; }
.wd-summary h3,.wd-effect h4 { margin:0 0 5px; font-size:.83rem; }
.wd-chart { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.wd-bucket { height:68px; display:grid; grid-template-rows:50px 18px; align-items:end; text-align:center; font-size:.72rem; border-bottom:1px solid #55594d; }
.wd-bar { position:relative; align-self:end; height:max(1px,calc(var(--bar) * .71)); border-radius:3px 3px 0 0; background:#79a197; }
.wd-bucket:nth-child(3) .wd-bar { background:#d5a16b; }
.wd-bar span { position:absolute; left:0; right:0; bottom:100%; color:var(--wd-light); }
.wd-composition { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 10px; padding-top:8px; font-size:.76rem; }
.wd-deck-rows { display:grid; gap:6px; max-height:min(31dvh,265px); overflow:auto; margin-top:6px; overscroll-behavior:contain; }
.wd-row {
  display:grid; align-items:center; grid-template-columns:38px minmax(0,1fr) 44px 16px 44px; gap:5px;
  min-height:56px; padding:4px; border-radius:8px; border:1px solid #4c534b; background:#303837;
}
.wd-row-art { height:44px; border-radius:4px; }
.wd-row-art .wd-cost { width:24px; height:24px; font-size:.8rem; top:2px; left:2px; }
.wd-row strong,.wd-row small { display:block; overflow-wrap:anywhere; }
.wd-row strong { font-size:.82rem; }
.wd-row small { font-size:.7rem; color:#d9c8a9; }
.wd-row > b { text-align:center; font-size:.8rem; }
.wd-status { padding:7px 10px; border-radius:5px; background:#443730; color:#f1c997; font-size:.82rem; }
.wd-status::before { content:'◆'; margin-right:8px; color:var(--wd-gold); }
#worldMenu .wd-wide {
  --wd-button-color:#a64031; --wd-skin:url('assets/deck-ui/primary_wide.png'); --wd-button-text:#fff4e1;
  width:100%; font-weight:bold; min-height:48px;
}
#worldMenu .wd-wide[aria-disabled="true"] { font-size:.87rem; }
.wd-detail-art { height:min(26dvh,205px); border-bottom:2px solid var(--wd-gold); margin:2px 0 12px; }
.wd-detail-name { margin-bottom:6px; }
.wd-effect h4 { color:var(--wd-gold); }
.wd-effect p { margin:0; white-space:pre-line; font-size:.88rem; }
.wd-detail-count { font-size:.87rem; color:#e9d5b5; }
.wd-panel-body fieldset { border:0; margin:0 0 12px; padding:0; }
.wd-panel-body legend,.wd-keyword { font-size:.84rem; font-weight:bold; }
.wd-keyword { display:grid; gap:4px; margin:0 0 12px; }
.wd-keyword select { color:var(--wd-ink); background:#f2e2c6; border:1px solid #bba07c; border-radius:6px; padding:4px 8px; }
#worldMenu .wd-clear { background:transparent; color:#e7caa0; display:block; margin:1px auto 0; font-size:.84rem; }
.wd-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@media (min-width:530px) {
  .wd-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
