/* U136: settings shell; game layout follows in separate checkpoints. */
.settings-open { min-width: 44px; min-height: 44px; font-size: 24px; }
.game-settings { color: var(--ink); background: var(--panel); border: 1px solid var(--gold); border-radius: 14px; width: min(540px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 20px; overflow: auto; font-size: 16px; }
.game-settings::backdrop { background: #081015b8; }
.game-settings header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.game-settings h2 { margin: 0; font: 24px var(--font-title); }
.game-settings h3 { margin: 20px 0 10px; font-size: 16px; color: var(--gold); }
.game-settings p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.game-settings button, .game-settings select { min-height: 44px; font-size: 16px; }
.game-settings .settings-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.game-settings .settings-view-control { flex: 1 1 100%; display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; padding: 8px; text-align: left; }
.game-settings .settings-view-control .card-view-heading { align-self: center; color: var(--gold); font-weight: 700; }
.game-settings .settings-view-control [data-card-view] { display: flex; min-height: 48px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 7px 10px; text-align: left; }
.game-settings .settings-view-control [data-card-view] small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.game-settings .settings-view-control [data-card-view].active { color: var(--ink); border-color: var(--gold); background: rgba(199,164,92,.16); box-shadow: 0 0 0 1px rgba(199,164,92,.25); }
@media (max-width: 560px) { .game-settings .settings-view-control { grid-template-columns: 1fr; } }
.game-settings label { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: normal; }
.game-settings .locale-switcher { flex-wrap: wrap; }
.game-settings select { max-width: 100%; }
:root {
  --font-ui: "Segoe UI", system-ui, sans-serif;
  --font-title: Georgia, serif;
  --text-xs: .60rem;
  --text-sm: .72rem;
  --text-md: .88rem;
  --text-title: 1.1rem;
  --ink: #ece5d8;
  --muted: #bbb2a5;
  --paper: #171916;
  --panel: #20231f;
  --panel-2: #292c27;
  --lacquer: #8d2525;
  --lacquer-hi: #c24838;
  --gold: #c7a45c;
  --green: #355c4b;
  --line: rgba(226, 210, 180, .19);
  --cream-card: linear-gradient(145deg,#e2d2b2,#c8ae82);
  --shadow: 0 20px 50px rgba(0, 0, 0, .32);
  font-family: var(--font-ui);
  color: var(--ink);
  background: #0f110f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(141,37,37,.25), transparent 38rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px),
    #111310;
  background-size: auto, 22px 22px, 22px 22px, auto;
}
button, input, select { font: inherit; }
button, select, input[type="number"] {
  color: var(--ink);
  background: #151713;
  border: 1px solid var(--line);
  border-radius: 8px;
}
button { cursor: pointer; padding: .65rem .9rem; }
button:hover { border-color: var(--gold); }
.match-id-badge { display: block; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .12rem .35rem; border: 0; background: transparent; color: var(--muted); font-size: .62rem; text-align: left; }
.match-id-badge:hover { color: var(--gold); }
.debug-runtime-summary { margin: .55rem 0; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .76rem; line-height: 1.45; background: rgba(0,0,0,.16); }
.debug-runtime-summary strong { color: var(--gold); }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }
.move-card-outgoing,.move-card-subject { outline:3px dashed #ffb6a1!important; outline-offset:3px; }
.action-trajectory-layer { z-index:10000; }
body:has(.motion-route-layer .trajectory-stroke) .action-trajectory-layer[data-arrow-context="preview"] { visibility:hidden; }
:is(.motion-route-layer,.supply-flow-layer,.banner-award-route) { z-index:10003; }
:is(.action-trajectory-layer,.motion-route-layer,.supply-flow-layer,.banner-award-route) {
  position:fixed; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible;
}
.trajectory-line {
  fill:none; stroke:currentColor; stroke-width:5; stroke-dasharray:13 8; stroke-linecap:round;
  filter:drop-shadow(0 1px 1px #151611);
  animation:trajectory-flow 650ms ease-out both;
}
.trajectory-line.token-route { stroke-dasharray:3 8; }
.trajectory-line.token-stolen-route { stroke-dasharray:13 6 3 6; }
.trajectory-line.banner-route { stroke-width:6; stroke-dasharray:18 7; }
.trajectory-line.invalid-attach-route { stroke-dasharray:3 8; opacity:.65; }
.trajectory-tip,.trajectory-ribbon,.trajectory-brush { fill:currentColor; }
.trajectory-tip { stroke:#181512; stroke-width:.8; stroke-linejoin:round; }
.trajectory-origin { fill:#1d211f; stroke:currentColor; stroke-width:2.5; }
.trajectory-ribbon,.trajectory-brush,.trajectory-pigment { display:none; }
:is([data-arrow-style="solid"], [data-arrow-style="auto"] [data-arrow-context="execution"]) {
  --trajectory-line-display:none;
  --trajectory-ribbon-display:inline;
  --trajectory-opacity:.56;
}
:is([data-arrow-style="brush"], [data-arrow-style="auto"] [data-arrow-context="incoming"]) {
  --trajectory-line-display:none;
  --trajectory-ribbon-display:none;
  --trajectory-brush-display:inline;
  --trajectory-pigment-display:inline;
  --trajectory-outline-display:none;
  --trajectory-opacity:.63;
}
:is([data-arrow-style="brush"], [data-arrow-style="auto"] [data-arrow-context="incoming"]) [data-trajectory-short="true"] {
  --trajectory-ribbon-display:inline;
  --trajectory-brush-display:none;
  --trajectory-pigment-display:none;
  --trajectory-outline-display:inline;
  --trajectory-opacity:.56;
}
.trajectory-stroke { opacity:var(--trajectory-opacity,.66); }
.trajectory-line { display:var(--trajectory-line-display,inline); }
.trajectory-ribbon { display:var(--trajectory-ribbon-display,none); }
.trajectory-brush { display:var(--trajectory-brush-display,none); }
.trajectory-pigment { display:var(--trajectory-pigment-display,none); }
.pigment-source { opacity:.62; }
.pigment-target { opacity:.42; }
.trajectory-outline .trajectory-endpoint { display:var(--trajectory-outline-display,inline); }
.trajectory-endpoint {
  fill:none; stroke-width:2; stroke-dasharray:5 4;
  filter:drop-shadow(0 1px 2px #151611);
}
@keyframes trajectory-flow { from { stroke-dashoffset:26; } to { stroke-dashoffset:0; } }
@media (prefers-reduced-motion: reduce) { .trajectory-line { animation:none; } }
.set.move-subject-set,.set.move-related-set { outline:3px dashed #ffb6a1!important; outline-offset:4px; }
.move-execution-source { outline:3px dashed #ffb6a1!important; outline-offset:4px; }
.move-execution-target,.action-route-target { outline:3px dashed #ffb6a1!important; outline-offset:4px; }
.action-route-kind-draw,.move-execution-source.action-route-kind-draw,.move-execution-target.action-route-kind-draw { outline-color:#67c9e7!important; }
.action-route-kind-turn,.move-execution-source.action-route-kind-turn,.move-execution-target.action-route-kind-turn { outline-color:#e6c66e!important; }
.action-route-kind-support,.move-execution-source.action-route-kind-support,.move-execution-target.action-route-kind-support { outline-color:#83c9a2!important; }
.action-route-kind-token,.move-execution-source.action-route-kind-token,.move-execution-target.action-route-kind-token { outline-color:#e7c96d!important; }
.action-route-kind-token-stolen,.move-execution-source.action-route-kind-token-stolen,.move-execution-target.action-route-kind-token-stolen { outline-color:#ef8f70!important; }
.trajectory-outlined:is(.move-execution-source,.move-execution-target,.action-route-target,.move-subject-set,.move-related-set,.move-card-subject,.move-card-outgoing,.exchange-preview-source,.draw-preview-slot) {
  outline-color:transparent!important;
}
.action-preview-slot:not(.new-set-preview) { display:inline-flex; flex:0 0 100px; min-height:52px; align-items:center; justify-content:center; border-radius:7px; color:#ffb6a1; background:rgba(255,182,161,.08); font-size:11px; pointer-events:none; }
button.action-preview-slot:enabled { pointer-events:auto; cursor:pointer; }
.new-set-preview { position:relative; opacity:.84; }
.new-set-preview .confirm-preview-set { position:absolute; inset:0; width:100%; height:100%; background:transparent; border:0; cursor:pointer; padding:0; }
.new-set-preview .confirm-preview-set:focus-visible { outline:2px solid #ffe6aa; outline-offset:-2px; }
.new-set-preview .set-kamons > [data-card-name] { opacity:.65; }
.layout-v2 .player .set-zone .sets:has(> .new-set-preview) > .no-sets { display:none; }
.draw-preview-slot { outline:3px dashed #ffb6a1; outline-offset:2px; align-self:center; flex:0 0 90px; min-height:130px; box-sizing:border-box; }
.draw-preview-slot.covered-hand-slot { flex-basis:28px; min-height:38px; font-size:9px; }
.hand-preview-slot {
  display:grid; place-items:center; align-self:center; order:9999;
  flex:0 0 clamp(52px, 13%, 112px); height:clamp(56px, 13vh, 132px);
  box-sizing:border-box; border-radius:7px; padding:4px; text-align:center;
  visibility:hidden; pointer-events:none; background:rgba(255,182,161,.08); color:#ffb6a1; font-size:11px;
}
.hand-preview-slot.action-route-target { visibility:visible; }
.exchange-preview-source { outline:3px dashed #ffb6a1!important; outline-offset:3px; }
.card.set-compatible-card { border-color:#83c9ba!important; box-shadow:0 0 0 2px #83c9ba88!important; }
.set.set-filter-selected { outline:3px dashed #83c9ba!important; outline-offset:4px; background-color:#83c9ba22; }
.card.set-filter-unavailable:not(.selection-glow) { opacity:.45; }
.set-target-summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 10px; margin-bottom:8px; border:1px solid #83c9ba; border-radius:7px; color:#b4e8dc; font-size:12px; }
.action-button.touch-preview-armed { outline:2px solid white; outline-offset:-2px; }
.action-touch-confirm { display:block; color:#fff0cf; font-weight:700; }
.action-button.selection-incomplete { opacity:.72; border-style:dashed; }
.selection-missing { color:#ffe5aa; font-weight:700; }
.selection-command-strip { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.selection-command-strip>strong { flex-basis:100%; color:var(--muted); font:600 12px var(--font-ui); }
.selection-command-strip>.action-button { flex:0 1 auto; max-width:100%; }
.turn-command-strip > .action-button {
  flex:1 1 11rem; min-height:44px; height:auto; padding:.6rem .85rem;
  text-align:center; white-space:normal;
  border-color:color-mix(in srgb,var(--turn-command-accent) 45%,var(--line));
  background:color-mix(in srgb,var(--turn-command-accent) 12%,#20231f);
}
.turn-command-support { --turn-command-accent:#e8c65d; }
.turn-command-end { --turn-command-accent:#ed8159; }
.turn-command-strip > .action-button:not(:disabled):is(:hover,:focus-visible) {
  border-color:var(--turn-command-accent);
  background:color-mix(in srgb,var(--turn-command-accent) 22%,#20231f);
}
.turn-command-strip > .action-button:disabled { opacity:.55; }
#selectionDisplayMode { min-width:0; max-width:110px; padding:3px 5px; font-size:12px; }
#actionSelectionReset { padding:4px 6px; font-size:12px; }

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 clamp(.75rem, 2vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(15,17,15,.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
/* The view switch is relocated to Settings during boot. Keep its source
   placeholder out of the topbar so the unstyled control cannot flash there. */
.topbar #cardViewToggle { display: none; }
.brand { flex: 0 0 auto; display: flex; align-items: center; gap: .85rem; }
.brand .mon {
  width: 36px; height: 36px; display: grid; place-items: center;
  color: #fff8e8; background: var(--lacquer); border: 2px solid var(--gold);
  border-radius: 50%; font-family: Georgia, serif; font-size: 1.38rem;
  box-shadow: inset 0 0 0 4px #6d1c1c;
}
.brand h1 { margin: 0; font: 600 1.22rem Georgia, serif; letter-spacing: .11em; }
.brand p { margin: .08rem 0 0; color: var(--muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.status { flex: 0 0 auto; color: var(--muted); font-size: .68rem; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #937546; box-shadow: 0 0 0 4px rgba(199,164,92,.08); }
.status.online i { background: #6fa87e; }

main { width: min(1800px, 98vw); margin: .35rem auto 2rem; }
#tableViewport { display:flow-root; }
#tableViewport.minizoom-active { overflow:clip; }
.mode-tabs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .18rem; margin-left: .65rem; }
.mode-tabs > button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  margin: 0;
  padding: .28rem .46rem;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  border-color: var(--line);
  border-radius: 7px;
  font-size: .62rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.mode-tabs > button:hover { color: var(--ink); background: rgba(199,164,92,.08); border-color: rgba(199,164,92,.48); }
.mode-tabs > .setup-open { color: #fff2df; background: var(--lacquer); border-color: #ae3630; }
.mode-tabs > .setup-open:hover { color: #fff; background: var(--lacquer-hi); border-color: #d6594e; }
.setup-count { min-width: 1.1rem; padding: .12rem .25rem; border-radius: 999px; color: #2a180d; background: var(--gold); font-size: .55rem; text-align: center; }
.tab { background: transparent !important; border-color: transparent !important; }
.tab.active { color: var(--ink); background: var(--panel) !important; border-color: var(--line) !important; }
.card-view-toggle strong { color: #ead194; font-size: inherit; }
.view-switch { width: 25px; height: 14px; flex: 0 0 auto; padding: 2px; border: 1px solid rgba(199,164,92,.46); border-radius: 999px; background: #22251f; }
.view-switch i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #a79c87; transition: transform .16s ease-out, background .16s; }
.card-view-toggle[aria-pressed="true"] { color: #e8ddb9; border-color: rgba(146,212,182,.58); background: rgba(146,212,182,.08); }
.card-view-toggle[aria-pressed="true"] .view-switch i { transform: translateX(11px); background: #92d4b6; }
.assist-toggle { flex: 0 0 auto; }
.variants-toggle, .metrics-toggle { flex: 0 0 auto; color: #edcf8d; border-color: rgba(199,164,92,.34); }
.modifier-hover-popup {
  position: fixed; z-index: 240; width: min(348px, calc(100vw - 20px)); max-height: min(370px, 62vh);
  display: none; overflow-y: auto; padding: .62rem; color: var(--ink);
  background: rgba(20,24,20,.98); border: 1px solid rgba(199,164,92,.64); border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0,0,0,.48); pointer-events: auto;
}
.modifier-hover-popup.is-visible { display: block; }
.modifier-hover-head { display:flex; align-items:baseline; justify-content:space-between; gap:.6rem; padding-bottom:.38rem; margin-bottom:.35rem; border-bottom:1px solid rgba(199,164,92,.28); }
.modifier-hover-head strong { color:#f2d79d; font:600 .78rem Georgia,serif; }
.modifier-hover-head small, .modifier-hover-pending>small { color:var(--muted); font-size:.55rem; }
.modifier-hover-list { display:grid; gap:.22rem; }
.modifier-hover-pending { margin-top:.55rem; padding-top:.45rem; border-top:1px solid rgba(199,164,92,.4); }
.modifier-hover-pending>strong { display:block; color:#f0c978; font-size:.64rem; }
.modifier-hover-pending>.modifier-hover-list { margin-top:.25rem; }
.assist-toggle strong { color: #9fd6b7; }
.assist-toggle[aria-pressed="false"] strong { color: #d8b45d; }
.guide-toggle { margin-left: .08rem !important; color: #f0d59d; background: rgba(199,164,92,.055) !important; border-color: rgba(199,164,92,.34) !important; }
.guide-toggle span { margin-left: .35rem; padding: .1rem .34rem; color: #221b0c; background: var(--gold); border-radius: 999px; font-size: .58rem; white-space: nowrap; }
.sound-toggle { flex: 0 0 auto; color: var(--gold); }
.sound-toggle[aria-pressed="false"] { color: var(--muted); opacity: .75; }
#gameAssistsToggle[aria-pressed="true"] { border-color:var(--gold); color:var(--gold); }
.no-assists #attachMapToggle,
.no-assists .moves-button,
.no-assists .relative-score,
.no-assists .action-score,
.no-assists .action-reason { display: none !important; }
/* No aids removes explanations and filters, never the executable action rows. */
.no-assists #legalActions .action-button,
.no-assists #legalActions [data-action] { pointer-events: auto; }
.locale-switcher { margin-left: auto; display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .62rem; }
.locale-switcher select { height: 29px; padding: 0 .42rem; color: #f0d59d; background: rgba(199,164,92,.07); border-color: rgba(199,164,92,.32); font-size: .65rem; }
.connection-legend { display: none; flex: 1 1 500px; min-width: 300px; min-height: 28px; align-items: center; gap: .36rem; margin-left: .12rem; padding: .14rem .3rem; overflow-x: auto; color: var(--muted); background: rgba(26,31,26,.94); border: 1px solid rgba(146,212,182,.25); border-radius: 7px; font-size: .5rem; scrollbar-width: none; }
.connection-legend::-webkit-scrollbar { display: none; }
.connection-view .connection-legend { display: flex; }
.connection-legend > strong { color: #b5ecd3; font-size: .52rem; white-space: nowrap; }
.legend-axis { display: flex; align-items: center; gap: .14rem; white-space: nowrap; }
.legend-axis > b { margin-right: .06rem; color: #ded2b9; font-size: .49rem; }
.tag-swatch { padding: .08rem .2rem; border: 1px solid rgba(0,0,0,.24); border-radius: 4px; color: #231f18; font-size: .49rem; font-style: normal; font-weight: 750; white-space: nowrap; }

.control-panel {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: .42rem;
  padding: .24rem .5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 10px;
  box-shadow: var(--shadow);
}
.control-panel label { color: var(--muted); font-size: .62rem; letter-spacing: .04em; display: flex; align-items: center; gap: .32rem; white-space: nowrap; }
.control-panel select, .control-panel input[type="number"] { min-width: 165px; height: 29px; padding: 0 .55rem; }
.control-panel > button { height: 29px; padding: .2rem .65rem; }
#newSession { min-width: 86px; padding-inline: .5rem; font-size: .67rem; line-height: 1; white-space: nowrap; }
.random-session { min-width: 102px; padding-inline: .5rem; color: #f0d59d; border-color: rgba(199,164,92,.42); font-size: .64rem; line-height: 1; white-space: nowrap; }
.replay-file { width: 145px; color: var(--muted); font-size: .56rem; }
.replay-file::file-selector-button { height: 25px; margin-right: .35rem; color: var(--ink); background: #151713; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.primary { color: #fff; background: var(--lacquer); border-color: #ae3630; font-weight: 650; }
.primary:hover { background: var(--lacquer-hi); }
.transport { flex: 1; display: grid; grid-template-columns: auto auto auto minmax(100px,1fr) auto; align-items: center; gap: .35rem; margin-left: .5rem; }
.lineup-picker { position: relative; align-self: center; color: var(--muted); font-size: .68rem; }
.lineup-picker summary { min-width: 180px; height: 29px; display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: 0 .55rem; border: 1px solid var(--line); border-radius: 6px; background: #171915; cursor: pointer; list-style: none; }
.lineup-picker summary::-webkit-details-marker { display: none; }
.lineup-picker summary::after { content: "▾"; color: var(--gold); }
.lineup-picker[open] summary::after { content: "▴"; }
.lineup-picker summary span { color: var(--ink); font-size: .64rem; }
.lineup-grid { position: absolute; z-index: 30; top: calc(100% + .45rem); left: 0; width: min(560px, calc(100vw - 3rem)); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; padding: .7rem; border: 1px solid rgba(199,164,92,.5); border-radius: 9px; background: #171a16; box-shadow: var(--shadow); }
.lineup-grid label { min-width: 0; }
.lineup-grid select { width: 100%; min-width: 0; }
.lineup-count-field { grid-column: 1 / -1; display: grid; grid-template-columns: auto 5rem; align-items: center; gap: .6rem; }
.lineup-count-field select { width: 5rem; }
.lineup-seat-disabled { opacity: .45; }
.transport button { height: 31px; min-width: 36px; padding: .25rem; }
.transport output { min-width: 66px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--lacquer-hi); }
.hint { flex: 1; margin: 0 0 0 auto; color: var(--muted); font-size: .62rem; line-height: 1.25; text-align: right; }

.score-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: .32rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(31,34,30,.72);
}
.score-strip div { padding: .28rem .65rem; border-right: 1px solid var(--line); display: grid; gap: .08rem; }
.score-strip div:last-child { border: 0; }
.score-strip span { color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; }
.score-strip strong { font: 600 .86rem Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.turn-status { display: flex; align-items: center; gap: .65rem; margin: 0 0 .48rem; padding: .48rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(31,34,30,.82); }
.turn-status i { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(199,164,92,.1); }
.turn-status div { display: grid; gap: .08rem; min-width: 0; }
.turn-status strong { color: var(--ink); font: 600 .82rem Georgia,serif; }
.turn-status small { color: var(--muted); font-size: .62rem; }
.turn-status.bot { border-color: rgba(199,164,92,.5); }
.turn-status.bot i { animation: bot-pulse 1s ease-in-out infinite; }
.turn-status.human { border-color: rgba(113,166,113,.5); }
.player-head > .turn-status { position: static; flex: 0 1 250px; min-width: 0; margin: 0; padding: .2rem .35rem; gap: .3rem; border-radius: 7px; font-size: .56rem; background: rgba(23,27,23,.94); box-shadow: none; }
.player-head > .turn-status i { width: 7px; height: 7px; }
.player-head > .turn-status strong { font-size: .72rem; }
.player-head > .turn-status small { font-size: .58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-status.human i { background: #77ae77; box-shadow: 0 0 0 4px rgba(119,174,119,.1); }
@keyframes bot-pulse { 0%,100% { opacity: .45; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.table-wrap { position: relative; padding: .38rem .38rem .38rem 88px; border: 1px solid var(--line); border-radius: 18px; background: #171914; box-shadow: var(--shadow); }
.banner-rail {
  position: absolute;
  left: 7px;
  top: .45rem;
  bottom: .45rem;
  width: 72px;
  display: grid;
  justify-items: center;
  gap: .34rem;
  z-index: 4;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.banner-rail-title { color: var(--gold); font-size: .48rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.banner-rail-summary { width: 100%; margin-top: auto; padding: .28rem .18rem; display: grid; gap: .15rem; color: var(--gold); background: rgba(199,164,92,.08); border-top: 1px solid rgba(199,164,92,.28); font-size: .46rem; line-height: 1.15; text-align: center; }
.center-resources { display: grid; gap: .12rem; justify-items: center; }
.center-resources #centerDealer { color: var(--muted); font-size: .48rem; }
.banner-sash { position: relative; width: 70px; min-height: 96px; display: grid; grid-template-rows: 70px auto; justify-items: center; gap: .22rem; }
.banner-sash::before { content: ""; position: absolute; left: 6px; top: 1px; width: 3px; height: 91px; border-radius: 3px; background: linear-gradient(#d6b66d,#765629); box-shadow: 1px 0 rgba(0,0,0,.45); }
.banner-sash::after { content: ""; position: absolute; left: 6px; top: 1px; width: 64px; height: 6px; border-radius: 5px; background: linear-gradient(#d6b66d,#765629); box-shadow: 1px 0 rgba(0,0,0,.45); }
.banner-sash-flag {
  position: relative;
  width: 54px;
  height: 70px;
  margin-left: 10px;
  display: grid;
  place-content: center;
  color: #f7e6b4;
  background: linear-gradient(160deg,#8f2928 0%,#591d20 72%,#321618 100%);
  border: 1px solid rgba(199,164,92,.76);
  border-radius: 0 2px 2px 0;
  clip-path: none;
  box-shadow: 0 4px 9px rgba(0,0,0,.28);
  text-align: center;
}
.banner-sash-flag::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,234,175,.26); clip-path: inherit; pointer-events: none; }
.banner-sash-flag b { position: relative; z-index: 1; font: 800 .92rem/1 Georgia,serif; }
.banner-sash-flag small { position: relative; z-index: 1; margin-top: .12rem; color: #f0d59d; font-size: .5rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.banner-sash-owner { width: 100%; overflow: hidden; color: #b9ad99; font-size: .5rem; line-height: 1.08; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.banner-sash.available .banner-sash-flag { background: linear-gradient(160deg,#426752,#294737 72%,#1e3028 100%); border-color: rgba(146,212,182,.56); filter: saturate(.84); }
.banner-sash.next .banner-sash-flag { background: linear-gradient(160deg,#c7a45c,#7b5c28 72%,#513b1b 100%); border-color: #f3d88f; box-shadow: 0 0 0 2px rgba(240,207,120,.16), 0 5px 12px rgba(0,0,0,.36); }
.banner-sash.claimed { opacity: 1; }
.banner-guild-band { position:absolute; left:24%; bottom:20%; width:54%; height:9%; border-radius:1px; background:var(--banner-guild); box-shadow:0 1px 2px #211a0e; pointer-events:none; }
.banner-sash.claimed .banner-sash-owner { color: var(--player-color,#f1d58d); font-weight:900; text-shadow:0 0 8px rgba(var(--player-color-rgb,230,196,94),.72); }
.banner-sash.claimed .banner-sash-flag { filter:drop-shadow(0 0 5px rgba(var(--player-color-rgb,230,196,94),.72)); }
.game-table {
  min-height: 488px;
  position: relative;
  display: grid;
  grid-template: repeat(2,230px) / repeat(2,minmax(0,1fr));
  column-gap: 5rem;
  row-gap: .62rem;
  padding: .7rem;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(221,205,173,.12);
  background:
    radial-gradient(circle at center, rgba(199,164,92,.07), transparent 18rem),
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 50%),
    #273e34;
}
.game-table::before {
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(225,205,170,.13); border-radius: 10px; pointer-events: none;
}
.player {
  --player-color: #d8c79e;
  --player-color-rgb: 216,199,158;
  position: relative; z-index: 1;
  min-width: 0; min-height: 230px;
  box-sizing: border-box;
  padding: .25rem .65rem;
  border: 1px solid rgba(var(--player-color-rgb),.58);
  border-radius: 10px;
  background: linear-gradient(135deg,rgba(var(--player-color-rgb),.055),transparent 42%),rgba(17,20,17,.79);
  box-shadow: inset 0 1px rgba(var(--player-color-rgb),.12),0 8px 20px rgba(0,0,0,.22);
  overflow: hidden;
  display: grid;
  grid-template-columns: 106px minmax(0,1.6fr) minmax(210px,.9fr);
  grid-template-rows: 52px 50px 12px minmax(104px,1fr);
  grid-template-areas:
    "avatar head head"
    "avatar stats set-zone"
    "hand-title hand-title set-zone"
    "hand hand set-zone";
  column-gap: .65rem;
}
.missing-player {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 0;
  height: 230px;
  box-sizing: border-box;
  border-color: rgba(221,205,173,.16);
  background: repeating-linear-gradient(135deg,rgba(8,11,9,.78),rgba(8,11,9,.78) 10px,rgba(20,24,20,.78) 10px,rgba(20,24,20,.78) 20px);
  color: #8f988d;
  filter: saturate(.45);
}
.missing-player-inner { display: grid; justify-items: center; gap: .3rem; padding: 1rem; text-align: center; transform: translateY(18px); }
.missing-player-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(221,205,173,.22); border-radius: 50%; color: #747c72; font-size: 1.4rem; }
.missing-player-inner strong { color: #b4bcae; font-size: .78rem; }
.missing-player-inner small { color: #747c72; font-size: .6rem; }
.player.lineup-preview { opacity: .72; border-style: dashed; }
.player[data-seat="0"],.player-color-0 { --player-color: var(--seat-0-color,#e6c45e); --player-color-rgb: var(--seat-0-rgb,230,196,94); }
.player[data-seat="1"],.player-color-1 { --player-color: var(--seat-1-color,#61c6de); --player-color-rgb: var(--seat-1-rgb,97,198,222); }
.player[data-seat="2"],.player-color-2 { --player-color: var(--seat-2-color,#ef806f); --player-color-rgb: var(--seat-2-rgb,239,128,111); }
.player[data-seat="3"],.player-color-3 { --player-color: var(--seat-3-color,#79b68c); --player-color-rgb: var(--seat-3-rgb,121,182,140); }
.player.active { border-color: var(--player-color); box-shadow: 0 0 0 2px rgba(var(--player-color-rgb),.2),0 10px 26px rgba(0,0,0,.28); }
.player.human-player {
  border-color: var(--player-color);
  background: linear-gradient(135deg,rgba(var(--player-color-rgb),.18),rgba(var(--player-color-rgb),.045) 48%,rgba(17,20,17,.88));
  box-shadow: 0 0 0 3px rgba(var(--player-color-rgb),.46), 0 0 22px rgba(var(--player-color-rgb),.2), inset 0 1px rgba(255,255,255,.16), 0 10px 28px rgba(0,0,0,.3);
}
.player.human-player::before {
  content: "Player";
  position: absolute;
  top: .2rem;
  left: .65rem;
  z-index: 3;
  padding: .14rem .38rem;
  color: #17130a;
  background: var(--player-color);
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 999px;
  box-shadow: 0 1px 5px rgba(0,0,0,.42);
  font: 900 .5rem/1 system-ui,sans-serif;
  letter-spacing: .1em;
}
.player.human-player .player-portrait { border-width: 3px; box-shadow: 0 0 0 4px rgba(var(--player-color-rgb),.32), 0 6px 16px rgba(0,0,0,.58); }
.player.human-player .player-name, .player.human-player .you-mark { text-shadow: 0 0 10px rgba(var(--player-color-rgb),.72); }
.player.human-player.winner { box-shadow: 0 0 0 3px rgba(var(--player-color-rgb),.54), 0 0 0 6px rgba(240,207,120,.28), 0 0 27px rgba(var(--player-color-rgb),.24), 0 10px 30px rgba(0,0,0,.34); }
.set.move-subject-set { outline: 2px solid #fff; outline-offset: 2px; background: rgba(255,255,255,.13); }
.set.move-related-set { outline: 2px solid #f0cf78; outline-offset: 2px; background: rgba(240,207,120,.14); }
.action-button.move-related-action { border-color: #f0cf78; box-shadow: 0 0 0 2px rgba(240,207,120,.38), 0 0 18px rgba(240,207,120,.18); }
.card.move-card-subject { border-color: #f0cf78; box-shadow: 0 0 0 2px rgba(240,207,120,.62), 0 0 17px rgba(240,207,120,.32); transform: translateY(-3px); }
.player.winner {
  border-color: #f0cf78; background: linear-gradient(135deg,rgba(122,91,31,.25),rgba(17,20,17,.84));
  box-shadow: 0 0 0 2px rgba(240,207,120,.2), 0 10px 30px rgba(0,0,0,.32);
  animation: winner-glow 2.4s ease-in-out infinite;
}
.player.winner .player-portrait { border-color: #f0cf78; box-shadow: 0 0 0 3px rgba(240,207,120,.16), 0 4px 13px rgba(0,0,0,.52); }
@keyframes winner-glow { 0%,100% { border-color: #c6a45d; } 50% { border-color: #fff0b2; } }
.player.player.move-subject { animation: move-subject-flash .65s ease-in-out infinite alternate; }
.player.move-subject { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(var(--player-color-rgb),.56), 0 0 28px rgba(var(--player-color-rgb),.48), 0 10px 26px rgba(0,0,0,.3); }
.player.move-subject .player-portrait { transform: scale(1.06); border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(var(--player-color-rgb),.5), 0 0 22px rgba(var(--player-color-rgb),.56),0 6px 16px rgba(0,0,0,.58); }
@keyframes move-subject-flash {
  from { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(var(--player-color-rgb),.42), 0 0 20px rgba(var(--player-color-rgb),.32),0 10px 26px rgba(0,0,0,.3); }
  to { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(var(--player-color-rgb),.7), 0 0 38px rgba(var(--player-color-rgb),.65),0 12px 32px rgba(0,0,0,.4); }
}
@media (prefers-reduced-motion: reduce) {
  .player.player.move-subject { animation: none; border-color: #fff; }
}
.seat-north { grid-area: 1 / 1; }
.seat-west { grid-area: 1 / 2; }
.seat-east { grid-area: 2 / 1; }
.seat-south { grid-area: 2 / 2; }
.center-turn { position: absolute; left: 50%; top: calc(50% - 43px); transform: translateX(-50%); padding: .13rem .22rem; color: #efdba9; background: #19231d; border: 1px solid var(--line); border-radius: 5px; white-space: nowrap; font-size: .55rem; font-weight: 700; pointer-events: none; }
.debug-controls { display: flex; gap: .5rem; margin: .6rem 0; }
#debugStatus { font-size: .74rem; line-height: 1.45; color: var(--gold); overflow-wrap: anywhere; }
#quickDebug.has-runtime-errors { color: #fff; background: #8f2e2e; border-color: #ff8f8f; box-shadow: 0 0 0 2px #8f2e2e66; }
#quickDebug.has-runtime-errors #quickDebugCount { display: inline-block; margin-left: .18rem; font-size: .68rem; font-weight: 800; }
.debug-latest-trace { max-height: 15rem; overflow: auto; margin: .55rem 0; padding: .55rem .65rem; white-space: pre-wrap; overflow-wrap: anywhere; font: .63rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; color: #ffd5d5; background: #211313; border: 1px solid #a95858; border-radius: 6px; }
#debugDump { width: 100%; box-sizing: border-box; resize: vertical; padding: .5rem; font: .65rem/1.4 monospace; color: var(--ink); background: #111810; border: 1px solid var(--line); border-radius: 6px; }
.center-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 5;
  width: 112px;
  height: 90px;
  display: grid;
  place-items: center;
  pointer-events: auto;
}
.discard-pile { position: relative; width: 100%; height: 100%; padding: 0; border: 1px solid rgba(199,164,92,.42); border-radius: 7px; background: linear-gradient(145deg,rgba(64,83,63,.94),rgba(29,48,39,.96)); box-shadow: inset 0 1px 5px rgba(0,0,0,.3),0 3px 9px rgba(0,0,0,.22); overflow: visible; }
.discard-pile:hover, .discard-pile:focus-visible { z-index: 4; border: 0; outline: none; }
.discard-pile:disabled { cursor: default; opacity: 1; }
.discard-tooltip { position: absolute; left: 50%; bottom: calc(100% + 7px); z-index: 12; width: max-content; max-width: 164px; display: grid; gap: .12rem; padding: .35rem .45rem; color: #e9dfca; background: rgba(20,24,20,.96); border: 1px solid rgba(199,164,92,.54); border-radius: 7px; box-shadow: 0 5px 16px rgba(0,0,0,.34); font-size: .56rem; line-height: 1.22; opacity: 0; pointer-events: none; transform: translate(-50%,4px); transition: opacity .14s ease-out, transform .14s ease-out; }
.discard-tooltip strong { color: #f0d59d; font-size: .61rem; }
.discard-tooltip small { color: #c8bcaa; font-size: .52rem; }
.discard-tooltip span { color: #9fd6b7; font-size: .5rem; }
.discard-pile:not(:disabled):hover .discard-tooltip, .discard-pile:focus-visible .discard-tooltip { opacity: 1; transform: translate(-50%,0); }
.center-mark .center-emblem {
  padding: 0; cursor: pointer;
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 3;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid rgba(235,216,177,.58);
  border-radius: 50%;
  color: rgba(255,243,216,.9);
  background: rgba(25,29,24,.94);
  font: 1.65rem Georgia, serif;
  box-shadow: 0 4px 15px rgba(0,0,0,.42), inset 0 0 0 4px rgba(141,37,37,.52);
}
.discard-preview { position: absolute; inset: 0; }
.discard-mini { position: absolute; left: 50%; top: 50%; width: 37px; height: 49px; padding: 2px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(83,59,31,.7); border-radius: 5px; background: var(--cream-card); box-shadow: 0 3px 8px rgba(0,0,0,.42); transform: translate(calc(-50% + var(--discard-x)),-50%) rotate(var(--discard-rotation)); }
.discard-mini img { width: 100%; height: 100%; object-fit: contain; }
.discard-mini span { color: #55452f; font: 1rem Georgia,serif; }
.discard-mini.special { background: linear-gradient(145deg,#742723,#391a18); border-color: #b96f50; }
.discard-mini.wildcard { background: linear-gradient(145deg,#3c3933,#171816); border-color: var(--gold); }
.discard-badge { position: absolute; right: 0; bottom: 1px; z-index: 4; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 .25rem; color: #241c0b; background: var(--gold); border: 2px solid #273e34; border-radius: 999px; font-size: .58rem; }
.discard-pile:not(:disabled):hover .discard-mini, .discard-pile:focus-visible .discard-mini { border-color: #f0d59d; filter: brightness(1.08); }
.center-mark small { display: none; }
.center-resources { position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); display: grid; gap: 3px; width: max-content; max-width: 80px; text-align: center; pointer-events: none; }
.center-resources > span { padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; background: #19231d; color: #efdba9; font-size: .55rem; line-height: 1.2; font-weight: 700; }
.player-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--line); padding-bottom: .22rem; }
.player-identity { min-width: 0; }
.player-portrait {
  grid-area: avatar; width:102px; min-width:102px; max-width:102px; height:102px; aspect-ratio:1 / 1; place-self:center; display:block; overflow:hidden; flex:0 0 auto; box-sizing:border-box;
  border: 2px solid var(--player-color,#d8c79e); border-radius: 50%;
  background-repeat: no-repeat; background-size: auto 400%;
  box-shadow: 0 3px 9px rgba(0,0,0,.48); transform-origin: center;
  transition: transform .18s ease-out, filter .18s, border-color .18s, box-shadow .18s;
}
.player.active .player-portrait { z-index: 2; box-shadow: 0 5px 14px rgba(0,0,0,.58); }
.portrait-row-0 { background-position-y: 0%; }
.portrait-row-1 { background-position-y: 33.333%; }
.portrait-row-2 { background-position-y: 66.667%; }
.portrait-row-3 { background-position-y: 100%; }
.mood-neutral { background-position-x: 0%; }
.mood-pleased { background-position-x: 50%; border-color: #d6b66d; filter: saturate(1.12) brightness(1.04); animation: portrait-reaction .28s ease-out; }
.mood-angry { background-position-x: 100%; border-color: #c95d4b; filter: saturate(1.12) contrast(1.04); animation: portrait-reaction .28s ease-out; }
.portrait-sheet-v1 { background-image: url("/assets/portraits-ukiyoe-v1.png?v=U2140"); }
.portrait-sheet-v2 { background-image: url("/assets/portraits-ukiyoe-v2.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v3 { background-image: url("/assets/portraits-ukiyoe-v3.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v4 { background-image: url("/assets/portraits-ukiyoe-v4.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v5 { background-image: url("/assets/portraits-ukiyoe-v5.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v6 { background-image: url("/assets/portraits-ukiyoe-v6.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v7 { background-image: url("/assets/portraits-ukiyoe-v7.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v8 { background-image: url("/assets/portraits-ukiyoe-v8.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v9 { background-image: url("/assets/portraits-ukiyoe-v9.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v10 { background-image: url("/assets/portraits-ukiyoe-v10.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v11 { background-image: url("/assets/portraits-ukiyoe-v11.png?v=U2140"); background-size: auto 400%; }
.portrait-sheet-v10.portrait-row-0 { background-position-y: 0%; }
.portrait-sheet-v11.portrait-row-0 { background-position-y: 0%; }
.portrait-sheet-v10.portrait-row-1 { background-position-y: 33.333%; }
.portrait-sheet-v11.portrait-row-1 { background-position-y: 33.333%; }
.portrait-sheet-v10.portrait-row-2 { background-position-y: 66.667%; }
.portrait-sheet-v11.portrait-row-2 { background-position-y: 66.667%; }
.portrait-sheet-v10.portrait-row-3 { background-position-y: 100%; }
.portrait-sheet-v11.portrait-row-3 { background-position-y: 100%; }
@keyframes portrait-reaction { 0% { transform: scale(.88); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.player-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.moves-button { padding: .15rem .42rem; color: #f0d59d; background: rgba(199,164,92,.08); border-color: rgba(199,164,92,.48); border-radius: 999px; font-size: .6rem; font-weight: 750; white-space: nowrap; }
.moves-button:hover { color: #fff4dc; background: rgba(199,164,92,.16); }
.player-head h3 { margin: 0; display: flex; align-items: center; gap: .35rem; font: 600 .9rem Georgia, serif; }
.player-name { padding: 0 .18em; border-radius: 3px; color: var(--player-color); background: rgba(var(--player-color-rgb),.1); box-shadow: inset 0 -1px rgba(var(--player-color-rgb),.28); font-weight: 800; }
.human-name { outline: 1px solid rgba(var(--player-color-rgb),.28); outline-offset: 1px; }
.you-mark { padding: .08rem .3rem; border: 1px solid var(--player-color); border-radius: 999px; color: #211708; background: var(--player-color); font: 800 .48rem/1.15 system-ui,sans-serif; letter-spacing: .08em; }
.winner-mark { width: 21px; height: 21px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #211708; background: linear-gradient(145deg,#ffe6a0,#b98a34); border: 1px solid #fff0b2; border-radius: 50%; font: .68rem "Segoe UI Emoji",sans-serif; box-shadow: 0 2px 7px rgba(0,0,0,.4); }
.player-head p { margin: .08rem 0 0; color: var(--muted); font-size: .62rem; }
.banner { color: #241c0b; background: var(--gold); border-radius: 999px; padding: .16rem .45rem; font-size: .62rem; font-weight: 750; white-space: nowrap; }
.player-stats { grid-area: stats; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; margin: .25rem 0; color: var(--muted); font-size: .62rem; }
.player-stat { position:relative; display:inline-flex; align-items:center; gap:3px; min-width:28px; padding:2px 5px; border:1px solid rgba(226,210,180,.15); border-radius:999px; color:#ddd2bc; background:rgba(4,10,8,.3); line-height:1; }
.player-stat i { width:14px; height:14px; display:grid; place-items:center; color:#d8c079; }
.player-stat svg { width:14px; height:14px; overflow:visible; fill:none; stroke:currentColor; stroke-width:2; }
.player-stat-tokens svg circle:first-child,.player-stat-support svg rect { fill:currentColor; stroke:none; }
.player-stat-sets svg rect { fill:rgba(216,192,121,.18); }
.player-stat b { color:var(--ink); font-size:inherit; }
.player-stat.alert { color:#ff6b63; border-color:#ff6b6377; background:#671d1d66; box-shadow:0 0 9px #ff392744; }
.reserve-flow-incoming { flex:0 0 auto; white-space:nowrap; color:#f5d782; font-weight:800; letter-spacing:.02em; }
.player-stat:is(:hover,:focus-visible)::after { content:attr(data-tip); position:absolute; left:50%; bottom:calc(100% + 6px); z-index:50; width:max-content; max-width:180px; padding:5px 7px; transform:translateX(-50%); color:#282116; background:#efe1bd; border:1px solid #c7a45c; border-radius:5px; font:600 12px/1.2 var(--font-ui); box-shadow:0 4px 12px #0008; pointer-events:none; }
.dishonor-portrait-mark { grid-area:avatar; place-self:end start; z-index:7; display:inline-flex; align-items:center; gap:3px; transform:translate(-3px,3px); font:900 13px/1 Georgia,serif; }
.negative-dishonor { --negative-fill:#681b1d; --negative-line:#ff8d80; }
.negative-shame { --negative-fill:#39204f; --negative-line:#c69de7; }
.negative-portrait-badge, .negative-status-symbol {
  display:inline-flex; align-items:center; justify-content:center; gap:2px;
  color:#fff5eb; background:var(--negative-fill); border:1px solid var(--negative-line);
  border-radius:999px; line-height:1;
}
.negative-portrait-badge { padding:.28em .4em; min-height:24px; font:inherit; box-shadow:0 1px 5px #0009; }
.negative-portrait-badge .negative-status-symbol { background:none; border:0; padding:0; }
.negative-status-symbol { min-width:1.25em; min-height:1.25em; padding:.1em; font-weight:800; }
.dishonor-portrait-mark b { font:800 10px/1 var(--font-ui); }
.player-stat-dishonor { border-color:var(--negative-line); background:var(--negative-fill); }
.player-stat-dishonor.alert { border-color:var(--negative-line); background:var(--negative-fill); box-shadow:none; }
.player-stat-dishonor .negative-status-symbol { border:0; padding:0; background:none; color:var(--negative-line); }
.player-stat[data-negative-inspector]:is(:hover,:focus-visible)::after { display:none; }
.negative-status-facts { display:grid; gap:.45rem; margin:.55rem 0; padding:0; list-style:none; }
.negative-status-facts li { display:grid; gap:.2rem; border:1px solid var(--line); border-radius:6px; padding:.4rem; }
body.inspector-open #cardInspector:has(.negative-status-inspector) { max-height:calc(100dvh - 16px); overflow:auto; }
#toast.toast-dishonor { background:#681b1d; border-color:#ff8d80; }
#toast.toast-shame { background:#39204f; border-color:#c69de7; }
.player.dishonored { box-shadow:inset 0 0 0 1px #b73d36aa,0 0 14px #7f171733; }
.player.dishonored.shamed-only { box-shadow:inset 0 0 0 1px #a36ed5aa,0 0 14px #6e359333; }
.relative-score { padding: .06rem .28rem; color: #f4d98f; background: rgba(199,164,92,.10); border: 1px solid rgba(199,164,92,.34); border-radius: 999px; font-weight: 800; white-space: nowrap; }
.relative-score.rank-1 { color: #271d0a; background: #d8b45d; border-color: #f2d88c; }
.player-zone-title { margin: .18rem 0 .25rem; color: var(--gold); font-size: .52rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.hand-title { grid-area: hand-title; margin: 0; align-self: center; }
.set-zone { grid-area: set-zone; min-width: 0; align-self: start; display: flex; flex-direction: column; }
.set-zone > .set-title { flex: 0 0 auto; white-space: nowrap; }
.player-hand { grid-area: hand; display: flex; flex-wrap: nowrap; align-items: flex-start; gap: .3rem; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 0 0 .2rem; scrollbar-width: thin; }
.player-hand > .card { flex: 0 0 auto; align-self: flex-start; height: 164px; }
.player-hand > .card.compact-card { height: 96px; }
.player-hand.hand-overflow { gap: .22rem; overflow-x: hidden; }
.player-hand.hand-overflow > .card { width: 0; min-width: 0; flex: 1 1 0; padding-left: .14rem; padding-right: .14rem; }
.player-hand.hand-overflow > .card .card-art { width: 31px; height: 31px; }
.player-hand.hand-overflow > .card .card-mon { width: 31px; height: 31px; font-size: 1rem; }
.player-hand.hand-overflow > .card b { font-size: .48rem; }
.player-hand.hand-overflow > .card .card-tag { padding: .05rem .1rem; font-size: .32rem; }
.sets { grid-area: sets; display: grid; align-content: start; gap: .28rem; min-width: 0; max-height: 154px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.set { padding: .26rem .36rem; background: rgba(255,255,255,.04); border-left: 3px solid #777; border-radius: 5px; }
.set.trip { border-left-color: var(--lacquer-hi); }
.set.anch { border-left-color: var(--gold); }
.set.seal { border-left-color: #e9c85d; background: rgba(201,165,66,.14); }
.set.seal .set-state { color: #ffe078; }
.set-main { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.set-kamons { display: flex; align-items: center; flex: 0 0 auto; gap: .12rem; }
.set-kamon, .set-kamon-fallback { width: 23px; height: 23px; border-radius: 50%; background: var(--cream-card); border: 1px solid rgba(199,164,92,.5); }
.set-kamon { object-fit: contain; padding: 1px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.set-kamon-fallback { display: grid; place-items: center; color: #54452e; font: .8rem Georgia,serif; }
.set-kamon.wildcard, .set-kamon-fallback.wildcard { background: linear-gradient(145deg,#3c3933,#171816); border-color: rgba(226,190,103,.78); }
.set-main strong { display: flex; align-items: center; gap: .28rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.set-meta { display: grid; justify-items: start; gap: .14rem; min-width: 0; }
.set-state { flex: 0 0 auto; }
.set-attachment { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.token-counter { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; padding: 2px 3px; border: 1px solid rgba(199,164,92,.28); border-radius: 4px; background: rgba(199,164,92,.08); }
.token-pip { display: block; width: 7px; height: 7px; border: 1px solid #f1d58d; border-radius: 1px; background: linear-gradient(145deg,#d8b45b,#886326); box-shadow: 0 1px 2px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.25); }
.token-counter.zero { min-width: 15px; justify-content: center; color: var(--muted); border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.025); }
.token-counter em { font: normal .52rem/1 Georgia,serif; }
.set .token-counter:not(.zero) { gap:3px; padding:3px 5px; border-color:rgba(242,201,91,.72); background:rgba(177,126,27,.24); }
.set .token-pip { width:11px; height:11px; border-radius:3px; border:1px solid #ffe49a; background:linear-gradient(145deg,#ffe78a,#d49b25 62%,#865515); box-shadow:0 0 5px rgba(255,204,74,.55), inset 0 1px rgba(255,255,255,.55); }
.inspector-sigils-label { display:block; margin:.35rem 0 .16rem; color:var(--muted); font-size:.63rem; }
.inspector-sigils { display:flex; flex-wrap:wrap; gap:.2rem; margin:.12rem 0 .3rem; }
.inspector-sigils .card-sigil { width:auto; min-width:1.8rem; height:1.8rem; display:inline-flex; gap:.18rem; padding:0 .3rem; border-radius:6px; font-size:.77rem; }
.inspector-sigils .card-sigil i { font-style:normal; font-size:.96rem; }
.inspector-sigils .card-sigil b { font-size:.62rem; }
.inspector-sigils .card-sigil small { font-size:.59rem; }
:root { --sigil-s1:#9a8542; --sigil-s2:#5d8963; --sigil-s3:#b76855; --sigil-s4:#706ba9; --sigil-s5:#42869c; --sigil-s6:#816854; --sigil-s7:#9d6388; --sigil-s8:#91a5b6; }
.card-sigil.sigil-s1 { color:#fff6c8; background:var(--sigil-s1); border-color:#e2c96e; }
.card-sigil.sigil-s2 { color:#efffea; background:var(--sigil-s2); border-color:#9bcea0; }
.card-sigil.sigil-s3 { color:#fff0e9; background:var(--sigil-s3); border-color:#efa184; }
.card-sigil.sigil-s4 { color:#f1f0ff; background:var(--sigil-s4); border-color:#aaa5eb; }
.card-sigil.sigil-s5 { color:#effcff; background:var(--sigil-s5); border-color:#83d0e3; }
.card-sigil.sigil-s6 { color:#fff2e1; background:var(--sigil-s6); border-color:#d2aa7e; }
.card-sigil.sigil-s7 { color:#fff0fa; background:var(--sigil-s7); border-color:#dfa3ca; }
.card-sigil.sigil-s8 { color:#14202a; background:var(--sigil-s8); border-color:#c6d8e5; }
.action-sigil-icon { border:2px solid #241c16!important; box-sizing:border-box; border-radius:3px; }
.action-sigil-icon.sigil-s1 { background:var(--sigil-s1); }
.action-sigil-icon.sigil-s2 { background:var(--sigil-s2); }
.action-sigil-icon.sigil-s3 { background:var(--sigil-s3); }
.action-sigil-icon.sigil-s4 { background:var(--sigil-s4); }
.action-sigil-icon.sigil-s5 { background:var(--sigil-s5); }
.action-sigil-icon.sigil-s6 { background:var(--sigil-s6); }
.action-sigil-icon.sigil-s7 { background:var(--sigil-s7); }
.action-sigil-icon.sigil-s8 { background:var(--sigil-s8); }
.set strong { font-size: .62rem; }
.set p { margin: .16rem 0 0; color: var(--muted); font-size: .57rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.no-sets { color: var(--muted); font-size: .73rem; font-style: italic; }

.hand-panel, .action-panel, .event-panel, .inspector {
  margin-top: .52rem; padding: .7rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: .52rem; }
.section-heading > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: .22rem .5rem; min-width: 0; }
.section-heading h2 { margin: 0; font: 600 .82rem Georgia, serif; }
#actionPrompt { font-size: .82rem; }
.eyebrow { color: var(--gold); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; }
.turn-budget, #actionCount, #eventIndex { color: var(--muted); font-size: .75rem; }
.section-heading-tools { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.attach-map-toggle { padding: .34rem .58rem; color: #f0d59d; background: rgba(199,164,92,.08); border-color: rgba(199,164,92,.42); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.attach-map-toggle span { margin-left: .25rem; padding: .07rem .3rem; color: #221b0c; background: var(--gold); border-radius: 999px; font-size: .54rem; }
.cards-row { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: .45rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
.cards-row > .card { flex: 0 0 auto; align-self: flex-start; height: 164px; }
.cards-row > .card.compact-card { height: 96px; }
/* U106: give the hand cards a little more vertical room for their tags. */
#humanHand { padding-top: 2px; }
#humanHand > .card { height: 172px; }
.hand-content { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,440px); gap: .75rem; align-items: start; }
.card-inspector { min-width: 0; max-height: min(460px,76dvh); overflow-x: hidden; overflow-y: auto; padding: .8rem .9rem; border: 1px solid rgba(199,164,92,.3); border-radius: 9px; background: linear-gradient(145deg,rgba(199,164,92,.1),rgba(255,255,255,.025)); }
.card-inspector-head { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: .55rem; min-width: 0; }
.card-inspector-head h3 { margin: .1rem 0; color: var(--gold); font: 700 1rem Georgia,serif; }
.card-inspector-head small, .card-inspector p { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.card-inspector-art, .card-inspector-mon { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; border-radius: 7px; background: var(--cream-card); }
.card-inspector-mon { display: grid; place-items: center; color: #5a4930; font: 1.25rem Georgia,serif; }
.card-inspector-facts { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; }
.card-inspector-facts span { padding: .25rem; color: var(--muted); background: rgba(255,255,255,.035); border-radius: 5px; font-size: .59rem; }
.card-inspector-facts b { display: block; margin-top: .08rem; color: var(--ink); font-size: .65rem; }
.card-inspector-effect { max-height: none; overflow: visible; margin: .4rem 0 0; }
.card-inspector-lore { max-height: none; overflow: visible; margin: .4rem 0 0; padding-top: .35rem; border-top: 1px solid rgba(199,164,92,.22); color: var(--gold) !important; font-family: Georgia,serif; font-size: .8rem !important; font-style: italic; }
.card-inspector-effect strong, .card-inspector-actions .eyebrow { color: var(--gold); }
.card-inspector-actions { margin-top: .3rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.card-inspector-actions p { margin: .2rem 0 0; color: var(--ink); }
.set-inspector-cards { display:flex; flex-wrap:wrap; justify-content:center; gap:5px; margin:.4rem 0 .25rem; padding:.35rem 0; border-block:1px solid rgba(199,164,92,.22); }
.set-inspector-card { flex:0 1 82px; min-width:66px; margin:0; text-align:center; }
.set-inspector-card-art { display:grid; place-items:center; aspect-ratio:63/88; overflow:hidden; border:1px solid rgba(199,164,92,.55); border-radius:6px; background:var(--cream-card); box-shadow:0 4px 12px rgba(0,0,0,.24); }
.set-inspector-card-art img { width:100%; height:100%; object-fit:cover; }
.set-inspector-card-mon { color:#4b3a25; font:1.25rem Georgia,serif; }
.set-inspector-card figcaption { margin-top:2px; color:var(--ink); font-size:.68rem; line-height:1.1; overflow-wrap:anywhere; }
.set-inspector-card-meta { display:grid; grid-template-columns:3.5rem minmax(0,1fr); gap:.22rem; align-items:end; min-height:2.8rem; margin-top:.12rem; text-align:left; }
.set-inspector-card-meta .inspector-sigils { grid-column:1; display:flex; flex-direction:column; align-items:flex-start; gap:0; margin:0; }
.set-inspector-card-meta .inspector-sigils .card-label-sigil { width:3.5rem; height:1.22rem; min-width:3.5rem; display:grid; grid-template-columns:2.2rem minmax(0,1fr); gap:.12rem; align-items:center; }
.set-inspector-card-meta .inspector-sigils .card-label-sigil .sigil-art { width:2.2rem; height:1.22rem; }
.set-inspector-card-meta .inspector-sigils .card-label-sigil small { display:block; min-width:0; overflow:hidden; color:var(--ink); font-size:.52rem; line-height:1; text-align:left; }
.set-inspector-card-side { grid-column:2; min-width:0; align-self:stretch; display:flex; flex-direction:column; justify-content:flex-end; gap:.12rem; padding-bottom:.08rem; }
.set-inspector-card-side small { display:block; color:var(--muted); font-size:.58rem; line-height:1.08; max-height:2.35rem; overflow:hidden; }
.set-inspector-card-rarity { color:#a87425; font-size:.58rem; letter-spacing:-.08em; white-space:nowrap; }
.set-inspector-card .inspector-sigils-label { display:none; }
.set-inspector-card .inspector-sigils { transform:none; gap:2px; margin:.12rem 0 0; justify-content:center; }
.set-inspector-card .inspector-sigils .card-sigil { min-width:0; height:1.45rem; padding:0 .18rem; font-size:.66rem; }
.set-inspector-card .inspector-sigils .card-sigil i { font-size:.78rem; }
.set-inspector-card .inspector-sigils .card-sigil b { font-size:.52rem; }
.set-inspector-card .inspector-sigils .card-sigil small { display:block; }
.inspector-special-group { margin: .22rem 0; padding: .16rem .28rem; border: 1px solid rgba(199,164,92,.26); border-radius: 6px; background: rgba(199,164,92,.045); }
.inspector-special-group summary { display: flex; align-items: center; justify-content: space-between; gap: .45rem; cursor: pointer; color: var(--gold); font-size: .68rem; list-style-position: inside; }
.inspector-special-group summary small { color: var(--muted); font-size: .58rem; }
.inspector-special-group ul { margin: .2rem 0 .12rem 1.15rem; padding: 0; color: var(--ink); font-size: .62rem; line-height: 1.35; }
.special-action-group { display: grid; gap: .18rem; }
.special-action-group[hidden] { display: none; }
.setup-all-ai { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 0; color: var(--gold); font-size: .78rem; }
.setup-all-ai input { width: auto; accent-color: var(--gold); }
.special-variants { max-height: 45dvh; overflow-y: auto; }
.special-group-back { position: sticky; top: 0; z-index: 1; background: #20251e; padding: .35rem; color: var(--gold); }
.special-group-toggle { text-align: left; border-color: rgba(199,164,92,.5); background: linear-gradient(105deg,rgba(199,164,92,.13),rgba(255,255,255,.025)); }
.special-group-count { flex: 0 0 auto; color: var(--muted); font-size: .58rem; }
.special-variants { display: grid; gap: .18rem; margin-left: .65rem; padding-left: .45rem; border-left: 1px solid rgba(199,164,92,.35); }
.special-variants[hidden] { display: none; }
.special-variant { min-height: 0; padding: .42rem .5rem; }
.banner-inspector-head { grid-template-columns:minmax(0,1fr) auto; }
.end-game-panel { grid-column:1/-1; width:100%; display:grid; gap:.75rem; color:var(--ink); }
.end-game-lead { padding:.62rem .72rem; border:1px solid rgba(199,164,92,.3); border-radius:9px; background:linear-gradient(135deg,rgba(199,164,92,.13),rgba(255,255,255,.025)); }
.end-game-lead h3 { margin:.12rem 0; color:#f2d78f; font:700 1.05rem Georgia,serif; }
.end-game-lead p,.future-mission-note { margin:.15rem 0; color:var(--muted); font-size:var(--ui-min); }
.end-game-player-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; margin:0; padding:0; list-style:none; }
.end-game-player-stats li { display:grid; gap:.35rem; padding:.62rem .7rem; border-left:4px solid var(--player-color); border-radius:7px; background:rgba(var(--player-color-rgb),.11); font-size:var(--ui-min); }
.end-game-player-stats strong { color:var(--player-color); }
.end-game-player-stats li>div { display:flex; flex-wrap:wrap; gap:.3rem .65rem; }
.end-game-player-stats span { color:var(--muted); }
.end-game-player-stats span b { color:var(--ink); }
.end-game-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.end-game-details section { min-width:0; padding:.5rem .58rem; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.022); }
.end-game-details h4 { margin:0 0 .35rem; color:var(--gold); font:700 .78rem Georgia,serif; }
.end-game-details ol,.end-game-details ul { display:grid; gap:.2rem; margin:0; padding-left:1.2rem; font-size:var(--ui-min); }
.end-game-details li span { margin-left:.35rem; color:var(--muted); }
.set-inspector-head h3 { margin:.1rem 0; color:var(--gold); font:700 .9rem Georgia,serif; }
.set-inspector-head small { color:var(--muted); }
.set-inspector-history { margin-top:.35rem; padding-top:.35rem; border-top:1px solid var(--line); }
.set-inspector-history summary { cursor:pointer; color:var(--gold); font-size:.68rem; }
.set-inspector-history ol { margin:.28rem 0 0; padding-left:1.25rem; color:var(--ink); font-size:.68rem; line-height:1.4; }
.set-inspector-history p { margin:.25rem 0 0; color:var(--muted); font-size:.68rem; }
body.inspector-open #cardInspector[data-set-id] { max-height:min(560px,calc(100dvh - 12px)); overflow:auto; }
.set-inspect-hint { display:inline-grid; place-items:center; width:14px; height:14px; margin-left:.05rem; color:var(--gold); border:1px solid rgba(199,164,92,.7); border-radius:50%; font-size:.62rem; line-height:1; opacity:.9; }
.rematch-session { color:#fff3c9; background:linear-gradient(#9a2f2a,#6d1e1b); border-color:#c45d48; font-weight:800; }
.honor-rank { color:#efd27d; white-space:nowrap; }
.character-honor { display:grid; gap:.2rem; margin:.5rem 0; padding:.55rem .65rem; border:1px solid rgba(199,164,92,.38); border-radius:8px; background:rgba(199,164,92,.09); }
.character-honor strong { color:#f1d58d; }
.character-honor span { color:var(--muted); font-size:var(--ui-min); }
.character-lore h3 { margin:14px 0 6px; }
.character-lore p { margin:6px 0; }
.character-lore .character-playstyle-note { font-size:12px; opacity:.82; }
.honor-settings p { color:var(--muted); font-size:var(--ui-min); }
.end-honor { color:#efd27d!important; }
.card {
  position: relative;
  width: 112px; min-height: 164px; padding: .5rem;
  border: 1px solid rgba(59,43,27,.45); border-radius: 9px;
  color: #2e281f; background: var(--cream-card);
  box-shadow: 0 7px 15px rgba(0,0,0,.24);
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
}
.card-rarity { position: absolute; right: .34rem; top: .3rem; z-index: 2; color: #9b6418; font: 800 .55rem/1 system-ui,sans-serif; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.optimal-mark { display:none!important; }
.card-rarity-stars { display: inline-flex; padding-right: .2em; letter-spacing: -.24em; }
.card-rarity-code { display: none; min-width: 1.3rem; padding: .13rem .22rem; color: #fff4d6; background: #6f4b20; border: 1px solid #c7a45c; border-radius: 999px; font: 800 .48rem/1 system-ui,sans-serif; letter-spacing: 0; }
.connection-view .card-rarity-stars { display: none; }
.connection-view .card-rarity-code { display: inline-block; }
.compact-card .card-rarity { right: .16rem; top: .15rem; transform: scale(.82); transform-origin: top right; }
.card.special { color: #f4e9d8; background: linear-gradient(145deg,#742723,#391a18); border-color: #b96f50; }
.card.wildcard { color: #f4e9d8; background: linear-gradient(145deg,#3c3933,#171816); border-color: #c7a45c; box-shadow: 0 7px 18px rgba(0,0,0,.38), inset 0 0 0 1px rgba(226,190,103,.16); }
.card.hidden-card { justify-content: center; color: #bfad89; background: repeating-linear-gradient(45deg,#292b27,#292b27 7px,#242622 7px,#242622 14px); border-color: #55584f; }
.card-art { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.24)); }
.card.special .card-art { border-radius: 6px; filter: sepia(.12) saturate(.82) drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.card-mon { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 1.8rem Georgia,serif; opacity: .7; }
.card b { max-width: 100%; font: 650 .78rem Georgia, serif; overflow-wrap: anywhere; text-align: center; }
.card-kind { align-self: flex-start; opacity: .62; font-size: .52rem; letter-spacing: .09em; text-transform: uppercase; }
.card-title { min-height: 1.25rem; font-size: .54rem; line-height: 1.15; opacity: .72; text-align: center; }
.card-tags { margin-top: auto; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: .16rem; }
.card-tag { padding: .1rem .23rem; border: 1px solid rgba(48,38,25,.24); border-radius: 999px; background: rgba(255,255,255,.28); font-size: .48rem; font-weight: 650; line-height: 1.1; }
.card-sigil { display:inline-grid; place-items:center; width:2.5rem; height:2.5rem; margin:0 .08rem; border:1px solid rgba(48,38,25,.3); border-radius:50%; background:rgba(255,255,255,.35); color:#382d1d; font-size:1.56rem; font-weight:800; line-height:1; }
.compact-card .card-sigil { width:1.35rem; height:1.35rem; margin:0 .02rem; font-size:.88rem; }
.card-sigil[title] { cursor:help; }
.card-sigil .sigil-art { display:block; width:82%; height:82%; object-fit:contain; }
.inspector-sigils .card-sigil .sigil-art { width:1rem; height:1rem; }
.card-sigil.card-label-sigil { width:6.45rem; height:1.64rem; margin:0; padding:0; border:0; border-radius:0; background:transparent; display:grid; grid-template-columns:3.25rem minmax(0,1fr); gap:.22rem; align-items:center; }
.card-sigil.card-label-sigil .sigil-art { width:100%; height:100%; object-fit:contain; }
.card-sigil.card-label-sigil small { display:block; min-width:0; overflow:hidden; padding-left:.08rem; color:#554a39; font-size:.52rem; line-height:1; text-align:left; }
.card.has-card-labels { overflow:visible; }
.card.has-card-labels > .card-tags { position:absolute; z-index:3; left:.2rem; top:auto; bottom:.1rem; width:6.45rem; margin:0; display:flex; flex-direction:column; align-items:flex-start; gap:.06rem; }
.card.has-card-labels .card-label-sigil { width:6.45rem; height:1.64rem; margin:0; padding:0; border:0; border-radius:0; background:transparent; display:grid; grid-template-columns:3.25rem minmax(0,1fr); gap:.22rem; align-items:center; }
.card.has-card-labels .card-label-sigil .sigil-art { width:100%; height:100%; object-fit:contain; }
.card.has-card-labels:not(.compact-card) .card-art { width:80px!important; height:80px!important; align-self:center; flex-shrink:0; }
.card.has-card-labels:not(.compact-card) > b { margin-top:.08rem; }
.card.has-card-labels > .card-rarity { position:absolute!important; left:.2rem!important; right:auto!important; top:auto!important; bottom:3.75rem!important; z-index:4; }
.card.has-card-labels:not(.compact-card) > .card-tags { min-height:3.34rem; justify-content:flex-start; }
.layout-v2 .card.has-card-labels .card-art { width:78px; height:78px; }
.card.has-card-labels .card-mini-description { position:absolute!important; left:2.9rem!important; right:auto!important; bottom:.2rem!important; width:3.2rem; max-height:2.7rem; display:-webkit-box!important; overflow:hidden; color:#554a39; font-size:.66rem; line-height:1.05; text-align:left; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.compact-card.has-card-labels > .card-tags { left:.04rem; top:auto; bottom:.06rem; width:3.8rem; gap:.03rem; }
.compact-card.has-card-labels .card-label-sigil { width:3.8rem; height:1.06rem; grid-template-columns:2rem minmax(0,1fr); }
.inspector-sigils .card-label-sigil { width:3.2rem; height:1.45rem; min-width:3.2rem; padding:0; border:0; border-radius:0; background:transparent; display:inline-flex; }
.inspector-sigils .card-label-sigil .sigil-art { width:100%; height:100%; }
.card-tag.tag-open { background: #efc979; } .card-tag.tag-maru { background: #a9cfda; } .card-tag.tag-natural { background: #a9cf98; } .card-tag.tag-geometric { background: #b9b2dc; } .card-tag.tag-symbolic { background: #dfa4a0; } .card-tag.tag-single { background: #e6d7ad; } .card-tag.tag-double { background: #e9c98c; } .card-tag.tag-triple { background: #dfa66f; } .card-tag.tag-multi { background: #c99aba; }
.card-tag > i { display: none; font-style: normal; }
.tag-label-short { display: none; }
.card.special .card-tag { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.card.wildcard .card-tag { border-color: rgba(226,190,103,.46); background: rgba(226,190,103,.10); }
.card.selectable-card { cursor: pointer; position: relative; transition: transform .14s ease-out, box-shadow .14s ease-out, border-color .14s; }
.card.selectable-card::after { content: attr(data-attach-label); position: absolute; right: .34rem; top: .34rem; padding: .1rem .25rem; color: #fff2c8; background: rgba(73,44,18,.72); border: 1px solid rgba(255,242,200,.42); border-radius: 999px; font-size: .42rem; font-weight: 800; opacity: 1; transition: opacity .14s; }
.card.selectable-card:hover, .card.selectable-card:focus-visible { transform: translateY(-3px); border-color: #8a602e; outline: none; box-shadow: 0 10px 22px rgba(0,0,0,.34), 0 0 0 2px rgba(199,164,92,.28); }
.card.selectable-card:hover::after, .card.selectable-card:focus-visible::after { opacity: 1; }
.inspector-corner {
  content:""; position:absolute; z-index:6; top:0; right:0; width:0; height:0;
  border-top:17px solid rgba(0,0,0,.5); border-left:17px solid transparent;
  cursor:help; transition:border-top-color .14s;
}
.inspector-corner:is(:hover,:focus-visible) { border-top-color:rgba(0,0,0,.75); }
.card > .inspector-corner {
  inset:-1px -1px auto auto;
  width:22px;
  height:22px;
  border:0;
  border-top-right-radius:inherit;
  background:rgba(0,0,0,.5);
  clip-path:polygon(0 0,100% 0,100% 100%);
}
.card > .inspector-corner:is(:hover,:focus-visible) { background:rgba(0,0,0,.75); }
.compact-card { width: 66px; min-width: 66px; min-height: 96px; padding: .28rem; gap: .08rem; box-shadow: 0 4px 9px rgba(0,0,0,.2); }
.compact-card .card-art { width: 36px; height: 36px; }
.compact-card .card-mon { width: 36px; height: 36px; font-size: 1.1rem; }
.compact-card b { font-size: .56rem; }
.compact-card .card-kind, .compact-card .card-title { display: none; }
.compact-card .card-tag { padding: .07rem .15rem; font-size: .36rem; }

.connection-view .card:not(.special):not(.hidden-card) { width: 112px; min-width: 112px; min-height: 132px; padding: .42rem; gap: .16rem; align-items: stretch; background: #ddc89e; }
.connection-view .card:not(.special):not(.hidden-card) .card-kind,
.connection-view .card:not(.special):not(.hidden-card) .card-title { display: none; }
.connection-view .card:not(.special):not(.hidden-card) .card-art { width: 38px; height: 38px; align-self: center; }
.connection-view .card:not(.special):not(.hidden-card) .card-mon { width: 36px; height: 36px; align-self: center; font-size: 1.15rem; }
.connection-view .card:not(.special):not(.hidden-card) > b { font-size: .69rem; }
.connection-view .card:not(.special):not(.hidden-card) .card-tags { display: grid; grid-template-columns: 1fr; gap: .17rem; margin-top: .1rem; }
.connection-view .card:not(.special):not(.hidden-card) .card-tag { display: grid; grid-template-columns: 23px minmax(0,1fr); align-items: center; padding: .14rem .28rem .14rem .16rem; border-radius: 4px; font: 750 .56rem/1.12 system-ui,sans-serif; text-align: left; }
.connection-view .card:not(.special):not(.hidden-card) .card-tag > i { display: grid; place-items: center; min-width: 19px; min-height: 15px; margin-right: .18rem; border-right: 1px solid rgba(33,29,23,.24); font-size: .58rem; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) { width: 66px; min-width: 66px; min-height: 91px; padding: .22rem; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) .card-art,
.connection-view .card.compact-card:not(.special):not(.hidden-card) .card-mon { display: none; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) > b { font-size: .62rem; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) .card-tag { grid-template-columns: 13px minmax(0,1fr); padding: .11rem .1rem .11rem .04rem; font-size: .56rem; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) .card-tag > i { min-width: 11px; min-height: 13px; margin-right: .08rem; font-size: .54rem; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) .tag-label-long { display: none; }
.connection-view .card.compact-card:not(.special):not(.hidden-card) .tag-label-short { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-view .card-tag.tag-open, .tag-swatch.tag-open { background: #efc979 !important; }
.connection-view .card-tag.tag-maru, .tag-swatch.tag-maru { background: #a9cfda !important; }
.connection-view .card-tag.tag-natural, .tag-swatch.tag-natural { background: #a9cf98 !important; }
.connection-view .card-tag.tag-geometric, .tag-swatch.tag-geometric { background: #b9b2dc !important; }
.connection-view .card-tag.tag-symbolic, .tag-swatch.tag-symbolic { background: #dfa4a0 !important; }
.connection-view .card-tag.tag-single, .tag-swatch.tag-single { background: #e6d7ad !important; }
.connection-view .card-tag.tag-double, .tag-swatch.tag-double { background: #e9c98c !important; }
.connection-view .card-tag.tag-triple, .tag-swatch.tag-triple { background: #dfa66f !important; }
.connection-view .card-tag.tag-multi, .tag-swatch.tag-multi { background: #c99aba !important; }
.connection-view .card-tag.tag-any, .tag-swatch.tag-any { color: #f7e9c6 !important; background: #4b463d !important; border-color: #c7a45c !important; }

.action-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(255px,300px)); justify-content: start; gap: .55rem; width: min(100%, 1480px); margin-right: auto; }
.animations-toggle { white-space: nowrap; }
.animation-speed { min-width: 76px; padding: .16rem .28rem; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; font-size: .58rem; }
#endRecap:not(.hidden) { display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; }
#endRecap .end-recap-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }
.token-counter .token-pip.recent-token { outline:1px solid #fff1a8; box-shadow:0 0 6px 2px #efbb55; }
.season-choice { display:grid; gap:.65rem; min-width:min(300px,72vw); }
.season-choice h2 { margin:0 0 .25rem; color:var(--gold); font-size:1.2rem; text-align:center; }
.season-choice button { min-height:2.35rem; }
.season-choice .season-cancel { margin-top:.35rem; }
.round-banner { padding:.45rem 1.25rem; border:1px solid rgba(244,215,143,.78); border-radius:9px; color:#fff3ce; background:rgba(26,30,25,.9); box-shadow:0 0 0 3px rgba(199,164,92,.14),0 10px 30px rgba(0,0,0,.5); font:700 clamp(1.25rem,3vw,2rem)/1 Georgia,serif; letter-spacing:.16em; pointer-events:none; animation:round-banner-in 1.65s ease-out both; }
@keyframes round-banner-in { 0% { opacity:0; transform:scale(.82); } 15%,72% { opacity:1; transform:scale(1); } 100% { opacity:0; transform:scale(1.04); } }
.version-warning { color: #ffd477 !important; border-color: #c99639 !important; background: rgba(126,78,16,.25) !important; }
.card-flight { position: fixed; z-index: 55; pointer-events: none; margin: 0 !important; transform-origin: center; box-shadow: 0 8px 24px rgba(0,0,0,.55); }
.card-flight.central-card-reveal:has(.motion-reveal-card) {
  display:block; z-index:10005; overflow:hidden; border-radius:7px; box-shadow:0 8px 24px #0009;
}
.card-flight.incoming-card-glow { filter:drop-shadow(0 0 10px #ffdd76) drop-shadow(0 0 24px #e5ab4aa8); }
.card-flight.central-card-reveal.motion-reveal-target {
  overflow:visible;
  filter:none;
}
.motion-reveal-target::before {
  content:"";
  position:absolute;
  inset:-7px;
  border:3px solid color-mix(in srgb, var(--reveal-halo-color,#edca76) 72%, white);
  border-radius:13px;
  box-shadow:0 0 9px 2px var(--reveal-halo-color,#edca76),
    0 0 24px 5px color-mix(in srgb, var(--reveal-halo-color,#edca76) 70%, transparent);
  pointer-events:none;
  animation:reveal-card-halo var(--reveal-halo-duration) linear var(--reveal-halo-delay) both;
}
.motion-target-corner {
  position:absolute; bottom:4px; right:4px; z-index:3; pointer-events:none;
  width:clamp(14px,2vw,30px); height:clamp(14px,2vw,30px);
  border:solid var(--reveal-halo-color); border-width:0 4px 4px 0; border-bottom-right-radius:6px;
  filter:drop-shadow(0 0 2px #191710) drop-shadow(0 0 4px var(--reveal-halo-color));
  animation:reveal-card-halo var(--reveal-halo-duration) linear var(--reveal-halo-delay) both;
}
@keyframes reveal-card-halo {
  0%,100% { opacity:0; }
  16%,66%,82% { opacity:1; }
  43% { opacity:.45; }
}
.motion-token-delta {
  position:fixed; translate:-50% -50%; z-index:10006; pointer-events:none;
  padding:2px 5px; border:1px solid #aa9259; border-radius:8px;
  background:#28251d; color:#ffe6a2; font:bold 13px/1.1 system-ui,sans-serif;
}
.special-participants { white-space:normal; }
.special-participants b { white-space:nowrap; }
.incoming-action-cue { position:fixed; inset:0; z-index:10000; pointer-events:none; }
.incoming-action-cue.with-edge { box-shadow:inset 0 0 0 3px #f3d373, inset 0 0 clamp(24px,7vmin,72px) #e6b940ad; }
.incoming-action-label {
  position:absolute; left:50%; top:50%; translate:-50% -50%;
  box-sizing:border-box; width:max-content; max-width:calc(100% - 32px);
  padding:.55em .85em; border:1px solid #ebc766; border-radius:9px;
  background:#252016; color:#fff1c5; text-align:center; overflow-wrap:anywhere;
}
.incoming-action-cue.with-card .incoming-action-label { top:calc(50% + var(--card-half-height,min(125px,19vh)) + 12px); translate:-50% 0; }
.motion-reveal-card {
  box-sizing:border-box; width:100%; height:100%; padding:10px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px;
  border:1px solid #e8c276; border-radius:7px;
  background:linear-gradient(145deg,#e6d8b7,#b9a980); color:#25211a;
  font:700 15px/1.15 Georgia,serif; text-align:center;
}
.motion-reveal-card.is-special { background:linear-gradient(145deg,#702b22,#3b1a18); color:#fff1cf; }
.card-flight.motion-lift {
  --lift-peak:5px 15px 15px -5px #000e, 2px 6px 6px -1px #000a;
  animation:card-flight-lift var(--lift-duration) linear var(--lift-delay) both;
}
.card-flight.motion-lift.central-card-reveal {
  --lift-peak:14px 32px 26px -6px #000f, 4px 12px 10px -1px #000d;
}
@keyframes card-flight-lift {
  0%,100% { box-shadow:0 2px 5px -2px #0008, 0 1px 3px -1px #0005; }
  16%,84% { box-shadow:var(--lift-peak); }
}
.motion-reveal-card .motion-card-front { width:96px; height:96px; border-radius:4px; flex:none; }
.motion-reveal-sigils { display:flex; align-items:center; gap:4px; }
.motion-reveal-sigils img { width:24px; height:15px; object-fit:contain; }
.missing-card-art {
  display:inline-grid; place-items:center; vertical-align:middle;
  color:#fff; text-shadow:0 1px 2px #000, 0 0 3px #000; overflow:hidden;
}
.motion-card-front > .missing-card-art { width:100%; height:100%; }
.named-card-flight.motion-token { z-index: 58; color:#e7c96d; font-size:1.45rem; text-shadow:0 0 8px #ffe28b; }
.named-card-flight.motion-token-stolen { z-index:59; color:#ef8f70; font-size:1.45rem; text-shadow:0 0 9px #ff9d7d; }
.card-flight:is(.motion-token,.motion-token-stolen) { display:grid; place-items:center; box-shadow:none; background:transparent; }
.moving-token { width:16px; aspect-ratio:1; border-radius:50%; border:1px solid #fff1b4; background:radial-gradient(circle at 35% 28%,#fff2b5,#d7a94a 60%,#8d5c1e); }
.named-card-flight.motion-special { z-index:62; filter:drop-shadow(0 0 12px rgba(255,210,123,.65)); }
.card-flight:has(.motion-card-front), .card-flight:has(.motion-card-back) { display:grid; place-items:center; overflow:hidden; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.motion-card-front { display:grid; place-items:center; width:100%; height:100%; overflow:hidden; }
.motion-card-front img, .motion-card-mon { display:block; width:100%; height:100%; object-fit:contain; }
.motion-card-mon { display:grid; place-items:center; color:#25211a; font:700 1.4rem Georgia,serif; }
.motion-card-back { display:block; width:100%; height:100%; overflow:hidden; border-radius:4px; background:#e8dec3; box-shadow:0 3px 9px #0009; }
.motion-card-back img { display:block; width:100%; height:100%; object-fit:contain; }
.event-animation-pulse { animation: event-animation-pulse .62s ease-out; }
.token-animation { animation: token-animation .95s ease-out; }
@keyframes token-animation { 0% { transform: scale(.65); opacity: .25; filter: brightness(1); } 35% { transform: scale(1.55); opacity: 1; filter: brightness(1.8) saturate(1.4); box-shadow: 0 0 26px rgba(255,211,91,.95); } 70% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; filter: brightness(1); } }
.dishonor-flash { animation: dishonor-flash 1.3s ease-out; }
@keyframes dishonor-flash { 0% { filter: saturate(1); box-shadow: 0 0 0 rgba(205,74,58,0); } 28% { filter: saturate(1.8) brightness(1.22); box-shadow: 0 0 28px rgba(205,74,58,.95), inset 0 0 0 2px rgba(255,112,91,.85); } 100% { filter: saturate(1); box-shadow: none; } }
.banner-capture-flash { animation: banner-capture-flash 1.1s ease-out; }
@keyframes banner-capture-flash { 0% { transform: scale(.94); filter: brightness(1); } 35% { transform: scale(1.08); filter: brightness(1.7) saturate(1.35); box-shadow: 0 0 34px rgba(255,213,99,1); } 100% { transform: scale(1); filter: brightness(1); } }
.set-card-arrival { animation: set-card-arrival .72s cubic-bezier(.2,.8,.25,1); }
@keyframes set-card-arrival { 0% { transform: translateY(-13px) scale(.55) rotate(-7deg); opacity: .15; filter: brightness(1.8); } 55% { transform: translateY(3px) scale(1.16) rotate(2deg); opacity: 1; filter: brightness(1.35); } 100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; filter: brightness(1); } }
@keyframes event-animation-pulse { 0% { filter: brightness(1); box-shadow: 0 0 0 rgba(226,190,103,0); } 35% { filter: brightness(1.35); box-shadow: 0 0 22px rgba(226,190,103,.7); } 100% { filter: brightness(1); box-shadow: 0 0 0 rgba(226,190,103,0); } }
.action-context { flex: 0 0 100%; max-width: 920px; margin: .06rem 0 0; color: #dfca91; font-size: .66rem; line-height: 1.35; }
.turn-log-mode { max-width: 92px; min-height: 30px; padding: .25rem .35rem; color: var(--ink); border-color: rgba(199,164,92,.45); background: rgba(199,164,92,.08); font-size: .62rem; }
.optimal-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; margin: -.04rem .08rem 0 0; color: #f2d477; font-size: .9rem; line-height: 1; filter: drop-shadow(0 0 4px rgba(242,212,119,.42)); }
.action-button:not(.optimal-action) .optimal-mark { display: none; }
.action-button.optimal-action { box-shadow: inset 0 0 0 1px rgba(242,212,119,.28); }
.action-tree { display: grid; gap: .38rem; }
.action-tree-node { border: 1px solid rgba(199,164,92,.28); border-radius: 9px; background: rgba(20,27,24,.42); overflow: hidden; }
.action-tree-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; border: 0; padding: .42rem .58rem; color: var(--ink); background: rgba(199,164,92,.08); text-align: left; font-weight: 750; cursor: pointer; }
.action-tree-toggle::before { content: "▸"; color: var(--gold); margin-right: .25rem; }
.action-tree-node.is-open .action-tree-toggle::before { content: "▾"; }
.action-tree-toggle b { min-width: 1.35rem; padding: .08rem .28rem; border: 1px solid rgba(199,164,92,.45); border-radius: 999px; color: var(--gold); font-size: .66rem; text-align: center; }
.action-tree-children { display: grid; gap: .35rem; padding: .35rem; }
.action-tree-children > .action-button, .action-tree-children > .special-action-group { margin-left: .7rem; }
.action-category-menus { grid-column:1/-1; width:100%; box-sizing:border-box; display:flex; flex-wrap:wrap; align-items:flex-start; gap:.35rem; padding:.15rem 0 .4rem; }
.action-category-menu { flex:1 1 108px; min-width:0; border:1px solid rgba(199,164,92,.28); border-radius:8px; background:rgba(20,27,24,.42); overflow:visible; }
.action-category-menu-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; gap:.35rem; border:0; border-radius:7px; padding:.42rem .5rem; color:var(--ink); background:rgba(199,164,92,.08); text-align:left; font-weight:750; cursor:pointer; }
.action-category-menu-toggle::before { content:"▸"; color:var(--gold); margin-right:.12rem; }
.action-category-menu.is-open .action-category-menu-toggle::before { content:"▾"; }
.action-category-menu-toggle b { min-width:1.25rem; padding:.06rem .25rem; border:1px solid rgba(199,164,92,.45); border-radius:999px; color:var(--gold); font-size:.66rem; text-align:center; }
.action-category-menu-panel { display:grid; gap:.35rem; padding:.35rem; }
@media(max-width:700px) { .action-category-menus { flex-wrap:nowrap; overflow-x:auto; padding-bottom:.45rem; } .action-category-menu { flex:0 0 108px; } }
.turn-log-option.turn-log-compact .turn-action-details { display: none; }
.turn-log-option.turn-log-compact .turn-action-visuals { opacity: .72; transform: scale(.9); transform-origin: right center; }
.turn-log-option.turn-log-dynamic:not(:has(details[open])) { min-height: 0; }
.action-button { text-align: left; padding: .64rem; background: var(--panel-2); }
.action-button-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .55rem; }
.action-title { display: flex; align-items: flex-start; gap: .38rem; min-width: 0; }
.action-icon { width: 36px; height: 36px; margin: -.16rem 0 0 -.18rem; flex: 0 0 auto; display: grid; place-items: center; color: #f0cc78; border: 1px solid rgba(199,164,92,.42); border-radius: 8px; background: rgba(199,164,92,.09); }
.action-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.action-reason { margin-top: .16rem; color: var(--muted); font-size: .54rem; line-height: 1.2; } .action-reason summary { cursor: pointer; color: #c9b47b; font-weight: 700; } .action-reason span { display: block; margin-top: .12rem; }
.action-tier { display: inline-block !important; margin-left: .3rem; padding: .1rem .34rem; color: #251d0b; background: var(--gold); border-radius: 999px; font: 800 .62rem/1.2 system-ui,sans-serif; vertical-align: .08rem; white-space: nowrap; }
.action-tier.upgrade { background: #9fc58d; }
.action-tier.unchanged { background: #c9a36e; }
.action-button strong { display: block; color: var(--ink); font-size: .75rem; line-height: 1.18; }
.action-button small { display: block; margin-top: .2rem; color: var(--muted); font-size: .66rem; line-height: 1.28; }
.action-button .action-score { flex: 0 0 auto; padding: .16rem .35rem; border: 1px solid rgba(199,164,92,.5); border-radius: 999px; color: var(--gold); background: rgba(199,164,92,.09); font-size: .54rem; font-weight: 750; white-space: nowrap; }
.action-button .action-reason { color: #bfb5a4; font-size: .58rem; }
.action-button.end-turn { border-color: rgba(199,164,92,.45); }
.action-button.special-action { border-color: rgba(185,111,80,.62); background: linear-gradient(145deg,rgba(105,39,34,.25),var(--panel-2) 62%); }
.action-button.special-action strong { color: #f1c49f; }
.action-button.action-draw .action-title strong { color:#9bd1eb; }
.action-button.action-play .action-title strong { color:#a8d39c; }
.action-button.action-exchange .action-title strong { color:#e3bd79; }
.action-button.action-special .action-title strong { color:#efad91; }
.action-button.action-support .action-title strong { color:#a7d1ba; }
.action-button.action-honor .action-title strong { color:#e49383; }
.action-button.action-seal .action-title strong { color:#d5c58c; }
.action-button.action-end .action-title strong { color:#c9c2ad; }
.action-button.special-action::before { content: "SPECIAL"; display: inline-block; margin-bottom: .32rem; color: #dca780; font-size: .48rem; font-weight: 800; letter-spacing: .12em; }
.bot-turn-wait { grid-column: 1 / -1; padding: .72rem; border: 1px dashed rgba(199,164,92,.45); border-radius: 8px; background: rgba(199,164,92,.055); }
.bot-turn-wait strong, .bot-turn-wait small { display: block; }
.bot-turn-wait strong { color: var(--gold); font: 600 .82rem Georgia,serif; }
.bot-turn-wait small { margin-top: .22rem; color: var(--muted); line-height: 1.4; }

.lower-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 1rem; }
.event-panel, .inspector { min-width: 0; }
.event-log { max-height: 240px; overflow: auto; display: grid; gap: .4rem; }
.event { display: grid; grid-template-columns: 44px 105px 1fr; gap: .55rem; padding: .48rem; border-bottom: 1px solid var(--line); font-size: .76rem; }
.event .num { color: var(--gold); font-variant-numeric: tabular-nums; }
.event .actor { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event.rejected { border-left: 2px solid var(--lacquer-hi); }
.event.consequence { margin: -.4rem 0 0 1.1rem; padding-top: .38rem; color: #ead9ad; background: rgba(199,164,92,.055); border-left: 2px solid var(--gold); font-size: .72rem; }
.event.banner-consequence .actor { color: #edbd58; font-weight: 800; }
.empty { color: var(--muted); font-style: italic; font-size: .8rem; }
dl { margin: 0; display: grid; gap: .45rem; }
dl div { display: grid; grid-template-columns: 90px 1fr; gap: .5rem; border-bottom: 1px solid var(--line); padding: .42rem 0; }
dt { color: var(--muted); font-size: .72rem; }
dd { margin: 0; font-size: .75rem; overflow-wrap: anywhere; }

.move-popover {
  position: fixed; z-index: 60; width: min(440px,calc(100vw - 24px)); max-height: min(520px,70vh);
  padding: .78rem; overflow: hidden; color: var(--ink); background: rgba(28,31,27,.98);
  border: 1px solid rgba(199,164,92,.5); border-radius: 12px; box-shadow: 0 22px 58px rgba(0,0,0,.55);
}
.end-recap-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(4,6,4,.76); backdrop-filter: blur(5px); }
.end-recap {
  position: fixed; left: 50%; top: 50%; z-index: 100; width: min(1120px,calc(100vw - 28px)); max-height: min(1120px,calc(100dvh - 20px));
  transform: translate(-50%,-50%); display: flex; flex-direction: column; overflow-x:hidden; overflow-y:auto;
  color: var(--ink); background: linear-gradient(145deg,rgba(38,43,36,.99),rgba(21,24,20,.99));
  border: 1px solid rgba(199,164,92,.62); border-radius: 16px; box-shadow: 0 28px 90px rgba(0,0,0,.68), inset 0 1px rgba(255,255,255,.05);
}
.end-recap-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem .78rem; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 20% 0,rgba(141,37,37,.25),transparent 48%); }
.end-recap-head h2 { margin: .16rem 0 0; font: 600 1.42rem Georgia,serif; }
.end-recap-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 1.35rem; line-height: 1; }
.end-recap-outcome { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0; padding: .72rem 1.1rem; border-bottom: 1px solid var(--line); background: rgba(199,164,92,.055); }
.end-recap-outcome strong { color: #f5d98f; font: 600 .92rem Georgia,serif; }
.end-recap-outcome span { color: var(--muted); font-size: .62rem; text-align: right; }
.end-recap-why { margin: .4rem 1rem; color: var(--ink); font-size: .72rem; line-height: 1.35; overflow-x: auto; }
.end-recap-why p { margin: .3rem 0; color: var(--gold); }
.end-recap-why table { width: 100%; border-collapse: collapse; font-size: .65rem; }
.end-recap-why th, .end-recap-why td { padding: .18rem .35rem; border-bottom: 1px solid var(--line); text-align: left; }
.end-recap-players { min-height: 0; overflow:visible; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: .55rem; padding: .75rem 1rem; }
.end-recap-player { min-width: 0; display: grid; grid-template-columns: 66px minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; gap: .42rem .6rem; padding: .62rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.end-recap-player.winner { border-color: rgba(240,207,120,.72); background: linear-gradient(145deg,rgba(122,91,31,.21),rgba(255,255,255,.025)); box-shadow: inset 0 0 0 1px rgba(240,207,120,.1); }
.end-recap-player.human-player { border-color: var(--player-color); background: linear-gradient(145deg,rgba(var(--player-color-rgb),.2),rgba(255,255,255,.035)); box-shadow: 0 0 0 2px rgba(var(--player-color-rgb),.42), 0 0 18px rgba(var(--player-color-rgb),.18), inset 0 0 0 1px rgba(255,255,255,.12); }
.end-recap-player.human-player.winner { border-color: #f0cf78; box-shadow: 0 0 0 3px rgba(var(--player-color-rgb),.44), 0 0 0 5px rgba(240,207,120,.28), 0 0 22px rgba(240,207,120,.2), inset 0 0 0 1px rgba(255,255,255,.14); }
.recap-portrait {
  grid-area: auto;
  width: 62px;
  min-width: 62px;
  max-width: 62px;
  height:62px;
  min-height:62px;
  max-height:62px;
  aspect-ratio: 1 / 1;
  place-self: center;
}
.end-recap-identity { min-width: 0; }
.end-recap-identity > strong { display: flex; align-items: center; gap: .34rem; font: 600 .82rem Georgia,serif; }
.end-recap-player.human-player .end-recap-identity > strong { color: var(--player-color); text-shadow: 0 0 9px rgba(var(--player-color-rgb),.58); }
.end-recap-identity > small { display: block; margin-top: .1rem; color: var(--muted); font-size: .56rem; }
.recap-award { width:30px!important; height:30px!important; font-size:1rem!important; }
.recap-reward { display:inline-flex; width:max-content; max-width:100%; margin-top:.24rem; padding:.14rem .42rem; border:1px solid #d7bd7555; border-radius:999px; color:#f2d994; background:#7c632522; font:700 .72rem/1.2 system-ui,sans-serif; }
.end-recap-score { min-width: 70px; text-align: right; }
.end-recap-score strong { display: block; color: #f2d79d; font: 700 1.35rem Georgia,serif; }
.end-recap-score span { display: block; color: var(--muted); font-size: .48rem; white-space: nowrap; }
.end-recap-breakdown { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .25rem; padding-top: .42rem; border-top: 1px solid rgba(226,210,180,.12); }
.end-recap-breakdown span { padding: .12rem .3rem; color: var(--muted); background: rgba(255,255,255,.035); border: 1px solid rgba(226,210,180,.1); border-radius: 999px; font-size: .49rem; }
.end-recap-outcome span,
.end-recap-why,
.end-recap-why table,
.end-recap-identity > small,
.end-recap-score span,
.end-recap-breakdown span,
.end-recap-formula summary,
.end-recap-formula p,
.end-recap footer small { font-size:12px; }
.end-recap-why { line-height:1.45; }
.end-recap-why th,.end-recap-why td { padding:.28rem .4rem; }
.end-recap-breakdown { gap:.3rem; }
.end-recap-breakdown span { line-height:1.3; }
.end-recap-human-progress { flex:0 0 auto; min-width:0; }
.end-recap .human-progress-card small { font-size:11px; }
.end-recap .human-progress-card b { font-size:12px; }
.end-recap-player .winner-mark { width:26px; height:26px; font-size:.82rem; }
.runner-up-mark { width:19px; height:19px; display:inline-grid; place-items:center; flex:0 0 auto; font: .72rem "Segoe UI Emoji",sans-serif; filter:saturate(.75); opacity:.88; }
.leader-mark { width:20px; height:20px; display:inline-grid; place-items:center; flex:0 0 auto; font:.76rem "Segoe UI Emoji",sans-serif; filter:saturate(.92); }
.end-game-award { width:19px; height:19px; margin-left:.32rem; vertical-align:middle; }
.end-game-player-stats li.match-winner { box-shadow:inset 0 0 0 1px rgba(231,196,111,.34); }
.end-game-player-stats li.match-runner-up { box-shadow:inset 0 0 0 1px rgba(193,202,210,.24); }
.end-recap-breakdown b { color: var(--ink); }
.human-progress-card { flex:0 0 auto; margin:.15rem 1rem .55rem; padding:.55rem .65rem; border:1px solid rgba(199,164,92,.35); border-radius:9px; background:linear-gradient(135deg,rgba(199,164,92,.12),rgba(255,255,255,.025)); }
.human-progress-card h3 { margin:0 0 .38rem; color:#f1d58d; font:700 .78rem Georgia,serif; }
.human-progress-card>div { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.32rem; }
.human-progress-card span { display:flex; align-items:baseline; gap:.32rem; min-width:0; padding:.28rem .36rem; border-radius:6px; background:rgba(0,0,0,.15); }
.human-progress-card small { flex:1 1 auto; min-width:0; overflow:hidden; color:var(--muted); font-size:.6rem; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.human-progress-card b { flex:0 1 auto; max-width:58%; overflow:hidden; color:var(--ink); font-size:.72rem; text-overflow:ellipsis; white-space:nowrap; }
.end-recap-footer-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:.55rem; }
.end-recap-rematch-options { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; }
.end-recap-rematch-options button { color:#f4db9b; background:linear-gradient(145deg,rgba(136,47,39,.85),rgba(87,31,27,.9)); border-color:rgba(214,134,93,.68); }
.end-recap-rematch-options:not(.hidden) { min-height:34px; }
.end-game-details .mission-owner { color:var(--player-color); }
.end-game-details .mission-owner>b,.end-game-details .mission-owner>span { color:var(--player-color); }
.game-effect-layer,
.ambient-sakura-layer,
.table-decoration,
.japanese-confetti-layer { position:fixed; inset:0; width:100vw; height:100vh; height:100dvh; overflow:hidden; contain:strict; pointer-events:none; }
.table-decoration { z-index:9997; }
.table-decoration::before {
  content:""; position:absolute; inset:0;
  background:linear-gradient(to bottom,var(--decoration-edge,transparent),transparent) top/100% 24px,
    linear-gradient(to top,var(--decoration-edge,transparent),transparent) bottom/100% 24px,
    linear-gradient(to right,var(--decoration-edge,transparent),transparent) left/24px 100%,
    linear-gradient(to left,var(--decoration-edge,transparent),transparent) right/24px 100%;
  background-repeat:no-repeat; animation:game-effect-fade 1350ms ease-out both;
}
.decoration-wind::before { content:none; }
.decoration-attach { --decoration-edge:#a99ae968; }
.decoration-seal { --decoration-edge:#f4bf586e; }
.decoration-redeem { --decoration-edge:#78d4a16d; }
.decoration-lantern { --decoration-edge:#f9a45173; }
.table-decoration:not(.effect-full)::before { filter:opacity(.3); }
.decoration-attach:not(.effect-full) :is(.ink-stroke,.ink-blot),
.decoration-lantern:not(.effect-full) > i { filter:opacity(.3); }
.table-decoration > i { position:absolute; display:block; }
#landingPage > :is(.decoration-lightning,.decoration-clouds,.decoration-chrysanthemums) { z-index:-1; }
:is(.decoration-lightning,.decoration-clouds,.decoration-chrysanthemums)::before { content:none; }
.decoration-chrysanthemums > i {
  aspect-ratio:1; translate:-50% -50%;
  background:var(--chrysanthemum-sprites) 0 center / 500% 100% no-repeat;
}
#landingPage:has(> .decoration-chrysanthemums) .landing-hero :is(h1,p,label) {
  text-shadow:0 1px 2px #191a18,0 2px 6px #191a18;
}
.decoration-clouds .cloud-band {
  width:clamp(280px,78vw,1000px); height:clamp(92px,18.5vh,186px);
  --cloud-ink:#e6d7b7; --cloud-line:#a49375;
  background:
    radial-gradient(ellipse 19% 36% at 39% 44%,var(--cloud-ink) 97%,transparent),
    radial-gradient(ellipse 24% 35% at 65% 60%,var(--cloud-ink) 97%,transparent),
    radial-gradient(ellipse 13% 24% at 27% 64%,var(--cloud-ink) 97%,transparent);
}
.decoration-clouds .cloud-band[data-direction="-1"] { --cloud-ink:#d6cbb6; --cloud-line:#938670; }
.decoration-clouds .cloud-band-small { width:clamp(210px,59vw,760px); height:clamp(65px,13vh,130px); }
.decoration-clouds .cloud-frame {
  width:clamp(165px,28vw,420px); height:clamp(74px,15vh,146px);
  translate:-48% 0;
}
.decoration-clouds .cloud-frame[data-direction="-1"] { translate:-52% 0; }
.cloud-band::before,.cloud-band::after {
  content:""; position:absolute; border-radius:999px; background:var(--cloud-ink);
  box-shadow:inset 0 -2px var(--cloud-line);
}
.cloud-band::before { inset:41% 2% 39% 6%; }
.cloud-band::after { inset:69% 14% 13% 0; }
.cloud-band .cloud-curl {
  position:absolute; z-index:1; left:28%; right:21%; top:42%; height:27%;
  border:2px solid var(--cloud-line); border-top-color:transparent; border-left-color:transparent;
  border-radius:55% 40% 48% 45%; transform:rotate(-2deg);
}
.cloud-curl::after {
  content:""; position:absolute; right:-2px; top:-1px; width:clamp(13px,3vw,34px); aspect-ratio:1;
  border-radius:50%; border:2px solid var(--cloud-line); border-left-color:transparent;
  border-bottom-color:transparent; transform:rotate(-12deg);
}
.decoration-lightning .lightning-glow {
  position:absolute; inset:0; opacity:0;
  background:radial-gradient(ellipse at 50% 12%,#b5c9ff,transparent 82%);
}
.decoration-lightning .lightning-bolt {
  width:clamp(70px,17vw,270px); height:72%; opacity:0;
  translate:-50% 0;
  background:linear-gradient(#f1f7ff,#c4d7ff 64%,#a7bafb);
  clip-path:polygon(31% 0,36% 0,47% 19%,41% 28%,65% 48%,56% 58%,70% 70%,61% 77%,92% 100%,
    56% 78%,62% 70%,49% 58%,58% 49%,35% 29%,41% 20%);
}
.decoration-fireflies > i {
  width:4px; height:4px; border-radius:50%; background:#fff8a8;
  box-shadow:0 0 5px 2px #e2eb76b3, 0 0 13px 5px #b9dd523f;
}
.decoration-paulownia > i { width:var(--paulownia-size); height:var(--paulownia-size); }
.decoration-paulownia > [data-shape="leaf"] {
  clip-path:polygon(50% 17%, 61% 7%, 75% 5%, 89% 12%, 97% 29%, 93% 49%,
    83% 67%, 67% 82%, 50% 100%, 34% 83%, 17% 67%, 7% 49%, 3% 29%, 11% 12%, 25% 5%, 39% 7%);
  background:
    linear-gradient(90deg,transparent 48%,#c9dec0 49% 51%,transparent 52%),
    linear-gradient(146deg,#cde3b9,#70a995 62%,#478274);
}
.decoration-paulownia > [data-shape="flower"] {
  background:
    radial-gradient(ellipse 10% 14% at 51% 69%,#fff0ce 20%,#d7bce9 70%,transparent 100%),
    radial-gradient(ellipse 26% 23% at 29% 72%,#f0e4ff,#ad88d4 80%,transparent 99%),
    radial-gradient(ellipse 26% 23% at 71% 72%,#f0e4ff,#ad88d4 80%,transparent 99%),
    radial-gradient(ellipse 26% 19% at 50% 85%,#ecdcff,#9673c5 85%,transparent 99%),
    radial-gradient(ellipse 23% 48% at 50% 42%,#d3bafe,#956fca 78%,transparent 100%);
  filter:drop-shadow(0 1px 2px #402653);
}
.decoration-dandelion > i { width:16px; height:20px; }
.decoration-dandelion > i::before {
  content:""; position:absolute; inset:0 0 8px;
  clip-path:polygon(0 0,100% 0,50% 100%);
  background:repeating-conic-gradient(from -54deg at 50% 100%,#fff5d9 0deg 3deg,transparent 3deg 13deg);
}
.decoration-dandelion > i::after {
  content:""; position:absolute; left:calc(50% - .5px); top:10px;
  width:1px; height:9px; background:linear-gradient(#fff5d9,#b49865);
}
.decoration-wind > i {
  width:23px; height:26px; background:linear-gradient(135deg,#ffc872,#c75b30 55%,#96383b);
  clip-path:polygon(49% 100%,46% 70%,13% 80%,20% 59%,0 40%,30% 43%,16% 14%,40% 33%,50% 0,61% 33%,85% 14%,72% 43%,100% 40%,80% 59%,87% 80%,54% 70%,52% 100%);
}
.decoration-attach .ink-stroke {
  height:22px; margin-top:-11px; transform-origin:left center;
  border-radius:58% 28% 39% 51% / 63% 38% 57% 33%;
  background:repeating-linear-gradient(1deg,#080609 0 3px,#1b1620 4px,#0b080d 6px);
  box-shadow:0 1px 4px #dbbdbc55;
  animation:ink-stroke-breathe 1.15s ease-in-out infinite alternate;
}
.decoration-attach .ink-drop {
  background:#0b080d; border-radius:61% 38% 56% 44%; box-shadow:0 0 2px #d5b8a67a;
}
.decoration-attach .ink-blot {
  width:48px; height:40px; translate:-50% -50%;
  background:radial-gradient(ellipse at 42% 43%,#211923,#080609 70%);
  border-radius:49% 58% 42% 63% / 54% 37% 65% 45%;
  box-shadow:0 0 4px #d5b8a67a;
  animation:ink-blot-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes ink-stroke-breathe { from { filter:brightness(.78) saturate(.85); } to { filter:brightness(1.28) saturate(1.25); } }
@keyframes ink-blot-pulse { from { filter:brightness(.82); transform:scale(.98) rotate(-1deg); } to { filter:brightness(1.25); transform:scale(1.04) rotate(1deg); } }
.decoration-rain > i {
  width:2px; border-radius:50%; opacity:0;
  background:linear-gradient(transparent,#b7d9e4 77%,#e9f7ff);
}
.decoration-seal > i { width:8px; height:8px; rotate:45deg; background:#ffe9a0; box-shadow:0 0 9px #eeb650; }
.decoration-redeem > i { width:22px; height:19px; border-radius:65% 32% 48% 39%; background:radial-gradient(ellipse,#df695c,#863646 52%,transparent 72%); }
.decoration-snow > i { color:#fff8eb; font:normal 12px/1 system-ui,sans-serif; text-shadow:0 0 5px #fff8ebaa; }
.decoration-lantern > i {
  width:37px; height:57px; border-radius:52% 52% 44% 44% / 28% 28% 35% 35%;
  background:repeating-linear-gradient(to bottom,#78382448 0 1px,transparent 2px 6px),
    radial-gradient(ellipse at 43% 70%,#fff8c8,var(--lantern-paper,#ffba5e) 49%,var(--lantern-shade,#c05430) 90%);
  box-shadow:0 0 24px #f9a453a8,inset 0 0 6px #773827;
}
.decoration-lantern[data-reward-category="character"] { --lantern-paper:#cf624c; --lantern-shade:#85382f; }
.decoration-lantern[data-reward-category="lore"] { --lantern-paper:#8492bc; --lantern-shade:#344c76; }
.decoration-lantern[data-reward-category="music"] { --lantern-paper:#8bb297; --lantern-shade:#426754; }
.decoration-lantern[data-reward-category="effects"] { --lantern-paper:#e4d8ad; --lantern-shade:#9b804e; }
.reward-emblem { display:grid; place-items:center; flex:none; width:46px; height:46px; border:1px solid #caa95a; border-radius:50%; color:#eed9a4; font:24px Georgia,serif; }
.content-progress { margin-top:12px; padding:10px; border-top:1px solid #caa95a66; font-size:12px; line-height:1.5; }
.content-progress h3 { margin:0 0 6px; font-size:15px; }
.content-progress p { margin:4px 0; }
.content-progress small,.lore-locked { color:#d7c8a4; }
.decoration-lantern > i::before,.decoration-lantern > i::after {
  content:""; position:absolute; left:24%; width:52%; height:5px;
  border-radius:2px; background:#572a28; box-shadow:0 1px 1px #e5a85e;
}
.decoration-lantern > i::before { top:0; }
.decoration-lantern > i::after { bottom:0; }
.ambient-sakura-layer { z-index:9997; }
.game-effect-layer { z-index:9998; }
.japanese-confetti-layer { z-index:9999; }
.game-effect-glow { position:absolute; border-radius:8px; border:2px solid var(--effect-color,#f5b1c4); box-shadow:0 0 8px var(--effect-color,#f5b1c4); animation:game-effect-fade 1450ms ease-out both; }
.game-effect-particle { position:absolute; }
.game-effect-layer .ginkgo-particle {
  width:var(--sakura-size); height:calc(var(--sakura-size) * .83); border-radius:0;
  background:repeating-conic-gradient(from 310deg at 50% 85%,#f4cd70 0 8deg,#c98b37 8deg 11deg);
  clip-path:polygon(48% 100%,48% 78%,18% 58%,5% 32%,12% 15%,33% 3%,48% 14%,63% 3%,87% 13%,96% 32%,84% 57%,53% 78%,53% 100%);
}
.game-effect-layer[data-effect="dishonor"] {
  background:linear-gradient(to bottom,var(--dishonor-edge),transparent) top/100% 34px,
    linear-gradient(to top,var(--dishonor-edge),transparent) bottom/100% 34px,
    linear-gradient(to right,var(--dishonor-edge),transparent) left/34px 100%,
    linear-gradient(to left,var(--dishonor-edge),transparent) right/34px 100%;
  background-repeat:no-repeat;
  animation:game-effect-fade 1750ms ease-out both;
}
.game-effect-layer.effect-full[data-effect="dishonor"] { --dishonor-edge:#f24658e0; }
.game-effect-layer:not(.effect-full)[data-effect="dishonor"] { --dishonor-edge:#f2465843; }
.game-effect-layer[data-effect="shame"] {
  box-shadow:inset 0 0 6vmin 1.5vmin #6e35938c;
  animation:shame-edge-fade 1500ms ease-in-out both;
}
.game-effect-layer.effect-full[data-effect="shame"] { box-shadow:inset 0 0 10vmin 2.5vmin #6e3593df; }
@keyframes shame-edge-fade { 0%,100% { opacity:0; } 25%,45% { opacity:1; } }
.shame-flash { animation:shame-player-glow 1.2s ease-out; }
@keyframes shame-player-glow { 0%,100% { box-shadow:none; } 35% { box-shadow:inset 0 0 0 2px #be85ff,0 0 20px #6e3593b0; } }
.game-effect-layer:not(.effect-full) .game-effect-glow { filter:opacity(.3); }
.game-effect-layer.effect-reduced, .effect-reduced .game-effect-glow { animation-duration:820ms; }
.effect-reduced .game-effect-particle { animation:game-effect-fade 1400ms ease-out both; }
.game-effect-particle.sakura-particle {
  width:var(--sakura-size); height:var(--sakura-size); border-radius:0;
  --sakura-light:#fff0f6; --sakura-pink:#ed92b1;
  background:
    radial-gradient(circle at 50% 49%,#ffc96e 0 7%,#bc557a 8% 12%,transparent 14%),
    radial-gradient(ellipse 23% 28% at 50% 24%,var(--sakura-light) 25%,var(--sakura-pink) 96%,transparent 100%),
    radial-gradient(ellipse 27% 23% at 76% 43%,var(--sakura-light) 25%,var(--sakura-pink) 96%,transparent 100%),
    radial-gradient(ellipse 23% 27% at 67% 73%,var(--sakura-light) 25%,var(--sakura-pink) 96%,transparent 100%),
    radial-gradient(ellipse 23% 27% at 33% 73%,var(--sakura-light) 25%,var(--sakura-pink) 96%,transparent 100%),
    radial-gradient(ellipse 27% 23% at 24% 43%,var(--sakura-light) 25%,var(--sakura-pink) 96%,transparent 100%);
}
.sakura-particle[data-shape="pale"] { --sakura-light:#fffdf8; --sakura-pink:#fac1d3; }
.sakura-particle[data-shape="petal"] {
  background:linear-gradient(135deg,#fff4f8 18%,#f4a2be 62%,#c96891);
  clip-path:polygon(47% 8%,62% 0,80% 5%,94% 20%,97% 37%,91% 57%,75% 76%,49% 100%,27% 81%,12% 61%,4% 40%,7% 22%,21% 7%,36% 2%);
}
.effect-reduced .game-effect-particle.sakura-particle { animation:game-effect-fade 1400ms ease-out both; }
@keyframes game-effect-fade { 0%, 35% { opacity:.88; } 100% { opacity:0; } }
.japanese-confetti { position:absolute; width:9px; height:15px; opacity:.82; border-radius:1px; background:#e9c45f; box-shadow:0 0 5px #fff4; animation:japanese-confetti-fall var(--fall-duration) linear var(--fall-delay) forwards; }
.japanese-confetti.piece-1 { width:7px; height:7px; border-radius:50%; background:#b64235; }
.japanese-confetti.piece-2 { width:6px; height:18px; background:#e9e0c6; }
.japanese-confetti.piece-3 { width:12px; height:9px; background:#4b8b76; clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); }
.japanese-confetti.piece-4 { width:11px; height:7px; background:#7995b5; }
@keyframes japanese-confetti-fall { 0% { opacity:.82; transform:translate3d(0,0,0) rotate(0); } 78% { opacity:.82; } 100% { opacity:0; transform:translate3d(var(--fall-drift),140dvh,0) rotate(var(--fall-spin)); } }
.japanese-confetti-layer.motion-reduced .japanese-confetti { animation:confetti-reduced-fade 1.2s ease-out forwards; }
@keyframes confetti-reduced-fade { from { opacity:.6; } to { opacity:0; } }
.end-recap-formula { margin: 0 1rem .7rem; border: 1px solid rgba(199,164,92,.22); border-radius: 8px; background: rgba(199,164,92,.045); }
.end-recap-formula summary { padding: .5rem .62rem; color: #e4c985; cursor: pointer; font-size: .62rem; font-weight: 700; }
.end-recap-formula p { margin: 0; padding: 0 .62rem .6rem; color: var(--muted); font-size: .58rem; line-height: 1.45; }
.end-recap footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .68rem 1rem; border-top: 1px solid var(--line); background: rgba(0,0,0,.14); }
.end-recap footer small { max-width: 620px; color: var(--muted); font-size: .58rem; line-height: 1.35; }
.end-recap footer button { padding: .44rem .72rem; white-space: nowrap; }
.setup-dialog { width: min(820px,calc(100vw - 28px)); }
.setup-intro { margin: 0; padding: .8rem 1.1rem; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .75rem; }
.setup-body { min-height: 0; overflow-y: auto; padding: .9rem 1.1rem; scrollbar-width: thin; }
.setup-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; margin-bottom: .85rem; }
.setup-toolbar label, .setup-human { display: grid; gap: .28rem; color: var(--gold); font-size: .66rem; font-weight: 700; }
.setup-toolbar input, .setup-toolbar select, .setup-human select { min-height: 34px; padding: .4rem .55rem; }
.setup-toolbar label>small { max-width:210px; color:var(--muted); font-size:.53rem; font-weight:500; line-height:1.2; }
.setup-toolbar input { width: 125px; }
.setup-toolbar button { min-height: 34px; }
.setup-toolbar .setup-language select { min-width:128px; }
.setup-shortcuts { display:flex; align-items:center; gap:.4rem; }
.setup-shortcuts #setupClose { position:static; }
#guideDrawer { z-index:230; }
#guideBackdrop,#xpBoardBackdrop { z-index:210; }
#quickRulesDialog { width:min(850px,92vw); max-height:85vh; color:var(--ink); background:#20271f; border:1px solid var(--gold); border-radius:12px; padding:1rem; }
#quickRulesDialog header { position:sticky; top:-1rem; z-index:2; display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.6rem 0; background:#20271f; border-bottom:1px solid var(--gold); }
#quickRulesClose { flex-shrink:0; min-height:40px; border-color:var(--gold); }
#quickRulesDialog::backdrop { background:#0008; }
.setup-toolbar label { position:relative; }
.setup-toolbar label>small { max-width:32ch; font-size:.68rem; line-height:1.35; }
.setup-toolbar { row-gap:1.2rem; }
.setup-flags,.seed-controls { display:flex; align-items:center; gap:.2rem; }
.setup-flags button { padding:.25rem .35rem; font-size:1.15rem; }
.setup-flags button[aria-pressed="true"] { border-color:var(--gold); background:#65542b; }
.setup-toolbar .seed-controls input { width:112px; }
.xp-board { position:fixed; left:0; top:0; bottom:0; width:min(360px,92vw); z-index:220; background:#20271f; border-right:1px solid var(--gold); padding:1rem; overflow-y:auto; box-shadow:5px 0 30px #0008; }
.xp-board header { display:flex; align-items:center; justify-content:space-between; }
.xp-board h2 { font-size:1.1rem; }
.xp-board p { color:var(--muted); font-size:.72rem; }
.xp-board-row { display:grid; grid-template-columns:2rem 70px minmax(0,1fr); grid-template-rows:auto; align-items:center; gap:.6rem; padding:.7rem .25rem; border-bottom:1px solid #ffffff18; border-radius:7px; }
.xp-board-row>strong { grid-column:1; grid-row:1; }
.xp-board-row>span:last-child { grid-column:3; grid-row:1; min-width:0; overflow-wrap:anywhere; }
.xp-board-row small { display:block; color:var(--gold); margin-top:.3rem; }
.xp-face-wrap { grid-column:2; grid-row:1; position:relative; width:70px; height:70px; }
.xp-board-row .xp-face { grid-area:auto; position:static; margin:0; display:block; width:70px!important; height:70px!important; min-width:70px; max-width:70px; border-radius:50%; border:1px solid var(--gold); }
.xp-crown,.xp-cup { position:absolute; font-style:normal; font-size:1.25rem; line-height:1; text-shadow:0 1px 3px #000; }
.xp-crown { top:-5px; left:-3px; color:#ffcf54; }
.xp-cup { bottom:-3px; right:-4px; }
.xp-favorite { color:#f3cc55; }
.xp-board-row.at-table { background:rgba(var(--player-color-rgb),.17); border:1px solid rgba(var(--player-color-rgb),.45); }
.xp-board-row .xp-trend { font-size:.8rem; margin-top:.2rem; }
.xp-board-row .trend-1 { color:#7ed69a; }
.xp-board-row .trend-0 { color:#dec465; }
.xp-board-row .trend--1 { color:#e17a54; }
.xp-board-footer { display:flex; flex-wrap:wrap; gap:.5rem; padding:1rem 0; }
.character-relationship { display:flex; align-items:center; gap:.8rem; margin:.7rem 0; }
.character-relationship p { flex:1; min-width:0; margin:0; }
.character-relationship .relationship-face { grid-area:auto; position:static; flex:0 0 70px; width:70px; min-width:70px; max-width:70px; height:70px; margin:0; }
.locale-switcher .language-icon { display:inline-block; font-size:16px; line-height:1; }
.locale-switcher .visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:700px) { .locale-switcher .language-icon { display:inline-block!important; } }
.compatibility-mode-help { flex: 1 1 100%; color: var(--muted); font-size: .64rem; }
.setup-seats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .62rem; }
.setup-seat { min-width: 0; display: flex; align-items: center; gap: .75rem; padding: .65rem; border: 1px solid rgba(var(--player-color-rgb),.48); border-radius: 10px; background: linear-gradient(135deg,rgba(var(--player-color-rgb),.12),rgba(255,255,255,.025)); }
.setup-seat:has(select:focus) { border-color: var(--player-color); }
.setup-seat.human-selected { border-color: var(--player-color); background: linear-gradient(135deg,rgba(var(--player-color-rgb),.18),rgba(255,255,255,.035)); box-shadow: 0 0 0 2px rgba(var(--player-color-rgb),.34), 0 0 18px rgba(var(--player-color-rgb),.14); }
.setup-seat .setup-portrait,.player:not(.move-subject):not(.winner) > .player-portrait { border-color:var(--player-color); }
.setup-portrait { cursor: pointer; transition: transform .14s, filter .14s; }
.setup-portrait:hover, .setup-portrait:focus-visible { transform: scale(1.06); filter: saturate(1.2) brightness(1.08); }
.setup-portrait { flex:0 0 84px; width:84px; height:84px; min-width:84px; max-width:84px; min-height:84px; max-height:84px; aspect-ratio:1 / 1; }
.setup-seat-fields { min-width: 0; display: grid; gap: .35rem; flex: 1; }
.setup-seat-fields strong { color: var(--player-color); font-size: .72rem; }
.setup-seat-fields select { min-width: 0; width: 100%; }
.setup-seat .setup-controller-toggle { flex:0 0 auto; min-width:72px; min-height:34px; padding:.35rem .45rem; border-color:rgba(var(--player-color-rgb),.52); color:#d6d0c2; background:rgba(0,0,0,.2); font-size:.62rem; white-space:nowrap; }
.setup-seat.human-selected .setup-controller-toggle { border-color:var(--player-color); color:var(--ink); background:rgba(var(--player-color-rgb),.28); box-shadow:0 0 0 1px rgba(var(--player-color-rgb),.2); }
.setup-seat .setup-controller-toggle:disabled { opacity:.35; }
#landingPage:has(#landingPlayOptions:popover-open) #landingHomeMessage { display:none; }
.setup-seat.lineup-seat-disabled { opacity: .38; }
.setup-human { margin-top: .8rem; max-width: 360px; }
.setup-error { margin: .55rem 0 0; color: #f0a59e; font-size: .72rem; }
.setup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.setup-tutorial-action { display:flex; align-items:center; gap:.38rem; min-height:34px; padding:.35rem .55rem; border:1px solid rgba(114,182,255,.72); border-radius:5px; color:#b9e2ff; background:rgba(25,82,159,.38); font-size:.66rem; font-weight:700; cursor:pointer; white-space:nowrap; }
.setup-tutorial-action:hover,.setup-tutorial-action:focus-within { border-color:#9bd1ff; background:rgba(35,105,200,.52); box-shadow:0 0 0 2px rgba(114,182,255,.2); }
.setup-tutorial-action input { accent-color:#72b6ff; margin:0; }
.setup-tutorial-action.is-first-match { box-shadow:0 0 0 2px rgba(114,182,255,.26),0 0 14px rgba(114,182,255,.18); }
#setupTutorialNote { display:block; flex:1 1 100%; color:var(--muted); font-size:.58rem; line-height:1.3; }
@media (max-width: 650px) {
  .hand-content { grid-template-columns: 1fr; }
  .card-inspector { order: -1; }
  .setup-seats { grid-template-columns: 1fr; }
  .setup-portrait { flex-basis:64px; width:64px; height:64px; min-width:64px; max-width:64px; min-height:64px; max-height:64px; }
  .setup-dialog footer { align-items: stretch; flex-direction: column; }
  .setup-actions button { flex: 1; }
}

.attach-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4,6,4,.56); backdrop-filter: blur(2px); }
.discard-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4,6,4,.56); backdrop-filter: blur(2px); }
.discard-drawer { position: fixed; inset: 0 0 0 auto; z-index: 80; width: min(560px,95vw); height: 100vh; display: flex; flex-direction: column; color: var(--ink); background: rgba(24,27,23,.985); border-left: 1px solid rgba(199,164,92,.45); box-shadow: -24px 0 70px rgba(0,0,0,.55); }
.discard-drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); background: linear-gradient(120deg,rgba(141,37,37,.2),transparent); }
.discard-drawer-head h2 { margin: .16rem 0 0; font: 600 1.25rem Georgia,serif; }
.discard-drawer-head p { margin: .28rem 0 0; color: var(--muted); font-size: .7rem; }
.discard-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 1.35rem; line-height: 1; }
.discard-cards { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill,minmax(112px,1fr)); align-content: start; gap: .75rem; padding: .85rem 1rem 1.5rem; }
.discard-card-entry { position: relative; display: grid; justify-items: center; gap: .3rem; padding: .45rem; border: 1px solid transparent; border-radius: 10px; }
.discard-card-entry > span { color: var(--muted); font-size: .58rem; }
.discard-card-entry.top { border-color: rgba(146,212,182,.62); background: rgba(146,212,182,.08); }
.kabuki-action-group { gap:0; }
.kabuki-options { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,.8fr) auto; gap:.35rem; align-items:center; padding:.3rem .45rem .38rem; border:1px solid rgba(199,164,92,.35); border-top:0; background:rgba(20,30,25,.62); }
.kabuki-options label { display:grid; gap:.12rem; color:var(--muted); font-size:.58rem; }
.kabuki-options select { min-width:0; max-width:100%; }
.kabuki-options .primary { white-space:nowrap; padding:.3rem .45rem; font-size:.62rem; }
.kabuki-choice-preview { min-width:0; overflow:hidden; }
.kabuki-choice-chip { display:flex; align-items:center; gap:.25rem; min-width:0; padding:.22rem .35rem; border-left:3px solid var(--kabuki-target-color,#c7a45c); border-radius:4px; background:rgba(255,255,255,.06); color:var(--ink); font-size:.58rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kabuki-choice-chip b { color:var(--kabuki-target-color,#f0d58e); overflow:hidden; text-overflow:ellipsis; }
.kabuki-choice-chip small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; }
.kabuki-choice-chip i { color:#f2d079; font-style:normal; margin-left:auto; }
.kabuki-choice-skip { color:var(--muted); border-left-color:#777; }
@media (max-width: 800px) { .kabuki-options { grid-template-columns:1fr auto; } .kabuki-choice-preview { grid-column:1 / -1; order:3; } }
.special-response[aria-label="Kabuki"] .response-options { grid-template-columns:repeat(auto-fit,minmax(min(100%, 150px),1fr)); gap:.25rem; padding:.2rem; }
.special-response[aria-label="Kabuki"] .response-choice-button {
  grid-template-columns:minmax(0,1fr);
  justify-items:stretch;
  align-content:start;
  min-width:0;
  min-height:44px;
  padding:.28rem;
  text-align:left;
  white-space:normal;
}
.special-response[aria-label="Kabuki"] .response-card-art { width:32px; height:36px; object-fit:contain; }
.special-response[aria-label="Kabuki"] .response-card-tags { display:flex; gap:.12rem; flex-wrap:wrap; font-size:.48rem; }
.kabuki-target-card { display:flex; align-items:flex-start; gap:.35rem; min-width:0; }
.kabuki-target-card > .response-card-art { flex:0 0 32px; }
.kabuki-target-copy {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  flex:1;
  gap:.15rem;
  min-width:0;
  overflow-wrap:anywhere;
  font-size:var(--text-xs, 11px);
  line-height:1.25;
}
.kabuki-target-copy .response-card-tags { justify-content:flex-start; }
.kabuki-target-owner { color:var(--kabuki-target-color,#e8cb7a); font-weight:700; }
.kabuki-response-target i { display:block; color:#f2d079; font-style:normal; }
.kabuki-source-group { border-top:1px solid rgba(199,164,92,.3); padding:.28rem 0 .1rem; }
.kabuki-source-group:first-of-type { border-top:0; }
.kabuki-source-group > header { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; min-height:38px; padding:.15rem .3rem; color:var(--gold); }
.kabuki-source-group > header .response-card-art { width:34px; height:38px; object-fit:contain; }
.kabuki-source-group > header strong { color:var(--ink); font-size:.68rem; }
.kabuki-source-group > header .response-card-tags { display:flex; gap:.12rem; font-size:.5rem; }
.discard-card-entry .card { opacity: 1 !important; filter: none !important; }
.discard-card-entry.top > span { color: #b5ecd3; font-weight: 750; }
.attach-drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(520px,95vw); height: 100vh;
  display: flex; flex-direction: column; color: var(--ink); background: rgba(24,27,23,.985);
  border-right: 1px solid rgba(199,164,92,.45); box-shadow: 24px 0 70px rgba(0,0,0,.55);
}
.attach-drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--line); background: linear-gradient(240deg,rgba(141,37,37,.2),transparent); }
.attach-drawer-head h2 { margin: .16rem 0 0; font: 600 1.25rem Georgia,serif; }
.attach-drawer-head p { margin: .28rem 0 0; color: var(--muted); font-size: .7rem; }
.attach-map-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 1.35rem; line-height: 1; }
.attach-map-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: .55rem; padding: .8rem 1rem 1.5rem; scrollbar-width: thin; }
.attach-card-group { border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); overflow: hidden; }
.attach-card-head { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: .55rem; padding: .5rem .58rem; background: rgba(199,164,92,.055); }
.attach-card-kamon { width: 34px; height: 34px; }
.attach-card-kamon .guide-kamon { width: 34px; height: 34px; }
.attach-card-head strong, .attach-card-head small { display: block; }
.attach-card-head strong { color: #f2d79d; font: 600 .78rem Georgia,serif; }
.attach-card-head small { margin-top: .1rem; color: var(--muted); font-size: .55rem; }
.attach-card-count { min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 .28rem; color: #231b0c; background: var(--gold); border-radius: 999px; font-size: .57rem; font-weight: 750; }
.attach-routes { display: grid; gap: .35rem; padding: .4rem; }
.attach-route { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .5rem; padding: .48rem; text-align: left; background: rgba(255,255,255,.025); }
.attach-route:hover { background: rgba(199,164,92,.08); }
.attach-route-kamons { display: flex; gap: .12rem; }
.attach-route-kamons .guide-kamon { width: 25px; height: 25px; }
.attach-route-copy, .attach-route-copy strong, .attach-route-copy span, .attach-route-copy small { display: block; min-width: 0; }
.attach-route-copy strong { color: var(--ink); font-size: .69rem; }
.attach-route-copy span { margin-top: .1rem; color: #d4c9b5; font-size: .6rem; }
.attach-route-copy small { margin-top: .16rem; color: var(--muted); font-size: .54rem; line-height: 1.3; }
.attach-route-score { align-self: center; padding: .14rem .32rem; color: var(--gold); border: 1px solid rgba(199,164,92,.42); border-radius: 999px; font-size: .53rem; }
.attach-none { margin: .15rem .2rem; color: var(--muted); font-size: .62rem; font-style: italic; }

.move-popover-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.move-popover-head h2 { margin: .12rem 0 0; font: 600 1rem Georgia,serif; }
.move-popover-close { width: 30px; height: 30px; padding: 0; font-size: 1.2rem; line-height: 1; }
.move-popover-context { margin: .55rem 0; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.move-popover-list { max-height: min(390px,52vh); overflow: auto; display: grid; gap: .35rem; scrollbar-width: thin; }
.move-option { display: grid; grid-template-columns: 24px 25px minmax(0,1fr) auto; gap: .45rem; align-items: start; padding: .48rem; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); }
.move-option.chosen { border-color: rgba(199,164,92,.62); background: rgba(199,164,92,.08); }
.move-number { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--gold); background: rgba(199,164,92,.1); font-size: .65rem; font-weight: 750; }
.move-option .action-icon { width: 23px; height: 23px; border-radius: 6px; }
.move-option .action-icon svg { width: 14px; height: 14px; }
.move-option strong, .move-option span, .move-option small { display: block; }
.move-option strong { font-size: .72rem; }
.move-option div > span { margin-top: .12rem; color: var(--muted); font-size: .62rem; }
.move-option small { margin-top: .22rem; color: #bfb5a4; font-size: .58rem; line-height: 1.3; }
.chosen-label { align-self: center; color: #251d0b; background: var(--gold); border-radius: 999px; padding: .12rem .35rem; font-size: .52rem; text-transform: uppercase; }
.diagnostic-lights { display:flex; gap:3px; min-width:0; overflow-x:auto; align-items:center; scrollbar-width:none; }
.diagnostic-lights::-webkit-scrollbar { display:none; }
.layout-v2 .mode-tabs { min-width:0; flex-wrap:nowrap; }
.layout-v2 .mode-tabs > button { flex-shrink:0; }
.diagnostic-chip { display:inline-flex; flex-direction:column; justify-content:center; gap:4px; align-items:center; flex:0 0 64px; width:64px; height:42px; box-sizing:border-box; white-space:normal; font-size:9px; padding:3px; }
.diagnostic-chip-label { font-size:9px; line-height:1.1; text-align:center; width:100%; height:20px; overflow:hidden; }
.diagnostic-chip i,.diagnostic-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:currentColor; flex-shrink:0; box-shadow:0 0 5px currentColor; }
.diagnostic-chip.red,.diagnostic-card.red { color:#ff9085; }
.diagnostic-chip.yellow,.diagnostic-card.yellow { color:#efca6d; }
.diagnostic-chip.orange,.diagnostic-card.orange { color:#f2a35d; }
.diagnostic-card.green { color:#89d1ae; }
.diagnostic-card.unknown { color:#a9b2bb; }
.diagnostics-drawer { position:fixed; inset:0 auto 0 0; z-index:81; width:min(420px,50vw); height:100dvh; display:flex; flex-direction:column; background:#181d19; border-right:1px solid var(--gold); box-shadow:12px 0 32px #0008; }
body.diagnostics-open .guide-drawer { width:min(520px,50vw); }
#diagnosticsDrawer { z-index:200; }
body.diagnostics-focus #diagnosticsDrawer { z-index:230; }
body.diagnostics-focus #guideDrawer { z-index:200; }
.diagnostic-card { border:1px solid #ffffff25; border-left:3px solid currentColor; border-radius:8px; padding:10px; margin-bottom:10px; }
.diagnostic-card header { display:flex; gap:8px; align-items:center; font-size:13px; }
.diagnostic-card header span { margin-left:auto; white-space:nowrap; font-size:11px; }
.diagnostic-card p { font-size:12px; line-height:1.4; color:var(--ink); margin:8px 0; }
.diagnostic-card small { font-size:11px; color:var(--muted); }
.diagnostic-measure { font-size:12px; }
.diagnostic-chart { width:100%; height:82px; display:block; margin:6px 0; }
.diagnostic-chart text { font-size:9px; fill:var(--muted); }
.diagnostic-axis { stroke:#ffffff30; }
.diagnostic-threshold { stroke:#efca6d80; stroke-dasharray:4 4; }
@media(max-width:650px) { .diagnostics-drawer .guide-head { padding:8px; } .diagnostics-drawer .guide-body { padding:6px; } .diagnostic-card header { flex-wrap:wrap; } .diagnostic-card header span { margin-left:0; } }
.guide-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4,6,4,.56); backdrop-filter: blur(2px); }
.guide-drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 80; width: min(520px,95vw); height: 100vh;
  display: flex; flex-direction: column; color: var(--ink); background: rgba(24,27,23,.985);
  border-left: 1px solid rgba(199,164,92,.45); box-shadow: -24px 0 70px rgba(0,0,0,.55);
}
.guide-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--line); background: linear-gradient(120deg,rgba(141,37,37,.2),transparent); }
.guide-head h2 { margin: .16rem 0 0; font: 600 1.25rem Georgia,serif; }
.guide-head p { margin: .28rem 0 0; color: var(--muted); font-size: .7rem; }
.guide-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 1.35rem; line-height: 1; }
.guide-tabs { display: grid; grid-template-columns: repeat(8,1fr); border-bottom: 1px solid var(--line); background: #181a17; }
.guide-tab { min-width: 0; padding: .65rem .25rem; color: var(--muted); background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; font-size: .65rem; }
.guide-tab:last-child { border-right: 0; }
.guide-tab.active { color: var(--ink); background: rgba(199,164,92,.1); box-shadow: inset 0 -2px var(--gold); }
.guide-tab span { margin-left: .16rem; padding: .05rem .24rem; color: #231b0c; background: var(--gold); border-radius: 999px; font-size: .52rem; }
.guide-body { flex: 1; min-height: 0; overflow-y: auto; padding: .9rem 1rem 1.5rem; scrollbar-width: thin; }
.guide-intro { margin: 0 0 .7rem; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.special-guide-list, .completed-list { display: grid; gap: .45rem; }
.special-help-card { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: .65rem; padding: .6rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.special-help-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff0d0; background: linear-gradient(145deg,#7b2b25,#391a18); border: 1px solid #a7644c; border-radius: 50%; font: 1.25rem Georgia,serif; }
.special-help-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.special-help-title strong { color: #f2d79d; font: 600 .82rem Georgia,serif; }
.special-help-title small { color: var(--muted); font-size: .55rem; text-align: right; }
.special-help-card p { margin: .25rem 0 0; color: #d2cabd; font-size: .66rem; line-height: 1.42; }
.variant-list { display: grid; gap: .4rem; }
.variant-option { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: .65rem; padding: .72rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); cursor: pointer; }
.variant-option input { width: 18px; height: 18px; margin-top: .08rem; accent-color: var(--gold); }
.variant-option strong, .variant-option small { display: block; }
.variant-option strong { color: #f2d79d; font: 600 13px/1.3 Georgia,serif; }
.variant-option small { margin-top: .18rem; color: #d1c8b8; font-size: 12px; line-height: 1.35; }
.variant-select-option { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.variant-select-option select { min-width: 150px; padding: .4rem .55rem; color: var(--ink); background: #171c18; border: 1px solid rgba(199,164,92,.45); border-radius: 7px; font-size: .72rem; font-weight: 700; }
.variant-select-option small { grid-column: 1 / -1; }
/* All choice controls, including labels without variant-select-option, need room. */
[data-guide-panel="variants"] .variant-option { padding:.48rem .55rem; gap:.4rem; }
[data-guide-panel="variants"] .variant-option>span { min-width:0; }
[data-guide-panel="variants"] .variant-option:has(select) { grid-template-columns:minmax(0,1fr); align-items:start; cursor:default; }
[data-guide-panel="variants"] .variant-option select {
 width:100%; min-width:0; max-width:100%; min-height:34px; box-sizing:border-box;
 padding:5px 8px; font:600 13px/1.3 var(--font-ui); color:#fff0cf;
 background:#25382f; border:1px solid #ad955e; border-radius:6px;
}
[data-guide-panel="variants"] .variant-option select option { color:#fff0cf; background:#25382f; }
[data-guide-panel="variants"] .variant-option:has(input:checked) { background:rgba(199,164,92,.1); border-color:#ad955e; }
[data-guide-panel="variants"] .variant-option:focus-within { outline:2px solid #e5cb83; outline-offset:1px; }
[data-guide-panel="variants"] .variant-option select:disabled { opacity:.65; cursor:not-allowed; }
[data-guide-panel="variants"] .variant-option strong { font-size:12px; }
[data-guide-panel="variants"] .variant-option small { font-size:11px; line-height:1.28; }
@media(pointer:coarse) {
 [data-guide-panel="variants"] .variant-option { min-height:44px; }
 [data-guide-panel="variants"] .variant-option select { min-height:44px; }
}
.variant-session-status { margin-top: .8rem; padding: .62rem .7rem; border: 1px solid rgba(199,164,92,.35); border-radius: 8px; color: #d6cbb7; background: rgba(199,164,92,.055); font-size: .67rem; line-height: 1.4; }
.variant-session-status strong, .variant-session-status small { display: block; }
.variant-session-status div + div { margin-top: .6rem; }
.variant-session-status small { margin-top: .25rem; color: #e2b66c; }
.preset-code-box { margin: .8rem 0 0; padding: 10px; border: 1px solid rgba(199,164,92,.35); border-radius: 8px; background: rgba(255,255,255,.025); }
.preset-code-row { display: flex; gap: 8px; margin: 5px 0; }
.preset-code-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
#presetCodeStatus { min-height: 1.2em; margin-top: 4px; color: #d6cbb7; }
#presetCodeStatus.error { color: #ef8a78; }
.set.maturity-protected { border-color:rgba(126,180,206,.76); background:linear-gradient(110deg,rgba(48,112,145,.24),rgba(70,103,121,.12) 58%,rgba(255,255,255,.025)); box-shadow:inset 0 0 0 1px rgba(142,207,231,.12); }
.set.special-protected { border-color:rgba(127,194,176,.82); background:linear-gradient(110deg,rgba(51,135,111,.2),rgba(48,94,83,.1) 58%,rgba(255,255,255,.02)); box-shadow:inset 0 0 0 1px rgba(147,224,198,.12); }
.set.maturity-limited { background: linear-gradient(90deg,rgba(199,164,92,.12),rgba(255,255,255,.018)); }
.maturity-gate-label { display: block; max-width: 100%; padding: .1rem .34rem; border: 1px solid rgba(226,182,108,.5); border-radius: 999px; color: #f0c879; font: 800 .58rem/1.15 system-ui,sans-serif; white-space: nowrap; box-sizing: border-box; }
.maturity-protected .maturity-gate-label { color: #f0a08e; border-color: rgba(212,94,75,.55); }
.normal-guide-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.normal-guide-card { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: .55rem; padding: .58rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.normal-guide-card.wildcard { border-color: rgba(199,164,92,.58); background: rgba(199,164,92,.06); }
.normal-guide-art { width: 50px; height: 50px; object-fit: contain; padding: 2px; border: 1px solid rgba(199,164,92,.42); border-radius: 8px; background: var(--cream-card); }
.normal-guide-art.fallback { display: grid; place-items: center; color: #3c3429; font: 1.45rem Georgia,serif; }
.normal-guide-main { min-width: 0; }
.normal-guide-title { display: flex; align-items: baseline; justify-content: space-between; gap: .45rem; }
.normal-guide-title strong { color: #f2d79d; font: 600 .78rem Georgia,serif; }
.normal-guide-title small { overflow: hidden; color: var(--muted); font-size: .5rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.normal-guide-tags, .normal-guide-pairs { display: flex; flex-wrap: wrap; gap: .2rem; }
.normal-guide-tags { margin-top: .32rem; }
.normal-guide-attach-label { display: block; margin: .38rem 0 .2rem; color: var(--muted); font-size: .5rem; }
.normal-guide-sigil-rule { color: var(--ink); font-size: .54rem; line-height: 1.25; }
.normal-guide-pair { display: inline-flex; align-items: center; gap: .12rem; padding: .12rem; border: 1px solid rgba(199,164,92,.22); border-radius: 6px; background: rgba(0,0,0,.13); }
.normal-guide-pair > b { color: var(--muted); font-size: .5rem; }
.normal-guide-card .card-tag { color: #231f18; font-size: .43rem; }
.normal-guide-any { padding: .24rem .4rem; color: #f2d79d; border: 1px solid rgba(199,164,92,.46); border-radius: 999px; background: rgba(199,164,92,.10); font-size: .56rem; font-weight: 750; }
.completed-set { display: grid; grid-template-columns: 24px auto minmax(0,1fr) auto; align-items: center; gap: .55rem; padding: .58rem; border: 1px solid rgba(105,158,125,.35); border-radius: 9px; background: rgba(73,116,91,.11); }
.completed-number { width: 23px; height: 23px; display: grid; place-items: center; color: #b8dcc5; background: rgba(94,144,113,.18); border-radius: 50%; font-size: .62rem; }
.guide-kamons { display: flex; gap: .16rem; }
.guide-kamon { width: 30px; height: 30px; object-fit: contain; padding: 1px; border: 1px solid rgba(199,164,92,.48); border-radius: 50%; background: var(--cream-card); }
.guide-kamon.fallback { display: grid; place-items: center; color: #54452e; font: .9rem Georgia,serif; }
.guide-kamon.wildcard { background: linear-gradient(145deg,#3c3933,#171816); border-color: rgba(226,190,103,.78); }
.completed-set strong { display: block; font-size: .68rem; }
.completed-set p { margin: .12rem 0; color: var(--muted); font-size: .58rem; }
.completed-set small { display: block; color: #c3b89f; font-size: .54rem; }
.sealed-mark { color: #b9dbc5; border: 1px solid rgba(105,158,125,.38); border-radius: 999px; padding: .12rem .35rem; font-size: .5rem; text-transform: uppercase; }
.guide-empty { min-height: 245px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.guide-empty span { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: .7rem; color: rgba(199,164,92,.55); border: 1px solid rgba(199,164,92,.25); border-radius: 50%; font: 1.8rem Georgia,serif; }
.guide-empty strong { color: var(--ink); font: 600 .9rem Georgia,serif; }
.guide-empty p { max-width: 320px; font-size: .67rem; line-height: 1.45; }
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .45rem; }
.stat-grid div { min-width: 0; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.stat-grid span { display: block; min-height: 1.7em; color: var(--muted); font-size: .57rem; letter-spacing: .05em; text-transform: uppercase; }
.stat-grid strong { display: block; margin-top: .12rem; color: #f2d79d; font: 600 1rem Georgia,serif; }
.guide-subtitle { margin: 1rem 0 .5rem; color: var(--gold); font: 600 .82rem Georgia,serif; }
.kpi-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; margin-bottom:.7rem; }
.kpi-toolbar button { padding:.38rem .58rem; color:#f2d79d; background:#171c18; border:1px solid rgba(199,164,92,.45); border-radius:7px; font-size:.62rem; }
.kpi-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.42rem; }
.kpi-card { min-width:0; padding:.58rem; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.025); }
.kpi-card span { display:block; color:var(--muted); font-size:.54rem; letter-spacing:.04em; text-transform:uppercase; }
.kpi-card strong { display:block; margin-top:.16rem; color:#f2d79d; font:600 .9rem Georgia,serif; overflow-wrap:anywhere; }
.kpi-milestones { margin:.55rem 0 .7rem; padding:.5rem .6rem; border:1px solid rgba(199,164,92,.42); border-radius:8px; background:rgba(199,164,92,.045); }
.kpi-milestones h3 { margin:0 0 .35rem; color:#f2d79d; font-size:.72rem; }
.diagnostic-milestones { margin:.55rem 0 .7rem; padding:.55rem .65rem; border:1px solid rgba(199,164,92,.42); border-radius:8px; background:rgba(199,164,92,.045); }
.diagnostic-milestones header { display:flex; justify-content:space-between; gap:.5rem; color:#f2d79d; font-size:.7rem; }
.diagnostic-milestones header span { color:var(--muted); font-size:.55rem; }
.diagnostic-milestone-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.35rem; margin-top:.45rem; }
.diagnostic-milestone-grid div { min-width:0; border-left:2px solid rgba(199,164,92,.55); padding:.28rem .38rem; }
.diagnostic-milestone-grid small,.diagnostic-milestone-grid b { display:block; overflow-wrap:anywhere; }
.diagnostic-milestone-grid small { color:var(--muted); font-size:.5rem; text-transform:uppercase; }
.diagnostic-milestone-grid b { color:var(--ink); font-size:.64rem; margin-top:.1rem; }
.diagnostic-milestones details { margin-top:.45rem; font-size:.58rem; color:var(--muted); }
.diagnostic-milestones pre { max-height:14rem; overflow:auto; white-space:pre-wrap; font:inherit; }
@media (max-width:760px) { .diagnostic-milestone-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.kpi-milestone-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.35rem; }
.kpi-milestone { min-width:0; padding:.32rem .4rem; border-left:2px solid rgba(199,164,92,.55); }
.kpi-milestone span { display:block; color:var(--muted); font-size:.5rem; text-transform:uppercase; letter-spacing:.035em; }
.kpi-milestone strong { display:block; margin-top:.1rem; color:var(--ink); font-size:.64rem; overflow-wrap:anywhere; }
.kpi-milestone-details { margin-top:.4rem; color:var(--muted); font-size:.58rem; }
.kpi-milestone-details pre { max-height:15rem; overflow:auto; margin:.35rem 0 0; white-space:pre-wrap; font:inherit; }
@media (max-width: 760px) { .kpi-milestone-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.kpi-modifiers { margin:.65rem 0; padding:.55rem .65rem; color:#d6cbb7; background:rgba(199,164,92,.055); border:1px solid rgba(199,164,92,.28); border-radius:8px; font-size:.62rem; line-height:1.4; }
.kpi-alerts { display:grid; gap:.42rem; }
.kpi-alert { display:grid; grid-template-columns:10px minmax(0,1fr); gap:.55rem; padding:.58rem; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.025); }
.kpi-alert::before { content:""; width:10px; height:10px; margin-top:.16rem; border-radius:50%; background:#77a88e; box-shadow:0 0 9px currentColor; }
.kpi-alert.yellow { border-color:rgba(226,182,108,.55); background:rgba(199,164,92,.07); }
.kpi-alert.yellow::before { background:#e2b66c; }
.kpi-alert.red { border-color:rgba(212,94,75,.62); background:rgba(130,38,31,.12); }
.kpi-alert.red::before { background:#ef7468; }
.kpi-alert strong { display:block; color:var(--ink); font-size:.68rem; }
.kpi-alert small { display:block; margin-top:.15rem; color:var(--muted); font-size:.59rem; line-height:1.35; }
.kpi-thresholds { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.38rem .65rem; padding:.6rem; border:1px solid var(--line); border-radius:8px; }
.kpi-thresholds label { display:grid; grid-template-columns:minmax(0,1fr) 68px; align-items:center; gap:.5rem; color:#d6cbb7; font-size:.59rem; }
.kpi-thresholds input { width:100%; box-sizing:border-box; padding:.3rem .38rem; color:var(--ink); background:#151713; border:1px solid rgba(199,164,92,.4); border-radius:6px; }
.kpi-note { margin:.6rem 0 0; color:var(--muted); font-size:.56rem; line-height:1.4; }
.state-meter { display: grid; grid-template-columns: repeat(4,1fr); gap: .35rem; }
.state-meter div { padding: .45rem; border-left: 3px solid #777; border-radius: 5px; background: rgba(255,255,255,.035); }
.state-meter .anch { border-color: var(--gold); } .state-meter .trip { border-color: var(--lacquer-hi); } .state-meter .seal { border-color: #77a88e; }
.state-meter span { display: block; color: var(--muted); font-size: .5rem; } .state-meter strong { font: 600 .88rem Georgia,serif; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: .58rem; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: .42rem .3rem; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.stats-table th:first-child { text-align: left; color: var(--ink); } .stats-table thead th { color: var(--muted); font-weight: 600; }
.quick-rule { padding: .75rem; border: 1px solid rgba(199,164,92,.25); border-radius: 9px; background: rgba(199,164,92,.06); }
.quick-rule strong, .help-callout strong { color: #f2d79d; font: 600 .8rem Georgia,serif; }
.quick-rule ol { margin: .55rem 0; padding-left: 1.25rem; color: #d2cabd; font-size: .68rem; line-height: 1.6; }
.quick-rule p, .help-callout p { margin: .35rem 0 0; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.legend-list { display: grid; gap: .38rem; }
.legend-list div { display: grid; grid-template-columns: 52px 1fr; gap: .6rem; padding: .48rem .55rem; border-left: 3px solid #777; background: rgba(255,255,255,.025); }
.legend-list .anch { border-color: var(--gold); } .legend-list .trip { border-color: var(--lacquer-hi); } .legend-list .seal { border-color: #77a88e; }
.legend-list b { font-size: .62rem; } .legend-list span { color: var(--muted); font-size: .64rem; line-height: 1.35; }
.help-callout { margin-top: .55rem; padding: .62rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.rules-panel { min-height: calc(100vh - 74px); padding: 1rem; border: 1px solid var(--line); border-radius: 0 12px 12px 12px; background: rgba(27,30,26,.96); box-shadow: var(--shadow); }
.rules-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.rules-head h2 { margin: .15rem 0 0; font: 600 1.35rem Georgia,serif; }
.rules-search { display: grid; gap: .22rem; color: var(--muted); font-size: .62rem; }
.rules-search input { width: min(360px,70vw); height: 34px; padding: 0 .7rem; color: var(--ink); background: #151713; border: 1px solid var(--line); border-radius: 7px; }
.rules-meta { margin: .6rem 0; color: var(--muted); font-size: .68rem; }
.rules-layout { display: grid; grid-template-columns: minmax(190px,250px) minmax(0,1fr); gap: 1.2rem; align-items: start; }
.rules-toc { position: sticky; top: 66px; max-height: calc(100vh - 100px); overflow: auto; display: grid; gap: .14rem; padding: .65rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); scrollbar-width: thin; }
.rules-toc a { padding: .27rem .38rem; color: var(--muted); border-left: 2px solid transparent; text-decoration: none; font-size: .66rem; line-height: 1.3; }
.rules-toc a:hover { color: var(--ink); border-left-color: var(--gold); background: rgba(199,164,92,.06); }
.rules-toc a.level-3 { padding-left: .85rem; font-size: .6rem; }
.rules-content { width: min(920px,100%); padding: .25rem .5rem 3rem; color: #ded6c8; font-size: .84rem; line-height: 1.62; }
.rules-content h1, .rules-content h2, .rules-content h3 { scroll-margin-top: 70px; color: var(--ink); font-family: Georgia,serif; line-height: 1.25; }
.rules-content h1 { margin: .3rem 0 1.1rem; font-size: 1.8rem; }
.rules-content h2 { margin: 1.7rem 0 .55rem; padding-bottom: .3rem; color: #efd394; border-bottom: 1px solid rgba(199,164,92,.3); font-size: 1.25rem; }
.rules-content h3 { margin: 1.15rem 0 .35rem; font-size: 1rem; }
.rules-content p, .rules-content ul, .rules-content ol { margin: .48rem 0; }
.rules-content code { padding: .08rem .28rem; color: #f0d59d; background: rgba(0,0,0,.25); border-radius: 4px; }
.rules-content blockquote { margin: .7rem 0; padding: .45rem .75rem; color: #d7cab2; border-left: 3px solid var(--gold); background: rgba(199,164,92,.06); }
.rules-content table { width: 100%; margin: .8rem 0; border-collapse: collapse; font-size: .74rem; }
.rules-content th, .rules-content td { padding: .45rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.rules-content th { color: #f0d59d; background: rgba(199,164,92,.08); }
.rules-content .rules-match { border-radius: 4px; background: rgba(194,72,56,.18); outline: 1px solid rgba(194,72,56,.42); }
#toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 50; max-width: 420px; padding: .8rem 1rem; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: white; background: #7b2925; box-shadow: var(--shadow); opacity:0; transform: translateY(150%); transition: transform .2s, opacity .2s; }
#toast.show { opacity:1; transform: translateY(0); }
#toast.toast-error { background: #7b2925; border-color: rgba(255,157,144,.44); }
#toast.toast-success { background: #285c3a; border-color: rgba(147,231,171,.5); }
#toast.toast-opponent { background: #805125; border-color: rgba(255,201,126,.5); }
#toast.toast-warning { background: #6a5520; border-color: rgba(255,220,124,.52); }
#toast.toast-info { background: #27516a; border-color: rgba(142,210,239,.5); }

@media (max-width: 1450px) {
  .topbar { flex-wrap: wrap; padding-block: .28rem; }
  .mode-tabs { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: thin; }
  .mode-tabs > * { flex-shrink: 0; }
  .topbar .status { margin-left: auto; }
}
@media (max-width: 1180px) {
  .table-wrap { padding: .38rem; }
  .banner-rail { position: static; width: auto; grid-auto-flow: column; grid-template-rows: auto 96px; justify-content: start; justify-items: center; overflow-x: auto; margin: .1rem .3rem .48rem; padding-bottom: .15rem; }
  .banner-rail-title { grid-row: 1; grid-column: 1 / -1; }
  .banner-sash { grid-row: 2; }
}
@media (max-width: 980px) {
  .game-table { grid-template: repeat(2,minmax(205px,auto)) / repeat(2,minmax(0,1fr)); column-gap: 3.5rem; min-height: auto; }
  .score-strip { grid-template-columns: repeat(3,1fr); }
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { min-height: 52px; } .status { display: none; }
  .control-panel { align-items: stretch; flex-direction: column; }
  .transport { margin: 0; }
  .score-strip { grid-template-columns: repeat(2,1fr); }
  .game-table { grid-template-columns: 1fr; padding-top: 5rem; }
  .center-turn { position: absolute; left: 50%; top: calc(50% - 43px); transform: translateX(-50%); padding: .13rem .22rem; color: #efdba9; background: #19231d; border: 1px solid var(--line); border-radius: 5px; white-space: nowrap; font-size: .55rem; font-weight: 700; pointer-events: none; }
.center-mark { top: .45rem; transform: translateX(-50%); }
  .player { grid-template-columns: 78px minmax(0,1.65fr) minmax(145px,.75fr); }
  .player-portrait { width: 70px; min-width: 70px; max-width: 70px; height: 70px; }
  .seat-north,.seat-west,.seat-east,.seat-south { grid-area: auto; }
  .card { width: 92px; min-height: 138px; }
  .lineup-picker { width: 100%; }
  .lineup-picker summary { width: 100%; }
  .lineup-grid { position: static; width: 100%; grid-template-columns: 1fr; margin-top: .45rem; }
  .compact-card { width: 64px; min-width: 64px; min-height: 94px; }
  .guide-toggle { padding: .38rem .45rem; }
  .locale-switcher span { display: none; }
  .rules-head { align-items: stretch; flex-direction: column; }
  .rules-search input { width: 100%; }
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { position: static; max-height: 190px; }
  .guide-toggle span { display: none; }
  .section-heading-tools { align-items: flex-end; flex-direction: column; gap: .3rem; }
  .attach-map-toggle { padding: .3rem .42rem; }
  .attach-drawer { width: 100vw; }
  .discard-drawer { width: 100vw; }
  .end-recap { width: calc(100vw - 14px); max-height: calc(100dvh - 12px); }
  .end-recap-outcome { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .end-recap-outcome span { text-align: left; }
  .end-recap-why { margin: .4rem 1rem; color: var(--ink); font-size: .72rem; line-height: 1.35; overflow-x: auto; }
.end-recap-why p { margin: .3rem 0; color: var(--gold); }
.end-recap-why table { width: 100%; border-collapse: collapse; font-size: .65rem; }
.end-recap-why th, .end-recap-why td { padding: .18rem .35rem; border-bottom: 1px solid var(--line); text-align: left; }
.end-recap-players { grid-template-columns: 1fr; }
  .end-recap-player { grid-template-columns: 58px minmax(0,1fr) auto; }
  .recap-portrait { width:54px; height:54px; min-height:54px; max-height:54px; }
  .end-recap footer { align-items: stretch; flex-direction: column; }
  .end-recap footer button { width: 100%; }
  .guide-tabs { grid-template-columns: repeat(2,1fr); }
  .normal-guide-list { grid-template-columns: 1fr; }
  .completed-set { grid-template-columns: 24px auto minmax(0,1fr); }
  .sealed-mark { display: none; }
}

.relative-score.near-win { color: #ffad5c; background: rgba(171, 69, 24, .20); border-color: rgba(255, 145, 67, .72); }
.dishonor-alert { color: #ff625f; font-weight: 850; text-shadow: 0 0 8px rgba(255, 70, 65, .22); }

.token-dialog { color: var(--ink); background: #20261f; border: 1px solid var(--gold); border-radius: 12px; width: min(560px, 90vw); max-height: 80vh; overflow-y: auto; padding: 1.2rem; }
.token-dialog::backdrop { background: #0009; }
.special-choice-dialog { padding: 0; overflow-x: hidden; }
.special-choice-head { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: .7rem; align-items: center; padding: .85rem 1.05rem .7rem; border-bottom: 1px solid rgba(199,164,92,.35); background: linear-gradient(110deg,rgba(122,43,37,.28),rgba(255,255,255,.025)); }
.special-choice-head > div { min-width: 0; }
.special-choice-head h2 { margin: .08rem 0 .12rem; color: var(--gold); font: 700 1.05rem Georgia,serif; }
.special-choice-head p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.special-choice-card { width: 50px; height: 50px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d2a45f; border-radius: 8px; background: #d9c39a; box-shadow: 0 3px 10px #0005; }
.special-choice-card img { width: 100%; height: 100%; object-fit: contain; }
.special-choice-glyph { color: #f0cd83; font-size: 1.8rem; }
.special-choice-dialog > :not(.special-choice-head) { margin-left: 1.2rem; margin-right: 1.2rem; }
.special-choice-dialog > fieldset { margin-top: .8rem; }
.token-dialog fieldset { border: 1px solid var(--line); margin: .7rem 0; }
.token-dialog label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .4rem 0; }
.token-dialog input { width: 4rem; }
.token-dialog input[type="radio"] { width: 1.2rem; height: 1.2rem; margin-right: .55rem; accent-color: var(--gold); flex: 0 0 auto; }
.token-dialog .token-target-choice { justify-content: flex-start; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.token-dialog .token-target-choice:hover { border-color: rgba(199,164,92,.65); background: rgba(199,164,92,.07); }
.token-dialog .token-target-choice.seal-ready { border-color: var(--gold); color: #f1d883; background: rgba(199,164,92,.14); }
.token-dialog button { margin-right: .6rem; }
.token-error { color: #ff998a; }

/* U008: keep discard preview and count contained in the central column */
.center-mark .discard-pile { position: absolute; left: 50%; top: calc(50% + 14px); width: 78px; height: 52px; transform: translateX(-50%); }
.center-mark .discard-badge { right: 7px; bottom: 2px; }
.center-mark .center-resources { top: calc(50% + 74px); }

/* U058: non-destructive hand selection, shared by both hand views and actions. */
.card[data-hand-index]::after { display: none; }
.card.selection-glow, .action-button.selection-glow {
  border-color: #76cbb5;
  box-shadow: 0 0 0 2px rgba(118,203,181,.7), 0 0 17px rgba(118,203,181,.4);
}
.card.selection-glow:hover, .card.selection-glow:focus-visible {
  box-shadow: 0 0 0 3px rgba(118,203,181,.8), 0 0 20px rgba(118,203,181,.45);
}
.card.selection-glow { border-color:#fff !important; box-shadow:0 0 0 2px #fff,0 0 15px #fff9 !important; }
.card.selection-glow:hover,.card.selection-glow:focus-visible { box-shadow:0 0 0 3px #fff,0 0 20px #fffd !important; }
.action-button.end-turn { background: #34312a; border-color: #938168; }
.action-button.end-turn:hover { background: #443c30; }
.action-reveal { border: 1px solid #76cbb5; background: #213d35; color: #d8f4e9; padding: .8rem; border-radius: .6rem; }
.actions-eyebrow { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.human-autoplay-toggle:not([hidden]) { display:inline-flex; align-items:center; gap:.25rem; color:var(--muted); font-size:var(--text-xs); white-space:nowrap; cursor:pointer; }
.human-autoplay-toggle input { margin:0; accent-color:#dfb969; }
.action-header-tools { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; flex-wrap: wrap; }
.phase-pause { min-height: 25px; height: 25px; padding: .18rem .5rem; color: #e8d29a; background: rgba(199,164,92,.08); border-color: rgba(199,164,92,.42); border-radius: 6px; font-size: var(--text-xs); line-height: 1; }
.phase-pause:hover { background: rgba(199,164,92,.16); }
.phase-resume {
  grid-column:1/-1; display:grid; place-items:center;
  min-height:clamp(140px,28dvh,320px); padding:16px;
}
.phase-resume button {
  display:flex; align-items:center; justify-content:center; gap:.75rem;
  width:min(100%,320px); min-height:78px; padding:.7rem 1rem;
  color:#fff1d0; background:linear-gradient(155deg,#9b2e31,#551e23);
  border:1px solid #dfb969; border-radius:8px;
  box-shadow:inset 0 0 0 4px #612227,inset 0 0 0 5px #dfb96970,0 5px 16px #0006;
  font-size:1.3rem; font-weight:700;
}
.phase-resume button:hover:not(:disabled) { background:linear-gradient(155deg,#b13839,#702429); }
.phase-resume button:focus-visible { outline:2px solid #fff1d0; outline-offset:4px; }
.phase-resume img { flex:none; object-fit:contain; }
.selection-highlight-toggle { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .72rem; color: #a7d9c9; cursor: pointer; }
.selection-highlight-toggle input { width: auto; margin: 0; accent-color: #76cbb5; }
.compact-actions-toggle { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-size: .72rem; color: #dfca91; cursor: pointer; }
.compact-actions-toggle input { width: auto; margin: 0; accent-color: #d8b45d; }
.action-elapsed { padding: .14rem .34rem; color: #d8f4e9; background: rgba(118,203,181,.1); border: 1px solid rgba(118,203,181,.35); border-radius: 999px; font: 700 .58rem/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.action-token-preview { color: #cde7af; font-weight: 700; }
.action-group-hint { color: #e4c875 !important; font-weight: 700; }

/* U102: compact legal-action density. Keep title, target/detail and token
   preview visible while fitting one additional column at desktop widths. */
.compact-actions .action-list { grid-template-columns: repeat(auto-fill, minmax(165px, 300px)); justify-content: start; gap: .28rem; width: min(100%, 1480px); }
.compact-actions .action-button { min-width: 0; padding: .24rem .32rem; border-radius: 7px; }
.compact-actions .action-button-head { gap: .28rem; }
.compact-actions .action-title { gap: .2rem; }
.compact-actions .action-icon { width: 22px; height: 22px; margin: -.04rem 0 0 -.05rem; border-radius: 5px; }
.compact-actions .action-icon svg { width: 15px; height: 15px; }
.compact-actions .action-button strong { font-size: .61rem; line-height: 1.03; }
.compact-actions .action-button small { margin-top: .06rem; font-size: .52rem; line-height: 1.03; }
.compact-actions .action-button .action-score { padding: .1rem .22rem; font-size: .46rem; }
.compact-actions .action-button .action-reason { display: none; }
.compact-actions .action-token-preview, .compact-actions .action-group-hint { font-size: .48rem; line-height: 1.02; }

/* U090: shared table typography and geometry. Card tags, mon glyphs and
   diagnostic monospace text retain their specialised sizes/fonts. */
.banner-sash { zoom: .9; grid-template-rows: 24px 70px; }
.banner-sash::before, .banner-sash::after { top: 28px; }
.banner-sash::before { height: 70px; }
.banner-sash .banner-sash-owner { color: var(--player-color, var(--muted)); white-space: normal; line-height: 1.1; align-self: center; font-weight: 700; }
.set { position: relative; padding-left: 1.1rem; }
.set-number { position: absolute; left: .18rem; top: .45rem; max-width: .85rem; overflow-wrap: anywhere; color: var(--muted); font: 700 var(--text-xs)/1.1 var(--font-ui); }
.set-prestige { display: block; color: #e3c879; font-size: .48rem; line-height: 1; letter-spacing: -.02em; }
.end-recap-score .recap-indicative { display: block; margin-top: .3rem; color: var(--muted); font: normal var(--text-xs)/1.3 var(--font-ui); }
.topbar { min-height: 46px; }
.brand h1 { font-family: var(--font-title); font-size: var(--text-title); }
.brand p, .status, .mode-tabs > button, .guide-toggle span,
.locale-switcher, .locale-switcher select, .control-panel label,
.hint, .score-strip span { font-size: var(--text-xs); }
.control-panel { min-height: 36px; padding-block: .12rem; }
.control-panel select, .control-panel input[type="number"],
.control-panel > button, .lineup-picker summary { height: 27px; font-size: var(--text-sm); }
.lineup-picker summary span { font-size: var(--text-sm); }
.score-strip div { padding-block: .16rem; gap: 0; }
.score-strip strong { font: 600 var(--text-sm)/1.2 var(--font-ui); }
.player-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: center; }
.player-identity { grid-column: 1; grid-row: 1; }
.player-head > .turn-status { grid-column: 2; grid-row: 1; width: 100%; }
.player-head-actions { grid-column: 3; grid-row: 1; }
.player-head h3 { font-family: var(--font-title); font-size: var(--text-md); line-height: 1.15; }
.player-head p, .player-stats, .player-zone-title, .banner,
.player-head > .turn-status strong, .player-head > .turn-status small,
.set small, .set-tags, .banner-rail-title, .banner-sash-owner,
.center-turn, .center-resources > span { font-size: var(--text-xs); }
.player-stats { align-content: center; gap: .15rem .5rem; margin: 0; }
.house-badge { display:inline-block; margin-left:.35rem; padding:.08rem .3rem; border:1px solid #caa95a88; border-radius:999px; color:#f0d27d; font-size:.68em; font-weight:600; vertical-align:middle; white-space:nowrap; }
.xp-board-row b > .xp-house-badge { display:inline-block; margin:0 0 0 5px; padding:1px 3px!important; font-size:9px; font-weight:500; line-height:1.15; vertical-align:middle; width:auto; }
.house-ranking td:last-child { max-width:26rem; }
.end-recap-houses { margin-top:1rem; padding: .75rem 1rem; border:1px solid #caa95a55; border-radius:10px; background:#121a16aa; }
.end-recap-houses h3 { margin:.1rem 0 .5rem; }
.guild-progress-note { margin:-.18rem 0 .5rem; color:#b9ad92; font-size:.62rem; }
.end-recap-houses li strong { display:inline-flex; align-items:center; gap:.32rem; }
.end-recap-houses li span { display:flex; flex-direction:column; align-items:flex-end; gap:.08rem; }
.end-recap-houses li span small { color:#b9ad92; font-size:.58rem; }
.guild-trend { display:inline-grid; place-items:center; width:1rem; height:1rem; font-size:.72rem; }
.guild-trend-up { color:#8fd49a; }
.end-recap-players > .recap-guild-progress li { grid-template-columns:1fr!important; align-content:start; border-bottom:1px solid #caa95a33; padding:6px 0; gap:6px; }
.end-recap-players > .recap-guild-progress li > span { align-items:flex-start; text-align:left; }
.end-recap-players > .recap-guild-progress li small { font-size:12px; line-height:1.4; }
.end-recap-houses .guild-identity { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.guild-gain { color:#70ff8b; font-size:12px; font-style:normal; white-space:nowrap; }
#xpBoard .end-recap-houses li small, .landing-board .end-recap-houses li small { white-space:nowrap!important; font-size:11px!important; }
#xpBoard .end-recap-houses ol, .landing-board .end-recap-houses ol { display:grid; grid-template-columns:1fr; gap:12px; padding:0; list-style:none; }
#xpBoard .end-recap-houses li, .landing-board .end-recap-houses li { display:grid; grid-template-columns:auto 1fr; align-items:start; gap:10px; }
#xpBoard .end-recap-houses li > span, .landing-board .end-recap-houses li > span { white-space:normal; min-width:0; }
#xpBoard .end-recap-houses li small, .landing-board .end-recap-houses li small { white-space:normal; font-size:12px; line-height:1.4; }
.end-recap-houses strong .guild-trend { display:inline-block; flex:none; width:auto; color:#aaa18e; }
.end-recap-houses strong .guild-trend-up { color:#8fd49a; }
.landing-board .end-recap-houses { margin:0; padding:0; border:0; background:none; }
.guild-trend-down { color:#e99b91; }
.guild-trend-steady { color:#aaa18e; }
.end-recap-houses ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.35rem 1rem; margin:0; padding-left:1.4rem; }
.end-recap-houses li { display:flex; justify-content:space-between; gap:.75rem; }
.end-recap-houses li span { color:#d8d0bb; text-align:right; }
.end-recap-players > .end-recap-houses { grid-column:1 / -1; width:100%; margin-top:.25rem; }
.end-recap-players > .end-recap-houses ol { grid-template-columns:repeat(3,minmax(0,1fr)); padding-left:0; list-style:none; gap:.45rem 1.35rem; }
.end-recap-players > .end-recap-houses li { min-width:0; display:grid; grid-template-columns:max-content minmax(0,1fr); align-items:center; }
.end-recap-players > .end-recap-houses li strong { white-space:nowrap; line-height:1.2; }
.end-recap-players > .end-recap-houses li span { min-width:0; line-height:1.25; overflow-wrap:anywhere; }
@media (max-width:900px) {
  .end-recap-players > .end-recap-houses ol { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:560px) {
  .end-recap-players > .end-recap-houses ol { grid-template-columns:1fr; }
}
#xpBoard .end-recap-houses ol { padding-left:0; gap:6px 12px; list-style:none; }
#xpBoard .end-recap-houses li { align-items:center; gap:6px; font-size:12px; }
#xpBoard .end-recap-houses li strong { flex-shrink:0; font-size:11px; line-height:1.2; white-space:nowrap; }
#xpBoard .end-recap-houses li span { white-space:nowrap; }
.player-zone-title { letter-spacing: .035em; }
.set-zone { align-self: stretch; min-height: 0; }
.set-zone .sets { flex: 1; min-height: 0; max-height: none; }
.no-sets { font-size: var(--text-sm); }
.action-context, .action-button small, .selection-highlight-toggle,
.action-button .action-reason { font-size: var(--text-sm); }
.action-button strong { font-family: var(--font-ui); font-size: var(--text-sm); }
.action-tier, .action-button .action-score { font-size: var(--text-xs); }
.hand-panel h2, .action-panel h2, .event-panel h2, .inspector h2 {
  font-family: var(--font-title); font-size: var(--text-md);
}
@media (min-width: 981px) {
  .game-table { grid-template-rows: repeat(2,238px); }
  .player { min-height: 238px; grid-template-rows: 56px 50px 16px minmax(104px,1fr); }
  .missing-player { height: 238px; }
}

.sigil-highlights { display:flex; align-items:center; gap:1px; }
.sigil-highlights[hidden] { display:none; }
.sigil-highlight-toggle { display:grid; place-items:center; width:20px; height:20px; min-width:20px; padding:0; border-radius:4px; }
.sigil-highlight-toggle[aria-pressed="true"] { border-color:#f0d27d; background:#806c32; box-shadow:0 0 0 2px #f0d27d66,0 0 12px #f0d27d66; }
.sigil-highlight-toggle { position:relative; isolation:isolate; box-sizing:border-box; overflow:hidden; flex:0 0 28px; width:28px; height:24px; min-width:28px; }
.sigil-highlight-toggle .sigil-filter-art { display:flex; align-items:center; justify-content:center; position:relative; width:24px; height:18px; min-width:0; margin:0; padding:0; }
.sigil-highlight-toggle .sigil-filter-art .sigil-art { display:block; position:static; width:100%; height:100%; object-fit:contain; margin:0; padding:0; }
[data-sigils] { transition:opacity .16s ease,filter .16s ease,outline-color .16s ease,box-shadow .16s ease; }
[data-sigils].sigil-highlight-match { outline:2px solid #f4d77b; outline-offset:1px; filter:brightness(1.22) saturate(1.32) drop-shadow(0 0 5px #f4d77b99); }
[data-sigils].sigil-highlight-dim { opacity:.28; filter:grayscale(.45); }
@media(prefers-reduced-motion:reduce) { [data-sigils] { transition:none; } }
/* Release is selected by the server before first paint, not by localStorage. */
.release-profile :is(#quickVariants,#variantsToggle,#metricsToggle,#diagnosticsToggle,#diagnosticLights,#diagnosticsDrawer,#diagnosticsBackdrop,#assistToggle,#serverStatus,.action-score,.decision-score,.build-info,[data-guide-tab="kpi"],[data-guide-tab="variants"],[data-guide-tab="debug"],[data-guide-panel="kpi"],[data-guide-panel="debug"],[data-mode="replay"]) { display:none!important; }
.release-profile #stateDetails>div:has(:is(#buildNameDetail,#presetCodeDetail,#seedDetail,#rulesetDetail)) { display:none!important; }
.release-profile label:has(#liveSeed) { display:none!important; }
.release-profile :is(.end-recap-formula,.recap-indicative,[data-i18n="recap.official_note"]) { display:none!important; }
@media(max-width:760px) {
  .end-recap-footer-actions { align-items:stretch; flex-flow:column-reverse nowrap; }
  .end-recap-rematch-options { display:grid; grid-template-columns:1fr; }
  .human-progress-card>div { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Shared visual choices for Token movements. */
.special-choice-head:has(.choice-actor) {
  grid-template-columns: 54px minmax(0,1fr) minmax(52px,auto);
}
.choice-actor { display:grid; justify-items:center; gap:3px; align-self:start; max-width:85px; text-align:center; }
.choice-actor .landing-portrait { position:relative!important; grid-area:auto!important; width:54px!important; height:54px!important; }
.choice-actor small { font-size:.62rem; line-height:1.15; overflow-wrap:anywhere; }
.token-dialog.special-choice-dialog { width:min(680px,calc(100vw - 28px)); padding-bottom:.85rem; }
.choice-route { position:relative; display:grid; grid-template-columns:minmax(114px,1fr) minmax(0,1.8fr); gap:24px; margin-block:.75rem; align-items:start; }
.choice-route-source,.choice-target,.choice-quantity { position:relative; z-index:1; }
.choice-route-source { padding:.55rem; border:1px solid var(--line); border-radius:8px; background:#262b23; }
.choice-source-label { display:block; color:var(--gold); font-size:.7rem; margin-bottom:.4rem; }
.choice-route-targets { display:grid; gap:.4rem; min-width:0; }
.token-dialog .choice-target { display:flex; align-items:center; gap:.45rem; margin:0; min-width:0; }
.choice-reserve { padding:.4rem .6rem; border:1px solid var(--line); border-radius:8px; }
.choice-target-visual { display:block; min-width:0; }
.choice-target-visual > small { display:block; color:var(--muted); font-size:.68rem; }
.token-dialog .choice-target input[type="checkbox"] { inline-size:1.1rem; block-size:1.1rem; flex:none; accent-color:var(--gold); }
.choice-target[data-route-selected=true],.choice-quantity[data-route-selected=true] .choice-target { border-color:var(--gold); background:#3c3725; }
.choice-target:has(input:disabled) { opacity:.55; cursor:default; }
.choice-set,.choice-resource { display:flex; align-items:center; gap:.45rem; min-width:0; }
.choice-set-cards { display:flex; flex:none; gap:2px; }
.choice-mini-card { display:grid; place-items:center; width:23px; height:31px; overflow:hidden; border:1px solid #a99362; border-radius:3px; background:#322d23; font-size:.65rem; }
.choice-mini-card img { display:block; width:100%; height:100%; object-fit:contain; }
.choice-set-info { min-width:0; overflow-wrap:anywhere; }
.choice-set strong,.choice-resource strong { display:block; font-size:.78rem; }
.choice-set small,.choice-resource small { display:block; font-size:.66rem; color:var(--muted); }
.choice-set .choice-token-count { color:var(--gold); }
.choice-route-source .choice-set { flex-wrap:wrap; }
.choice-quantity { display:flex; align-items:center; gap:.35rem; }
.choice-quantity > label { flex:1; }
.choice-stepper { display:flex; align-items:center; gap:2px; flex:none; }
.token-dialog .choice-stepper input { width:2ch; padding:0; text-align:center; appearance:textfield; }
.choice-stepper input::-webkit-inner-spin-button { appearance:none; }
.choice-stepper button { min-width:2rem; min-height:2rem; padding:.15rem; }
@media (pointer:coarse) {
  .choice-stepper button { min-width:44px; min-height:44px; }
}
.choice-route-lines { position:absolute; inset:0; width:100%; height:100%; z-index:2; overflow:visible; pointer-events:none; }
.choice-route-endpoint { outline:2px dashed #f1ce76; outline-offset:2px; border-radius:6px; }
.choice-route-line { stroke:#f1ce76; stroke-width:2; fill:none; }
.choice-route-lines marker path { fill:#f1ce76; }
.choice-summary { color:var(--gold); font-size:.82rem; }
@media(max-width:520px){
  .choice-route { grid-template-columns:minmax(0,1fr); gap:14px; }
  .choice-route-targets { margin-left:14px; }
  .choice-route-source { justify-self:start; }
  .special-choice-head:has(.choice-actor) { grid-template-columns:38px minmax(0,1fr) 54px; gap:.45rem; }
  .special-choice-head:has(.choice-actor) .special-choice-card { width:36px; height:40px; }
}

#legalActions > :is(.special-response,.pending-response-heading,.action-info-strip) { grid-column:1/-1; min-width:0; }
.special-response { border:1px solid var(--line); border-radius:10px; background:#262b23; padding:.7rem; }
.response-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:.65rem; color:var(--gold); }
.response-heading > div { min-width:0; }
.response-title { display:inline-flex; align-items:center; gap:.35rem; }
.response-title-icon { display:block; flex:none; width:24px; height:24px; object-fit:contain; border-radius:4px; }
#legalActions > .gunsen-group { grid-column:1/-1; min-width:0; }
.gunsen-panel p { margin:0 0 .5rem; color:var(--gold); }
.gunsen-sets { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:.4rem; }
.dishonor-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr)); gap:.4rem; }
.dishonor-card { display:grid; align-content:start; gap:.3rem; min-width:0; padding:.3rem; border:1px solid var(--line); border-radius:7px; }
.dishonor-card .gunsen-sets { grid-template-columns:minmax(0,1fr); }
.action-info-strip {
  margin:0;
  padding:.35rem .55rem;
  border:0;
  border-inline-start:3px solid var(--gold);
  border-radius:0;
  background:#262b23;
  color:var(--ink);
  font-size:.8em;
  line-height:1.35;
}
[data-dishonor-panel] > summary { cursor:pointer; overflow-wrap:anywhere; }
[data-dishonor-panel] > summary::marker { color:var(--gold); }
[data-dishonor-panel] > summary .response-title-icon { display:inline-block; vertical-align:middle; margin-inline-end:.3rem; }
[data-dishonor-panel] > summary > span { margin-inline-start:.4rem; }
.pending-response-copy { flex:1; }
.pending-response-copy > .action-info-strip { margin-top:.25rem; }
[data-dishonor-panel] > p { margin:.18rem 0 .3rem; }
[data-dishonor-panel] .dishonor-card { padding:0; border:0; }
[data-dishonor-panel] .response-title-icon { width:18px; height:18px; }
.gunsen-set { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.4rem; min-width:0; padding:.4rem; background:var(--panel-2); border:1px solid var(--line); border-radius:7px; }
.gunsen-counter,.gunsen-panel footer { display:flex; align-items:center; gap:.4rem; }
.gunsen-counter button { min-width:32px; min-height:32px; padding:.2rem; }
.gunsen-counter output { min-width:1.3em; text-align:center; }
.gunsen-panel footer { justify-content:flex-end; flex-wrap:wrap; margin-top:.55rem; }
.kimono-source { display:flex; align-items:center; flex-wrap:wrap; gap:.65rem; padding-bottom:.5rem; margin-bottom:.5rem; border-bottom:1px solid var(--line); color:var(--gold); }
.kimono-panel button.gunsen-set,.special-set-target { text-align:left; }
.special-set-target:hover,.special-set-target:focus-visible { border-color:var(--gold); background:#3c3725; }
.sashimono-bounty { color:var(--gold); }
.loyalty-choice { justify-content:flex-start; }
.loyalty-choice .choice-resource svg { display:block; width:24px; height:24px; }
.loyalty-choice > small { color:var(--gold); }
.kushi-opponents { display:flex; flex-wrap:wrap; gap:.4rem; }
.kushi-opponent { justify-content:center; min-width:95px; padding:.45rem; }
.kimono-panel button[aria-pressed="true"] { border-color:var(--gold); background:#3c3725; }
.kimono-quantity { display:flex; align-items:center; gap:.5rem; margin-top:.5rem; }
.response-heading p { margin:.28rem 0 .5rem; color:var(--ink); font-size:.8rem; line-height:1.4; }
.response-heading .choice-actor { flex:none; }
.response-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; }
.response-choice-button { display:grid; justify-items:center; align-content:center; gap:.4rem; min-width:0; min-height:44px; padding:.5rem; white-space:normal; text-align:center; }
.response-card-art { display:block; width:min(72px,100%); height:80px; object-fit:contain; border:1px solid var(--line); border-radius:6px; }
.response-choice-button:hover,.response-choice-button:focus-visible { border-color:var(--gold); background:#3c3725; }
.response-choice-button[aria-pressed="true"] { border-color:var(--gold); background:#3c3725; }
.response-choice-button strong,.response-choice-button small { max-width:100%; overflow-wrap:anywhere; }
.response-card-tags { display:flex; flex-wrap:wrap; justify-content:center; gap:.25rem; min-width:0; }
.response-card-tags .card-label-sigil { width:auto; max-width:100%; height:auto; min-height:1.4rem; grid-template-columns:1.4rem minmax(0,1fr); padding:.15rem .3rem; border-radius:4px; background:#35372e; color:#f8e8c2; }
.response-card-tags .card-label-sigil small { color:inherit; font:600 .72rem/1.2 system-ui,sans-serif; }
.response-card-tags .card-tag { color:#201c15; font-size:.72rem; background:#d9c8a5; }
.response-card-tags .tag-label-long { display:inline; }
.response-card-tags .tag-label-short { display:none; }
.response-return:not([hidden]) { display:grid; gap:.45rem; padding-top:.65rem; border-top:1px solid var(--line); }
.response-return p { margin:0; }
.response-sakura-cards { grid-template-columns:repeat(auto-fit,minmax(min(82px,100%),1fr)); }
.sakura-return-controls { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; }
.sakura-return-controls button[aria-pressed="true"] { border-color:var(--gold); background:#3c3725; }
[data-sakura-confirm] { justify-self:end; }
.response-choice-button[data-response-pass] { grid-column:1/-1; }

.noren-offer-targets { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(76px,100%),1fr)); gap:.4rem; padding:.65rem 0; }
.noren-offer-targets button { margin:0; }
.noren-offer-cards { grid-template-columns:repeat(auto-fit,minmax(min(102px,100%),1fr)); }
.noren-offer-cards button { margin:0; }
.noren-received-cards { display:flex; flex-wrap:wrap; align-items:flex-start; gap:.45rem; margin:.25rem 0 .55rem; }
.noren-received-cards > .card { flex:none; }
.noren-offer-dialog footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
.noren-offer-dialog footer button { margin:0; }

.token-dialog.noren-offer-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; padding-bottom:0; overflow:hidden; max-height:calc(100dvh - 1.5rem); }
.noren-offer-dialog > .noren-offer-body { margin:0; padding:0 1.2rem; overflow-y:auto; overscroll-behavior:contain; }
.noren-offer-dialog > footer { margin:0; padding:.55rem 1.2rem max(.55rem,env(safe-area-inset-bottom)); border-top:1px solid var(--line); }

body:not(.expanded-actions) #actionPanel.action-choice-open { position:relative; }
#actionPanel.action-choice-open > .action-choice-panel {
  position:absolute; inset:0; z-index:6; width:auto; max-height:none; margin:0;
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; padding:0; overflow:hidden;
}
.action-choice-panel > .noren-offer-body { margin:0; padding:0 1rem; overflow:auto; overscroll-behavior:contain; }
.action-choice-panel > footer {
  display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem;
  margin:0; padding:.55rem 1rem; border-top:1px solid var(--line);
}
.action-choice-panel > footer button { margin:0; }

@media (max-width:900px) {
  #actionPanel.action-choice-open { height:min(30rem,calc(100dvh - 8rem)); min-height:0; overflow:hidden; }
}

.redemption-option { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:stretch; gap:.3rem; }
.redemption-preview-button { min-inline-size:44px; min-block-size:44px; padding:.25rem; display:grid; place-items:center; }
.redemption-preview-button[hidden] { display:none; }
.redemption-preview-button .action-icon { pointer-events:none; }
.dishonor-card .response-title .negative-status-symbol { font-size:1.08em; }
[data-tournament-cup="dockside-cup"] {
  --tournament-base: #11272b;
  --tournament-thread: #234049;
  --tournament-pattern: repeating-linear-gradient(118deg,
    transparent 0 10px, var(--tournament-thread) 10px 12px,
    transparent 12px 15px, var(--tournament-thread) 15px 16px,
    transparent 16px 26px);
}
[data-tournament-cup="veil-cup"] {
  --tournament-base: #211a2d;
  --tournament-thread: #392940;
  --tournament-pattern:
    repeating-linear-gradient(45deg, transparent 0 18px, var(--tournament-thread) 18px 19px),
    repeating-linear-gradient(135deg, transparent 0 18px, var(--tournament-thread) 18px 19px);
}
[data-tournament-cup="last-move-cup"] {
  --tournament-base: #282116;
  --tournament-thread: #453722;
  --tournament-pattern:
    repeating-linear-gradient(0deg, transparent 0 9px, var(--tournament-thread) 9px 10px),
    repeating-linear-gradient(90deg, transparent 0 9px, var(--tournament-thread) 9px 10px);
}

[data-tournament-cup="tobei-school"] {
  --tournament-base: #243027;
  --tournament-thread: #48614b;
  --tournament-pattern: repeating-linear-gradient(90deg, transparent 0 8px, var(--tournament-thread) 8px 10px);
}
[data-tournament-cup="mirror-cup"] {
  --tournament-base: #1b2935;
  --tournament-thread: #775740;
  --tournament-pattern: repeating-linear-gradient(135deg, transparent 0 10px, var(--tournament-thread) 10px 12px);
}
[data-tournament-cup="tight-circle"] {
  --tournament-base: #362724;
  --tournament-thread: #665045;
  --tournament-pattern: repeating-linear-gradient(45deg, transparent 0 8px, var(--tournament-thread) 8px 10px);
}
[data-tournament-cup="two-guilds"] {
  --tournament-base: #233634;
  --tournament-thread: #42665c;
}
[data-tournament-cup="four-guilds"] {
  --tournament-base: #35303c;
  --tournament-thread: #63516c;
}
[data-tournament-cup="four-banners"] {
  --tournament-base: #321c25;
  --tournament-thread: #52313d;
  --tournament-pattern: repeating-linear-gradient(90deg,
    transparent 0 6px, var(--tournament-thread) 6px 8px, transparent 8px 15px);
}
[data-tournament-cup="cypress-cup"] {
  --tournament-base: #193025;
  --tournament-thread: #2c4637;
  --tournament-pattern: repeating-linear-gradient(8deg,
    transparent 0 8px, var(--tournament-thread) 8px 9px, transparent 9px 16px);
}
[data-tournament-cup="arun-challenge"] {
  --tournament-base: #34231e;
  --tournament-thread: #614032;
  --tournament-pattern: repeating-linear-gradient(45deg,
    transparent 0 9px, var(--tournament-thread) 9px 10px, transparent 10px 19px);
}
[data-tournament-cup="three-currents-cup"] {
  --tournament-base: #18283f;
  --tournament-thread: #58728f;
  --tournament-pattern:
    repeating-radial-gradient(ellipse at 14% 125%, transparent 0 12px, #4987a550 13px 14px, transparent 15px 24px),
    repeating-radial-gradient(ellipse at 50% 140%, transparent 0 20px, #6f6fae55 21px 22px, transparent 23px 33px),
    repeating-radial-gradient(ellipse at 86% 125%, transparent 0 12px, #5f999450 13px 14px, transparent 15px 24px);
}
[data-tournament-cup="five-lanterns-cup"] {
  --tournament-base: #322327;
  --tournament-thread: #765348;
  --tournament-pattern: radial-gradient(ellipse at 50% 85%, #a65d392b, transparent 65%),
    repeating-linear-gradient(90deg, transparent 0 22px, #9b68472e 22px 23px);
}
[data-tournament-cup="ascent-cup"] {
  --tournament-base: #301d27;
  --tournament-thread: #6f4558;
  --tournament-pattern: repeating-linear-gradient(0deg,
    transparent 0 8px, var(--tournament-thread) 8px 9px, transparent 9px 15px);
}
[data-tournament-cup="wisdom-league"] {
  --tournament-base: #2d2a19;
  --tournament-thread: #6e633b;
  --tournament-pattern: repeating-linear-gradient(105deg,
    transparent 0 13px, var(--tournament-thread) 13px 14px, transparent 14px 20px);
}
[data-tournament-cup="amara-santos"] {
  --tournament-base: #123c32;
  --tournament-thread: #c5a34d;
  --tournament-pattern: linear-gradient(112deg, #123c32 15%, #205842 45%, #1c395b 78%);
}
[data-tournament-standings] ul, .tournament-recap-result section ul, #tableTournamentPanels ul { list-style: none; padding: 0; }
[data-tournament-standings] li, .tournament-recap-result section li, #tableTournamentPanels li { display: flex; justify-content: space-between; gap: 8px; }
.tournament-guild-row {
  margin-block: 5px;
  padding: 6px 10px;
  border-inline-start: 4px solid var(--tournament-guild-color, currentColor);
  border-radius: 5px;
  background: color-mix(in srgb, var(--tournament-guild-color, transparent) 23%, #1b211d);
}
.tournament-guild-row small { display: block; margin-block-start: 2px; }

.table-center-strip[data-tournament-cup],
#tournamentTableTitle[data-tournament-cup],
.landing-cup[data-tournament-cup],
#tournamentBoard[data-tournament-cup] .tournament-title-row {
  background-color: var(--tournament-base);
  background-image: var(--tournament-pattern);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--tournament-thread);
}

#endRecap[data-tournament-cup] > .end-recap-head {
  background: var(--tournament-pattern) var(--tournament-base);
  border-bottom-color: var(--tournament-thread);
}

#tournamentTableTitle,
#tournamentAnnouncement {
  color: #e2c984;
}

#tournamentTableTitle:not([hidden]) {
  display: block;
  flex: 0 1 auto;
  min-inline-size: 0;
  max-inline-size: min(34vw, 26rem);
  margin-inline-start: auto;
  padding: 5px 12px;
  font: 700 clamp(16px, 1.2vw, 23px)/1.15 var(--font-title);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.tournament-participants { color: #bee0cf; font-weight: 700; }

#landingCups:not([hidden]), .landing-cup-overflow-grid {
  display: grid;
  --cup-row-height: 5.75rem;
  --cup-grid-gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  grid-auto-rows: var(--cup-row-height);
  inline-size: min(100%, 42rem);
  max-block-size: calc(3 * var(--cup-row-height) + 2 * var(--cup-grid-gap));
  gap: var(--cup-grid-gap);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.landing-cup {
  position: relative;
  display: grid;
  align-content: center;
  min-inline-size: 0;
  max-inline-size: 100%;
  gap: 3px;
  padding: 5px 7px;
  font-size: .9em;
  line-height: 1.15;
}

.landing-cup-overflow { inline-size: min(100%, 42rem); }
.landing-cup-overflow-grid { margin-block-start: 6px; }
.landing-cup-placeholder {
  border: 1px dashed #52574b;
  border-radius: 5px;
  background: #1a1d18;
  text-align: center;
}

.landing-cup small { color: var(--muted); overflow-wrap: anywhere; }
.landing-cup[data-cup-state="active"] { border-color: #ad9156; }
.landing-cup[data-cup-state="blocked"] {
  color: #a9ada6;
  background-color: color-mix(in srgb, var(--tournament-base, #20251e) 20%, transparent);
  background-image: linear-gradient(#20231fde, #20231fde), var(--tournament-pattern, none);
  border-color: #50554e;
  box-shadow: none;
}
.landing-cup[data-cup-state="blocked"] .tournament-tier {
  color: #b7bcb4;
  background: #333830;
}
.landing-cup[data-cup-state="blocked"] small { color: #aeb3a9; }
.landing-cup[data-cup-state="blocked"] .tournament-token-coin { filter: grayscale(75%); opacity: .72; }
.landing-cup-detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.landing-cup:has(.landing-cup-win) > strong { padding-inline-end: 13px; }
.landing-cup-win {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  color: #f4ca73;
  font-size: 18px;
}
.landing-cup-win img { inline-size: 22px; block-size: 22px; object-fit: contain; }
.landing-cup[data-cup-state="active"] small { color: #f5d991; font-weight: 700; }
.landing-tournament-wallet {
  padding: 6px 10px;
  border: 1px solid #ad9156;
  border-radius: 8px;
  color: #fff1c9;
  background: #1b251e;
  box-shadow: 0 3px 9px #0009;
  font-size: .9em;
  text-shadow: 0 1px 2px #000;
}
.landing-tournament-wallet b { color: #ffe198; font-size: 1.16em; }
.landing-play-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem .75rem;
}
.landing-season-xp { color: #e4ca92; font-size: .875em; }
.landing-cup-fee {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3em;
}
.landing-cup-fee b { font-variant-numeric: tabular-nums; }
.landing-cup-fee .tournament-token-coin { inline-size: 1.15em; block-size: 1.15em; }
.landing-cup[data-cup-state="active"] .landing-cup-fee {
  color: var(--ink);
  font-weight: 400;
}

.tournament-wallet {
  display: inline-flex;
  align-items: center;
  gap: .5em;
}

.tournament-token-coin {
  position: relative;
  flex: 0 0 auto;
  inline-size: 1.6em;
  block-size: 1.6em;
  border: 1px solid #ffe194;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 54%, #845514 56% 61%, #e8b54c 63%),
    linear-gradient(145deg, #fff1ad, #e7ae3c 60%, #af6d18);
  box-shadow: 0 2px 3px #0008;
}

.tournament-token-coin::after {
  content: "";
  position: absolute;
  inset: 33%;
  background: #22302c;
  border: 1px solid #845514;
  box-shadow: 0 0 0 1px #ffde81;
}

.tournament-token-count {
  color: #ffe18b;
  font-size: 1.15em;
  font-variant-numeric: tabular-nums;
}

#tournamentBoard {
  -webkit-user-select: none;
  user-select: none;
  --tournament-portrait-size: 76px;
  box-sizing: border-box;
  width: min(920px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: clamp(12px, 2vw, 20px);
  overflow: hidden;
}
#tournamentBoard[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "heading" "body" "actions";
}
#tournamentBoard > .tournament-briefing-header {
  grid-area: heading;
  display: block;
  min-width: 0;
  padding-bottom: .55rem;
}
.tournament-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(5px, 1.2vw, 12px);
  padding: .45rem .55rem .45rem .85rem;
}
#tournamentTitle { margin: 0; overflow-wrap: anywhere; }
#tournamentBoard [data-tournament-close] {
  grid-column: 3;
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}
[data-tournament-status] { margin: .3rem 0 0; }
[data-tournament-status]:empty { display: none; }
#tournamentBoard > [data-tournament-details] {
  grid-area: body;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
#tournamentBoard > footer {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: .65rem;
}
#tournamentBoard > footer:has([data-tournament-enter][hidden]) { display: none; }

.tournament-briefing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
.tournament-briefing > section { min-width: 0; }
.tournament-briefing h3 { margin: 0 0 .35rem; }
.tournament-briefing p { margin: .45rem 0; overflow-wrap: anywhere; }
.tournament-map { width: min(100%, 360px); margin: 0; }
.tournament-map-art { position: relative; }
.tournament-map img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.tournament-map-marker {
  position: absolute;
  left: var(--marker-left);
  top: var(--marker-top);
  width: clamp(20px, 6%, 36px);
  aspect-ratio: 1;
  border: 3px solid #a51e27;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #b8242935;
  box-shadow: 0 0 0 1px #fff0cc;
}
.tournament-map figcaption { margin-block-start: .35rem; color: #e2c984; }

.tournament-characters { min-inline-size: 0; margin: 0; padding: .55rem; }
.tournament-roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr)); gap: 6px; }
.tournament-roster-count { display:block; margin:0 0 .4em; color:#d4dec9; }
.tournament-character-card { position:relative; min-width:0; }
#tournamentBoard .tournament-roster label {
  display: grid;
  grid-template-rows: 16px var(--tournament-portrait-size) auto;
  justify-items: center;
  align-items: center;
  gap: 5px;
  min-height: 100%;
  margin: 0;
  padding: 6px 4px;
  border: 1px solid #ddc88b48;
  border-radius: 6px;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.tournament-character-card label input { margin: 0; }
.tournament-character-card label .tournament-character-caption { grid-row: 3; }
.tournament-character-caption { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.tournament-character-caption .house-badge, .tournament-progress .house-badge {
  margin: 0;
  color: var(--tournament-guild-color);
  border-color: var(--tournament-guild-color);
  white-space: normal;
}
#tournamentBoard .tournament-story-button {
  position:absolute;
  inset-block-start: 28px;
  inset-inline: 0;
  margin-inline: auto;
  padding: 0;
  border: 0;
  width:var(--tournament-portrait-size);
  height:var(--tournament-portrait-size);
  min-width:0;
  min-height:0;
  line-height:0;
  border-radius:50%;
}
.tournament-roster label:has(input:checked) { border-color: #e2c984 !important; background: #8a6f3929; }
.tournament-roster input { accent-color: #e2c984; }
#tournamentBoard .tournament-pick-portrait {
  display: block;
  width: var(--tournament-portrait-size);
  height: var(--tournament-portrait-size);
  flex: 0 0 var(--tournament-portrait-size);
  min-width: var(--tournament-portrait-size);
  min-height: var(--tournament-portrait-size);
  max-width: var(--tournament-portrait-size);
  margin: 0;
  background-origin: border-box;
  border-radius: 50%;
}
.tournament-progress { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.tournament-progress span { align-self: center; }
.tournament-character-story { margin-block-start: .75rem; border-inline-start: 2px solid #ad9156; padding-inline-start: .7rem; }
.tournament-character-story summary { color: #e2c984; cursor: pointer; font-weight: 700; }
.tournament-briefing p strong { color: #f2cd78; }
.tournament-briefing p em { color: #d4e1cd; }
.tournament-lineup:not([hidden]) { display: flex; flex-wrap: wrap; gap: .4rem; margin-block-start: .65rem; }
.tournament-lineup button { display: inline-flex; align-items: center; gap: .5rem; }
.tournament-opponent:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 124px), 1fr));
  justify-items: start;
}
.tournament-opponent button {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 8px 6px;
  border-color: #93c2ad;
  color: #bee0cf;
  text-align: center;
}
.tournament-opponent button:only-child {
  flex-direction: row;
  justify-content: center;
  gap: 12px;
}
.tournament-opponent button:only-child .tournament-character-caption { width: auto; }
.tournament-opponent .tournament-character-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  font-size: .85em;
  white-space: normal;
  overflow-wrap: break-word;
}

.tournament-trophy {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: .4rem 0;
}
.tournament-trophy img { width: 48px; height: auto; }
.tournament-trophy figcaption { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5em; }
.tournament-trophy figcaption span {
  padding: .08em .4em;
  border: 1px solid #a98447;
  border-radius: .35em;
  color: #ffe18b;
  font-variant-numeric: tabular-nums;
}

.tournament-recap-result[hidden], #endRecapTournamentHome[hidden], #endRecapMenu[hidden] { display:none; }
#endRecapTournamentHome[data-collect="true"] {
  background:#2f563e;
  border-color:#79a881;
  color:#f2ffe9;
  font-weight:700;
}
#endRecapTournamentHome[data-collect="true"]:hover { background:#3a654a; }
.tournament-recap-result {
  position:relative;
  overflow:hidden;
  margin:0 0 .75rem;
  padding:.85rem 1rem;
  border:1px solid #d8b765;
  border-radius:10px;
  background:radial-gradient(ellipse at center top,#766031,#2e382d 65%,#21302a);
  text-align:center;
}
.tournament-recap-result h3 { margin:.2em 0; color:#ffe18b; font-size:clamp(1.35rem,3.4vw,2.35rem); }
.tournament-recap-result p { margin:.35em 0; color:#fff1c6; }
.tournament-recap-result .tournament-trophy { justify-content:center; }
.tournament-recap-result .tournament-trophy img { width:96px; }
.tournament-recap-result[data-cup-outcome="lost"] { background: #282520; border-color: #76674b; }
.tournament-recap-banner {
  display:grid;
  grid-template-areas:"player award speaker";
  grid-template-columns:minmax(0,1fr) minmax(0,2.5fr) minmax(0,1fr);
  align-items:start;
  gap:.8rem 1rem;
}
.tournament-recap-player { grid-area:player; }
.tournament-recap-speaker { grid-area:speaker; }
.tournament-recap-award { grid-area:award; min-inline-size:0; }
.tournament-recap-identity { min-inline-size:0; margin:0; color:#f6e9c8; }
.tournament-recap-identity figcaption { margin-block-start:.35rem; overflow-wrap:anywhere; }
.tournament-recap-portrait {
  display:inline-grid;
  place-items:center;
  padding:0;
  border-radius:50%;
  border:2px solid #d4b36b;
  vertical-align:middle;
}
.tournament-recap-player .tournament-recap-portrait { border-color:#8ab698; }
.tournament-recap-portrait .tournament-recap-face {
  inline-size:96px;
  min-inline-size:0;
  max-inline-size:none;
  block-size:auto;
  margin:0;
  border:0;
  box-shadow:none;
}
.tournament-closing-line {
  position:relative;
  inline-size:fit-content;
  max-inline-size:100%;
  box-sizing:border-box;
  margin:.65rem auto 0;
  padding:.4rem .65rem;
  border:1px solid #bb9e68;
  border-radius:.7rem;
  background:#f4e7c6;
  color:#33291d;
  font-size:.85rem;
  font-style:italic;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.tournament-closing-line::before {
  content:"";
  position:absolute;
  inset-block-start:-5px;
  inset-inline-start:calc(50% - 4px);
  inline-size:8px;
  block-size:8px;
  border-block-start:1px solid #bb9e68;
  border-inline-start:1px solid #bb9e68;
  background:inherit;
  transform:rotate(45deg);
}
.tournament-recap-standings, .tournament-recap-rewards { margin-block-start:.8rem; padding-block-start:.55rem; }
.tournament-recap-standings { border-block-start:1px solid #b36f68; }
.tournament-recap-rewards { border-block-start:1px solid #6e9a7a; }
.tournament-recap-result section h3 { font-size:1rem; }
.tournament-recap-result section ul { display:inline-grid; max-inline-size:100%; margin:.35rem 0 0; text-align:start; }
.tournament-recap-result section li { align-items:baseline; gap:.75rem; }
.tournament-recap-result section li > b { flex:none; font-variant-numeric:tabular-nums; }
.tournament-recap-you {
  display:inline-block;
  margin-inline-start:.25em;
  padding:.05em .4em;
  border:1px solid #74947b;
  border-radius:.35em;
  background:#263d31;
  color:#dbf4dc;
  font-size:.78em;
}
.tournament-recap-tokens { display:inline-flex; align-items:center; gap:.35em; font-weight:700; color:#ffe198; }
.tournament-recap-tokens .tournament-token-coin { inline-size:1.1em; block-size:1.1em; }

@media (max-width: 680px) {
  .tournament-recap-banner {
    grid-template-areas:"award award" "player speaker";
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .tournament-recap-banner:not(:has(.tournament-recap-speaker)) .tournament-recap-player { grid-column:1/-1; }
  .tournament-recap-portrait .tournament-recap-face { inline-size:76px; }
}
[data-tournament-entry-control] > button:disabled { pointer-events: none; }
[data-tournament-entry-notice] { min-inline-size: 0; color: #f2ddaa; line-height: 1.35; }

.tournament-career-wallet h3 { margin:0 0 .4rem; }
.tournament-career-wallet dl { display:flex; flex-wrap:wrap; gap:.4rem 1.5rem; margin:.25rem 0 .65rem; }
.tournament-career-wallet dd { margin:0; color:#ffe18b; font-weight:700; font-variant-numeric:tabular-nums; }

@media (min-width: 681px) and (max-height: 820px) {
  #tournamentBoard { --tournament-portrait-size: 66px; padding: 14px; }
  .tournament-map { width: min(100%, 256px); }
  .tournament-briefing p { margin-block: .35rem; }
  .tournament-opponent button { padding-block: 5px; }
}

@media (max-width: 680px) {
  .tournament-briefing { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
}

.tournament-sensei-tokens { margin-block: 10px; }
.tournament-sensei-tokens input { inline-size: 6ch; }
.tournament-sensei-list { display: grid; gap: 5px; padding: 0; list-style: none; }
.tournament-sensei-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tournament-commemoration { text-align: center; }
.tournament-commemoration img { display: block; margin: .75rem auto; }

.career-insignia {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 2px;
  padding: 3px 4px;
  margin-inline: .25em;
  border: 1px solid #42423b;
  border-radius: 4px;
  background: #101211;
  white-space: nowrap;
}
.career-insignia > i {
  display: block;
  width: 3px;
  height: 10px;
  border-radius: 1px;
  background: var(--career-first);
}
.career-insignia > i:nth-of-type(even):not(.career-insignia-dot) { background: var(--career-second); }
.career-insignia > .career-insignia-dot {
  width: 4px;
  height: 4px;
  margin-inline-start: 2px;
  border-radius: 50%;
  background: #fff;
}
.career-insignia-intro { --career-first: #edd050; --career-second: #fff9e7; }
.career-insignia-amber { --career-first: #edd050; --career-second: #e88133; }
.career-insignia-blue { --career-first: #4265cf; --career-second: #78d5f4; }
.career-insignia-silver { --career-first: #747d80; --career-second: #c7d0d4; }
.career-insignia-black-gold { --career-first: #534940; --career-second: #bd8736; }
.career-insignia-ivory-gold { --career-first: #fff3d6; --career-second: #ffcf63; border-color: #b48744; }
.career-insignia-hero { --career-first: #534940; --career-second: #ffcf63; border: 3px double #ffcf63; }
.career-insignia-tooltip {
  display: none;
  position: absolute;
  z-index: 5;
  inset: 100% auto auto 0;
  padding: 4px 7px;
  border: 1px solid #63573d;
  border-radius: 4px;
  background: #101211;
  color: #fff3d6;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
}
.career-insignia:focus .career-insignia-tooltip { display: block; }
.menu-account-career { display: inline-flex; align-items: center; min-width: 0; }
.menu-account-career > strong { white-space:normal; overflow-wrap:anywhere; }
.season-choice #landingSeasonSummary { max-width:34ch; margin:0; color:var(--muted); font-size:.8rem; }

[data-tournament-cup="side-bridge-duel"] {
  --tournament-base: #192b37;
  --tournament-pattern: repeating-linear-gradient(25deg, transparent 0 12px, #46677a66 12px 13px);
}
[data-tournament-cup="courtyard-cup"] {
  --tournament-base: #302236;
  --tournament-pattern: radial-gradient(circle at 5px 5px, #835d8066 1px, transparent 2px);
  --tournament-pattern-size: 14px 14px;
}
[data-tournament-cup="forge-challenge"] {
  --tournament-base: #362018;
  --tournament-pattern: repeating-linear-gradient(115deg, transparent 0 9px, #ac614855 9px 11px);
}

.tournament-paid-reopen { background: #624415; border-color: #c59646; color: #fff3d3; }
