/* The desktop match is one bounded stage; only long lists and opened records scroll. */
#battleLogDialog:not([open]) { display: none; }
#battleLogDialog[open] {
  position: fixed;
  inset: 0;
  width: min(800px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  color: var(--text);
  background: #0d1016;
  border: 1px solid #7b725c;
  box-shadow: 0 24px 90px #000b;
}
#battleLogDialog[open].is-empty { height: min(360px, calc(100dvh - 40px)); }
#battleLogDialog[open].is-compact { height: min(440px, calc(100dvh - 40px)); }
#battleLogDialog.is-empty .battle-log-entries { display: grid; align-content: center; justify-items: center; }
#battleLogDialog.is-empty #battleLogEmpty {
  width: min(480px, 100%); padding: 22px 16px; border-block: 1px solid #ffffff18;
  background: linear-gradient(90deg, transparent, #ffffff06 50%, transparent); text-align: center;
}
#battleLogDialog::backdrop { background: #030508c9; backdrop-filter: blur(8px); }
#battleLogDialog h3 { margin: 0; font-size: 22px; line-height: 1.4; }
#closeBattleLog { min-height: 40px; font-size: 14px; }
.battle-log-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #ffffff20; }
#battleLogFilters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 520px; }
#battleLogFilters button { min-width: 0; min-height: 42px; padding: 8px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #b8c2d0; box-shadow: none; font-size: 14px; }
#battleLogFilters button[aria-selected="true"] { border-bottom-color: #ebcf91; background: #e3bf6810; color: #ffe3aa; }
#battleLogFilters button:focus-visible { outline: 2px solid #9ad9ff; outline-offset: -3px; }
#battleLogCount { color: #aab5c6; font-size: 12px; font-variant-numeric: tabular-nums; }
.battle-log-entries { min-height: 0; overflow: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #97875f #11151b; }
.battle-log-entries:focus-visible { outline: 1px solid #8fcce0; outline-offset: 2px; }
#battleLogDialog #log { min-height: 0; overflow: visible; list-style: none; gap: 0; margin: 0; padding: 0; }
#battleLogDialog .log-entry { display: grid; gap: 5px; padding: 12px 14px; border-bottom: 1px solid #ffffff12; border-radius: 0; background: transparent; color: #dce2eb; font-size: 14px; line-height: 1.65; font-weight: 400; font-style: normal; }
#battleLogDialog .log-category { color: #c6b083; font-size: 11px; line-height: 1.4; font-weight: 600; }
#battleLogDialog .log-text { overflow-wrap: anywhere; }
#battleLogDialog .log-execution-wolf { color: #b8f3d3; border-left-color: #81ddb1; background: #15362940; }
#battleLogDialog .log-execution-human { color: #ffc0ce; border-left-color: #f29ab0; background: #3c182540; }
#battleLogDialog .log-execution-wolf .log-category, #battleLogDialog .log-execution-human .log-category { color: inherit; }
#battleLogDialog .log-lastword { color: #f2dfb0; }
#battleLogDialog .log-lastword .log-text { font-size: 16px; line-height: 1.7; }
#battleLogDialog .log-day .log-text, #battleLogDialog .log-result .log-text { font-weight: 600; }
#battleLogEmpty { margin: 0; padding: 28px 12px; color: #b7c2d1; font-size: 14px; line-height: 1.6; }
@media (max-width: 600px) {
  #battleLogDialog[open] { width: calc(100vw - 24px); padding: 14px; }
  #battleLogFilters button { padding: 8px 4px; font-size: 12px; }
  #battleLogDialog .log-entry { padding: 10px; }
}
.hand-panel.is-discarding.is-suspended { visibility: hidden; }
.match-god-portrait { position: relative; display: block; overflow: hidden; }
.match-god-portrait > img {
  position: absolute; display: block; width: 320%; height: 320%; max-width: none;
  left: -110%; top: -30%; object-fit: cover;
}
.match-god-portrait > img[data-god="ares"] { top: -1.2%; }
.match-god-portrait > img[data-god="odin"] { top: -62%; }
.match-god-portrait > img[data-god="athena"] { top: -36.4%; }
.match-god-portrait > img[data-god="fenrir"] { top: -26.8%; }
.match-god-portrait > img[data-god="dionysus"] { top: -52.4%; }
@media (max-width: 1023px), (max-height: 599px) {
  body.is-playing .hand-panel.is-discarding {
    position: fixed; inset: 16px; z-index: 35; width: auto; height: auto; margin: 0;
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px;
    border: 1px solid var(--gold); border-radius: 6px; background: #0c1016;
    box-shadow: 0 0 0 100vmax #030508cc;
  }
  body.is-playing .hand-panel.is-discarding .cards {
    min-height: 0; max-height: none; overflow: auto; grid-template-columns: 1fr;
    grid-auto-rows: max-content; align-content: start;
  }
  body.is-playing .hand-panel.is-discarding #drawCard { display: none; }
}
.day-resolution { z-index: 30; }
.day-resolution-box { max-height: calc(100dvh - 32px); overflow: auto; }
#dayResolutionTitle:focus { outline: none; }
.god-choice-details { display: grid; gap: 7px; text-align: left; }
.god-selection-preview { display: none; }
.god-stat-profile { display: none; }
.divine-board--fallback canvas { display: none; }
.divine-board--fallback .board-village-labels {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; padding: 22px 18px 50px; opacity: 1;
}
.divine-board-panel:has(.divine-board--fallback) .board-camera-controls { display: none; }
.board-fallback-village {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  pointer-events: auto; padding: 12px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--village-accent) 50%, transparent);
  background: linear-gradient(180deg, #09111bb0, var(--village-mist));
}
.board-fallback-village .village-scene { width: 100%; height: 100%; inset: 0; opacity: .65; }
.board-fallback-copy { position: relative; z-index: 1; display: grid; gap: 6px; text-align: left; text-shadow: 0 2px 6px #000; }
.board-fallback-copy > span { color: #ecd091; font-size: 11px; }
.board-fallback-copy > strong { color: #fff1d1; font-size: 20px; }
.board-fallback-copy > small { color: #d5e3ed; font-size: 11px; }
.board-fallback-copy > b { color: #fff1ce; font-size: 11px; }
.board-fallback-village.selected { outline: 2px solid var(--gold); outline-offset: -3px; }
.fallback-magic--human { box-shadow: inset 0 0 42px #ffdc7f80; }
.fallback-magic--wolf { box-shadow: inset 0 0 42px #ff69ab70; }
.fallback-magic--blocked { box-shadow: inset 0 0 42px #bfcada70; }
@media (max-width: 640px) {
  .divine-board--fallback .board-village-labels { grid-template-columns: 1fr; padding: 12px 12px 50px; gap: 6px; }
  .board-fallback-copy { grid-template-columns: 26px minmax(0, 1fr); gap: 3px 7px; }
  .board-fallback-copy > strong { font-size: 16px; }
  .board-fallback-copy > small, .board-fallback-copy > b { grid-column: 2; font-size: 10px; }
}
.spell-modifiers { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 5px; padding: 8px 0; border-bottom: 1px solid #ffffff14; }
.spell-modifiers.hidden { display: none; }
.spell-modifiers .spell-modifier {
  display: inline-flex; align-items: center; padding: 5px 7px;
  border: 1px solid #91d1f23d; border-radius: 3px;
  background: #123044; color: #caf0ff; font-size: 11px; font-weight: 800; line-height: 1.25;
  box-shadow: none;
}
.spell-modifiers .spell-modifier--boost { border-color: #eed37b77; background: #40341e; color: #ffe6a3; }
.spell-modifiers .spell-modifier--warning { border-color: #ff8daa50; background: #3e202c; color: #ffbdce; }
.spell-unavailable { color: #ffb3c2 !important; font-size: 10px; font-weight: 800; }
#cardTargetHint { font-size: 11px; color: #b1e7ff; padding: 4px 7px; border-left: 1px solid #78c7ed50; }
body.is-playing .village.selected:not([class*="done-"]) {
  border-color: #ead08d;
  box-shadow: inset 0 0 0 1px #ead08d33, 0 0 12px #ead08d18;
}
body.is-playing .village.selected::after { background: #ead08d; box-shadow: none; }
body.is-playing .village.selected .village-label-row > span { color: #ffe4a2; }
body.is-playing .village-label-row > span { letter-spacing: 0; }
.village-selection-label {
  display: inline; margin-left: 6px; padding-left: 6px;
  border-left: 1px solid currentColor; font-size: 10px; font-weight: 700; letter-spacing: 0;
}
.village--card-target { outline: 1px dashed #88d7ff; outline-offset: -4px; }
.village--card-target .village-label-row > span { color: #b1e7ff; }
.board-village-label small { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-village-label[data-lean="human"] small { color: #b1e6ff; }
.board-village-label[data-lean="wolf"] small { color: #ffc0d0; }
.board-village-label[data-lean="even"] small { color: #d8d4c9; }
.card-target-flash { animation: modifier-feedback .5s ease-out; }
@media (prefers-reduced-motion: reduce) { .card-target-flash { animation: none; } }
@media (max-width: 480px) { .hand-title-row { flex-wrap: wrap; } #cardTargetHint { font-size: 10px; } }
@media (max-width: 480px) {
  .match-faction--wolf { grid-template-columns: 36px minmax(0, 1fr) 30px; }
  .match-god-copy strong { text-wrap: balance; line-break: strict; overflow-wrap: normal; }
}
.match-mp { position: relative; }
.match-mp.mp-feedback { animation: mp-feedback .5s ease-out; }
.match-mp[data-delta] > small { visibility: hidden; }
.match-mp[data-delta]::after {
  content: attr(data-delta); position: absolute; top: 4px; left: 0; right: 0;
  text-align: center; color: #9ff3c2; font-size: 11px; font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.match-mp[data-trend="spend"]::after { color: #ffb2c4; }
.spell-modifier--new { animation: modifier-feedback .55s ease-out; }
@keyframes mp-feedback { 0%, 100% { filter: none; } 35% { filter: brightness(1.35); box-shadow: 0 0 16px #eed08542; } }
@keyframes modifier-feedback { 0%, 100% { filter: none; } 30% { filter: brightness(1.5); box-shadow: 0 0 12px #9bdcff66; } }
@media (prefers-reduced-motion: reduce) { .match-mp.mp-feedback, .spell-modifier--new { animation: none; } }

.card-inspection {
  position: fixed; z-index: 20; width: 320px; max-height: calc(100dvh - 24px);
  display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: stretch;
  overflow: hidden; pointer-events: none;
  border: 1px solid #d5bb76; border-radius: 6px;
  background: #0b1018;
  box-shadow: 0 12px 48px #000b, 0 0 18px #d5ab3a24;
}
.card-inspection.hidden { display: none; }
.card-inspection > img { display: block; width: 88px; height: 132px; align-self: center; object-fit: contain; background: #080b10; }
.card-inspection > div { display: grid; align-content: center; gap: 6px; padding: 10px 12px; min-width: 0; border-left: 1px solid #d5bb763a; }
.card-inspection small { color: #c7a769; font-size: 11px; font-weight: 600; }
.card-inspection strong { color: #fff0cc; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.card-inspection p { margin: 0; color: #e0e5eb; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.card-inspection b { color: #dfc284; font-size: 12px; }
.card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.is-playing .hand-panel:not(.is-discarding) .card.card--just-drawn { border-color: #f3d588; box-shadow: inset 0 0 0 1px #f3d588, 0 0 12px #e3b74750; }
.spell-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
@media (max-width: 1023px), (max-height: 599px) { .card-inspection { display: none; } }
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) {
  .card-inspection { width: 280px; grid-template-columns: 72px minmax(0, 1fr); }
  .card-inspection > img { width: 72px; height: 108px; }
  .card-inspection > div { gap: 4px; padding: 8px; }
  .card-inspection strong { font-size: 16px; }
  .card-inspection p { font-size: 12px; }
}

/* The final result is a full-screen scene with a single clear return path. */
.result {
  z-index: 45;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(110deg, #080c12, #0b111b 55%, #131a23);
  padding: 28px;
}
.result[data-outcome="defeat"] { background: linear-gradient(110deg, #10090d, #170c14 55%, #27121d); }
.result-portrait {
  position: absolute; z-index: -1;
  right: 0; top: 0; width: 54%; height: 100%;
  object-fit: cover; object-position: center 20%;
  opacity: .7;
  mask-image: linear-gradient(90deg, transparent, #000 38%, #000b);
}
.result .result-box {
  display: grid; align-content: center; justify-self: start;
  width: min(1100px, 100%); max-height: calc(100dvh - 56px);
  padding: 20px 36px; gap: 14px; overflow-y: auto;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  text-align: left;
}
.result-heading { display: grid; gap: 8px; }
.result-heading > span { color: #e4c485; font-size: 12px; font-weight: 900; }
.result-heading h2 { margin: 0; color: #ffe7a8; font-size: 72px; line-height: 1.08; font-weight: 900; text-shadow: 0 0 36px #c79a403f; }
.result-heading h2:focus { outline: none; }
.result[data-outcome="defeat"] .result-heading h2 { color: #ffa9bc; text-shadow: 0 0 36px #d5557e40; }
.result-heading > strong { color: #f1eee6; font-size: 19px; }
.result-score { display: flex; align-items: baseline; gap: 12px; width: fit-content; padding: 5px 0; color: #ded9cd; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-score span { display: inline-flex; align-items: baseline; gap: 7px; }
.result-score b { font-size: 27px; line-height: 1; }
.result-score .human { color: #9fdbff; }
.result-score .wolf { color: #ffacc1; }
.result-score i { color: #8c8a84; font-size: 16px; font-style: normal; }
.result #resultText { margin: 0; color: #d6d6d1; font-size: 13px; text-shadow: none; }
.result-match-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 620px; border-block: 1px solid #dbc48b3d;
  padding: 10px 0; margin: 4px 0;
}
.result-match-stats > span { display: grid; gap: 4px; border-right: 1px solid #dbc48b24; padding-inline: 14px; }
.result-match-stats > span:first-child { padding-left: 0; }
.result-match-stats > span:last-child { border-right: 0; }
.result-match-stats small { color: #c9c6bd; font-size: 11px; font-weight: 700; }
.result-match-stats b { color: #fff4d2; font-size: 24px; font-variant-numeric: tabular-nums; }
.result-match-stats b small { margin-left: 4px; }
.result .result-villages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.result .result-village { display: grid; align-content: start; gap: 7px; padding: 14px; background: #0e131be8; border: 1px solid #747b844a; border-radius: 5px; }
.result .result-village.human { border-top: 3px solid var(--human); }
.result .result-village.wolf { border-top: 3px solid var(--wolf); }
.result-village-letter { color: #cbb57e; font-size: 10px; font-weight: 900; }
.result .result-village-name { display: block; color: #fff7e5; font-size: 18px; }
.result-village-winner { color: #d5d8dd; font-size: 13px; }
.result-village.human .result-village-winner { color: #9fdbff; }
.result-village.wolf .result-village-winner { color: #ffacc1; }
.result-village > span:not(.result-village-letter), .result-village > small { color: #c4c8ce; font-size: 11px; }
.result-village details { font-size: 11px; color: #acb8c8; border-top: 1px solid #ffffff12; padding-top: 6px; }
.result-village summary { cursor: pointer; padding: 4px 0; }
.result-village details p { color: #c5cbd4; line-height: 1.55; margin: 6px 0; }
.result .result-actions { width: min(620px, 100%); gap: 12px; margin-top: 8px; }
.result .result-actions button { min-height: 46px; font-size: 14px; }
.result:not(.hidden) { animation: result-scene-enter .22s ease-out both; }
.result:not(.hidden) .result-portrait { animation: result-portrait-enter .64s cubic-bezier(.2, .75, .2, 1) both; }
.result:not(.hidden) .result-box { animation: result-summary-enter .34s cubic-bezier(.2, .8, .2, 1) both; }
.result:not(.hidden) .result-village { animation: result-village-enter .28s ease-out both; }
.result:not(.hidden) .result-village:nth-child(2) { animation-delay: .07s; }
.result:not(.hidden) .result-village:nth-child(3) { animation-delay: .14s; }
.result:not(.hidden) .result-heading { animation: result-heading-enter .42s ease-out both; }
@keyframes result-scene-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes result-portrait-enter { from { opacity: 0; transform: translateX(16px) scale(1.025); filter: brightness(.72); } to { opacity: .7; transform: none; filter: none; } }
@keyframes result-summary-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes result-village-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes result-heading-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .result:not(.hidden), .result:not(.hidden) .result-portrait, .result:not(.hidden) .result-box,
  .result:not(.hidden) .result-village, .result:not(.hidden) .result-heading { animation: none; }
}
@media (max-width: 700px) {
  .result { padding: 12px; }
  .result .result-box { max-height: calc(100dvh - 24px); padding: 8px; gap: 8px; align-content: start; }
  .result-heading { gap: 4px; }
  .result-heading h2 { font-size: 42px; }
  .result-heading > strong { font-size: 14px; }
  .result-score { gap: 8px; padding: 2px 0; font-size: 11px; }
  .result-score b { font-size: 22px; }
  .result #resultText { font-size: 12px; line-height: 1.35; }
  .result .result-villages { grid-template-columns: 1fr; gap: 7px; }
  .result .result-village { gap: 3px; padding: 7px 9px; }
  .result .result-village-name { font-size: 16px; }
  .result-village-winner { font-size: 12px; }
  .result-village > span:not(.result-village-letter), .result-village > small { font-size: 10px; line-height: 1.25; }
  .result .result-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 0; }
  .result .result-actions button { min-height: 40px; padding: 6px; font-size: 12px; }
  .result-portrait { width: 100%; opacity: .3; }
  .result-match-stats { padding: 6px 0; margin: 0; }
  .result-match-stats > span { padding-inline: 5px; gap: 2px; }
  .result-match-stats small { font-size: 10px; }
  .result-match-stats b { font-size: 18px; }
}

/* The title artwork is the menu's focal point; controls stay at its edges. */
.setup[data-phase="menu"] {
  height: 100dvh; min-height: 0; padding: 16px 28px;
  grid-template-columns: minmax(0, 1440px); grid-template-rows: 60px minmax(0, 1fr);
  place-content: stretch center; gap: 10px; overflow: auto;
  background: linear-gradient(180deg, #03060a20, #03060a50 65%, #03060aca), url('data/image/main.jpg') center / cover;
}
.setup[data-phase="menu"] .setup-header {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.setup[data-phase="menu"] .archive-menu {
  grid-row: 1; grid-column: 1; justify-self: end; align-self: start;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  width: auto; padding: 0; border: 0; background: transparent; backdrop-filter: none;
}
.setup[data-phase="menu"] .archive-menu button { min-height: 38px; padding: 7px 12px; font-size: 13px; font-weight: 500; }
.setup[data-phase="menu"] .main-menu {
  grid-row: 2; align-self: end; justify-self: center; width: min(620px, 100%);
  margin: 0; padding: 16px; gap: 18px; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
}
.setup[data-phase="menu"] .main-menu::before,
.setup[data-phase="menu"] .main-menu::after,
.setup[data-phase="menu"] .main-menu-start::before { display: none; }
.setup[data-phase="menu"] .main-menu-start { min-height: 60px; width: min(340px, 100%); padding: 12px 20px; place-content: center; border-radius: 4px; }
.setup[data-phase="menu"] .main-menu-start span { font-size: 20px; line-height: 1.5; font-weight: 700; }
.setup[data-boot="loading"] #openMatchSetup { opacity: 1; filter: none; color: #d9deea; border-color: #a2a9b655; background: #111923ed; cursor: wait; box-shadow: none; }
.setup[data-phase="menu"] .main-menu-record { height: 68px; grid-template-rows: minmax(0, 1fr); border: 0; border-top: 1px solid #ecd28a3d; background: transparent; padding-top: 12px; width: min(440px, 100%); }
.setup[data-phase="menu"] .main-menu-record span { background: transparent; border: 0; font-size: 11px; font-weight: 400; color: #d4d5d9; }
.setup[data-phase="menu"] .main-menu-record b { font-size: 19px; font-weight: 700; }
@media (max-width: 700px) {
  .setup[data-phase="menu"] {
    padding: 12px 16px max(14px, env(safe-area-inset-bottom)); grid-template-rows: 72px minmax(0, 1fr); gap: 12px;
    background-color: #080c14;
    background-image: linear-gradient(180deg, #05091120, transparent 65vw, #080c1400 calc(150vw - 100px), #080c14 calc(150vw - 1px)), url('data/image/menu-portrait.webp');
    background-position: center top; background-size: 100% auto; background-repeat: no-repeat;
  }
  .setup[data-phase="menu"] .archive-menu { justify-self: stretch; justify-content: center; gap: 4px; }
  .setup[data-phase="menu"] .archive-menu button { padding: 6px 9px; font-size: 12px; min-height: 36px; }
  .setup[data-phase="menu"] .main-menu { padding: 0; gap: 12px; }
  .setup[data-phase="menu"] .main-menu-start { min-height: 56px; }
  .setup[data-phase="menu"] .main-menu-start span { font-size: 18px; }
}
@media (max-width: 700px) and (max-height: 500px) {
  .setup[data-phase="menu"] {
    padding: 8px 16px; grid-template-rows: 38px minmax(0, 1fr); gap: 6px;
    background: linear-gradient(180deg, #03060a20, #03060a60 65%, #03060ae0), url('data/image/main.jpg') center / cover;
  }
  .setup[data-phase="menu"] .main-menu { gap: 6px; }
  .setup[data-phase="menu"] .main-menu-start { min-height: 46px; padding-block: 6px; }
  .setup[data-phase="menu"] .main-menu-record { height: 56px; padding-top: 4px; }
  .setup[data-phase="menu"] .main-menu-record span { padding-block: 4px; }
}

@media (min-width: 1024px) and (min-height: 600px) {
  .setup[data-phase="menu"] {
    padding: 24px 28px; grid-template-columns: minmax(0, 1fr) 340px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 68px; place-content: stretch center;
    gap: 24px; overflow: hidden;
    background: linear-gradient(180deg, #03060a20, #03060a50 65%, #03060aca), url('data/image/main.jpg') center / cover;
  }
  .setup[data-phase="menu"] .setup-header { grid-row: 1; grid-column: 1; justify-self: start; align-content: center; padding: 0; }
  .setup[data-phase="menu"] .setup-header h1 { font-size: 36px; }
  .setup[data-phase="menu"] .setup-kicker, .setup[data-phase="menu"] #setupLead { display: none; }
  .setup[data-phase="menu"] .archive-menu { grid-row: 2; grid-column: 1; justify-self: start; align-self: center; width: auto; padding: 0; gap: 4px; background: transparent; }
  .setup[data-phase="menu"] .archive-menu button:not(#bgmToggleSetup) {
    min-height: 44px; padding: 8px; border: 0; border-bottom: 1px solid transparent;
    border-radius: 0; background: #05090d99; color: #e0e5ed; font-size: 14px;
    box-shadow: none;
  }
  .setup[data-phase="menu"] .archive-menu button:not(#bgmToggleSetup):is(:hover, :focus-visible):not(:disabled) { color: #ffe3a4; border-bottom-color: #e5ca89; background: #131b25ed; }
  .setup[data-phase="menu"] #bgmToggleSetup { position: fixed; top: 20px; right: 28px; min-height: 38px; background: #0c121be8; border-color: #a8905c88; }
  .setup[data-phase="menu"] .archive-menu #toggleFullscreenMenu.fullscreen-menu-toggle {
    position: fixed; top: 20px; right: 112px; min-width: 72px; min-height: 38px; padding: 6px 10px;
    border: 1px solid #a8905c88; border-radius: 4px; background: #0c121be8;
    box-shadow: inset 0 1px #ffffff0c; color: #f3dda9; font-size: 12px; font-weight: 800;
  }
  .setup[data-phase="menu"] .archive-menu #toggleFullscreenMenu.fullscreen-menu-toggle:hover,
  .setup[data-phase="menu"] .archive-menu #toggleFullscreenMenu.fullscreen-menu-toggle:focus-visible { border-color: #e7cc8e; background: #171a20f2; color: #fff0bf; }
  .setup[data-phase="menu"] .main-menu {
    display: contents;
  }
  .setup[data-phase="menu"] .main-menu::before,
  .setup[data-phase="menu"] .main-menu::after,
  .setup[data-phase="menu"] .main-menu-emblem,
  .setup[data-phase="menu"] .main-menu-kicker,
  .setup[data-phase="menu"] .main-menu h2,
  .setup[data-phase="menu"] .main-menu-copy { display: none; }
  .setup[data-phase="menu"] .main-menu h2 { font-size: 32px; line-height: 1.35; }
  .setup[data-phase="menu"] .main-menu-copy { font-size: 14px; line-height: 1.65; }
  .setup[data-phase="menu"] .main-menu-start {
    grid-column: 2; grid-row: 2; align-self: center; min-height: 64px; width: 100%; padding: 10px 16px;
    border: 1px solid #e5ca89; border-radius: 2px; background: linear-gradient(110deg, #202c3bf5, #0b111bf5);
    color: #fff1cd; box-shadow: inset 0 1px #fff1ce24, 0 8px 28px #0008;
  }
  .setup[data-phase="menu"] .main-menu-start:is(:hover, :focus-visible):not(:disabled) { background: linear-gradient(110deg, #2b3949, #141c28); box-shadow: inset 0 0 0 1px #e5ca8980, 0 8px 28px #0008; filter: none; }
  .setup[data-phase="menu"] .main-menu-start span { font-size: 22px; }
  .setup[data-phase="menu"] .main-menu-record { grid-column: 3; grid-row: 2; justify-self: end; border: 0; border-left: 1px solid #ecd28a3d; background: transparent; padding: 0 0 0 20px; width: min(320px, 100%); }
  .setup[data-phase="menu"] .main-menu-record b { font-size: 22px; }
  .setup[data-phase="menu"] .main-menu-record span { background: transparent; border: 0; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) {
    padding: 16px 28px; grid-template-columns: minmax(0, 1440px);
    grid-template-rows: 60px minmax(0, 1fr); place-content: stretch center;
    gap: 10px; overflow: hidden;
  }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .setup-header {
    grid-row: 1; grid-column: 1; justify-self: start; align-content: center; padding: 0;
  }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .setup-header h1 { font-size: 30px; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .setup-kicker,
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) #setupLead { display: none; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .archive-menu {
    grid-row: 1; grid-column: 1; justify-self: end; align-self: center; width: auto;
    background: transparent; padding: 0;
  }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .village-lottery {
    grid-row: 2; width: 100%; height: 100%; min-height: 0; padding: 16px 20px;
    grid-template-rows: 24px minmax(0, 1fr) 24px 42px; gap: 10px;
    border: 0; border-radius: 0; background: #070c13c9; box-shadow: none;
  }
  .setup[data-phase="reveal"] .lottery-slot { display: none; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"]) .lottery-slot { grid-row: 2; align-self: center; }
  .setup[data-phase="reveal"] .lottery-result { grid-row: 2; height: 100%; min-height: 0; }
  .setup[data-phase="reveal"] .village-trait-list { height: 100%; min-height: 0; grid-template-rows: 20px minmax(0, 1fr); gap: 10px; }
  .setup[data-phase="reveal"] .village-trait-card {
    min-height: 0; padding: 16px; gap: 10px; align-content: center;
    background: linear-gradient(155deg, #19202bec, #080d15f0);
    border-color: #c4aa6552; text-align: left;
    animation: village-reveal-enter .4s ease-out both;
  }
  .setup[data-phase="reveal"] .village-trait-card:nth-child(3) { animation-delay: .07s; }
  .setup[data-phase="reveal"] .village-trait-card:nth-child(4) { animation-delay: .14s; }
  .setup[data-phase="reveal"] .village-trait-card > span { font-size: 11px; }
  .setup[data-phase="reveal"] .village-trait-card > strong { font-size: 26px; }
  .setup[data-phase="reveal"] .village-trait-card p { min-height: 34px; font-size: 13px; line-height: 1.4; }
  .setup[data-phase="reveal"] .setup-affinity { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .setup[data-phase="reveal"] .setup-affinity span { display: grid; gap: 3px; padding: 8px; font-size: 12px; }
  .setup[data-phase="reveal"] .village-winrate-reference { min-width: 0; padding: 8px; }
  .setup[data-phase="reveal"] .village-winrate-reference span { font-size: 24px; }
  .setup[data-phase="reveal"] .village-winrate-reference small { font-size: 10px; }
  .setup[data-phase="reveal"] .village-trait-card > small { font-size: 12px; line-height: 1.4; min-height: 34px; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .lottery-log {
    grid-row: 3; width: 100%; padding: 0; overflow: hidden; list-style: none; text-align: center;
  }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .lottery-log li { display: none; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) .lottery-log li:last-child { display: block; }
  .setup:is([data-phase="lottery"], [data-phase="rolling"], [data-phase="reveal"]) #startVillageLottery { grid-row: 4; min-height: 42px; margin: 0; padding: 6px 18px; }
  .setup[data-phase="god"] {
    padding: 16px 28px;
    grid-template-columns: minmax(0, 1440px);
    grid-template-rows: 60px minmax(0, 1fr);
    place-content: stretch center;
    gap: 10px;
    overflow: hidden;
  }
  .setup[data-phase="god"] .setup-header {
    grid-template-columns: 1fr auto; align-items: center; justify-items: start;
    padding: 0; gap: 0 12px;
    grid-row: 1; grid-column: 1; justify-self: start;
  }
  .setup[data-phase="god"] .setup-kicker { display: none; }
  .setup[data-phase="god"] .setup-header h1 { font-size: 30px; }
  .setup[data-phase="god"] #setupLead { display: none; }
  .setup[data-phase="god"] .archive-menu { width: auto; min-height: 0; padding: 0; background: transparent; justify-content: flex-end; grid-row: 1; grid-column: 1; justify-self: end; align-self: center; }
  .setup[data-phase="god"] .archive-menu button { min-height: 32px; padding: 5px 12px; }
  .setup[data-phase="god"] .god-setup {
    min-height: 0; width: 100%;
    grid-row: 2;
    grid-template-columns: minmax(190px, .8fr) minmax(240px, 1fr) minmax(320px, 1.2fr);
    grid-template-rows: auto 48px minmax(0, 1fr);
    gap: 12px; align-items: stretch;
  }
  .setup[data-phase="god"] .current-village { grid-column: 1 / -1; grid-row: 1; }
  .setup[data-phase="god"] .god-select-kicker { display: none; }
  .setup[data-phase="god"] .side-select { grid-column: 1; grid-row: 2; width: 100%; align-self: center; }
  .setup[data-phase="god"] .difficulty-select { grid-column: 2; grid-row: 2; width: 100%; align-self: center; }
  .setup[data-phase="god"] .setup-start-bar { grid-column: 3; grid-row: 2; width: 100%; margin: 0; padding: 4px; }
  .setup[data-phase="god"] .setup-start-bar > span { font-size: 11px; }
  .setup[data-phase="god"] .setup-start-bar .start-game { min-width: 150px; font-size: 12px; }
  .setup[data-phase="god"] .god-choices {
    grid-column: 1 / -1; grid-row: 3; min-height: 0;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%;
  }
  .setup[data-phase="god"] .god-choice {
    min-height: 0; height: 100%; padding: 6px;
    grid-column: 2;
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 9px; transform: none;
  }
  .setup[data-phase="god"] .god-selection-preview {
    display: grid; min-height: 0;
    grid-column: 1; grid-row: 1 / -1;
    grid-template-columns: minmax(140px, .7fr) minmax(0, 1fr);
    padding: 12px; gap: 18px; border: 1px solid #d4b97780; border-radius: 4px;
    background: linear-gradient(110deg, #11141aa6, #0c0e13ed);
  }
  .setup[data-phase="god"] .god-choice:not(.selected) { border-color: #66718140; box-shadow: none; background: #0c0e13c9; }
  .setup[data-phase="god"] .god-choice:not(.selected)::before { display: none; }
  .setup[data-phase="god"] .god-choice:not(.selected):is(:hover, :focus-visible):not(:disabled) { border-color: #d2bc80; }
  .setup[data-phase="god"] .god-selection-preview .god-portrait { object-fit: contain; border: 0; background: transparent; }
  .setup[data-phase="god"] .god-choice .god-choice-details { gap: 2px; align-content: center; padding: 0; }
  .setup[data-phase="god"] .god-choice .god-choice-details > strong { font-size: 16px; line-height: 1.3; }
  .setup[data-phase="god"] .god-choice .god-stars { font-size: 11px; line-height: 1.3; }
  .setup[data-phase="god"] .god-choice .god-title,
  .setup[data-phase="god"] .god-choice .god-stars + .god-stars,
  .setup[data-phase="god"] .god-choice .god-specialties,
  .setup[data-phase="god"] .god-choice .god-spells,
  .setup[data-phase="god"] .god-choice .god-playstyle,
  .setup[data-phase="god"] .god-choice .god-thought,
  .setup[data-phase="god"] .god-choice.locked .god-stars,
  .setup[data-phase="god"] .god-choice:not(.locked) .god-copy { display: none; }
  .setup[data-phase="god"] .god-choice.locked .god-copy { font-size: 11px !important; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .setup[data-phase="god"] .god-portrait {
    width: 100%; height: 100%; min-height: 0; max-height: none;
    aspect-ratio: auto; object-fit: cover; object-position: center 15%;
  }
  .setup[data-phase="god"] .god-choice-details {
    min-height: 0; overflow-y: auto; align-content: start;
    grid-auto-rows: max-content;
    padding: 2px 4px 6px; gap: 6px;
    scrollbar-width: thin; scrollbar-color: #9b8757 #11151b;
  }
  .setup[data-phase="god"] .god-title { font-size: 10px; }
  .setup[data-phase="god"] .god-choice-details > strong { font-size: 21px; line-height: 1.2; }
  .setup[data-phase="god"] .god-stars { font-size: 12px; }
  .setup[data-phase="god"] .god-copy { min-height: 0; font-size: 12px !important; }
  .setup[data-phase="god"] .god-playstyle { min-height: 0; font-size: 11px; }
  .setup[data-phase="god"] .god-thought { display: none; }
  .setup[data-phase="god"] .god-specialties { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; font-size: 11px; padding: 4px 0; }
  .setup[data-phase="god"] .god-specialties span { margin: 0; white-space: nowrap; }
  .setup[data-phase="god"] .god-spell-tier { font-size: 11px; }
  .setup[data-phase="god"] .god-choice.locked .god-stars,
  .setup[data-phase="god"] .god-choice.locked .god-specialties,
  .setup[data-phase="god"] .god-choice.locked .god-spells,
  .setup[data-phase="god"] .god-choice.locked .god-playstyle { display: none; }
  .setup[data-phase="god"] .god-choice.locked { opacity: .8; }
  .setup[data-phase="god"] .god-choice.locked .god-portrait { object-fit: contain; opacity: .4; }
  .setup[data-phase="god"] .god-choice.hidden-god { grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .setup[data-phase="god"] .setup-village-overview { gap: 6px; }
  .setup[data-phase="god"] .setup-village-pick { min-height: 65px; }
  .setup[data-phase="god"] .setup-village-detail { padding-top: 6px; gap: 5px 12px; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-width: 1199px) {
  .setup[data-phase="menu"] #toggleFullscreenMenu { right: 108px; }
}
@media (max-width: 1023px) {
  .setup[data-phase="menu"] #toggleFullscreenMenu { display: none; }
}

@keyframes village-reveal-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .setup[data-phase="reveal"] .village-trait-card { animation: none; } }
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 660px) {
  .setup[data-phase="reveal"] .village-trait-card { padding: 10px 12px; gap: 7px; }
  .setup[data-phase="reveal"] .village-trait-card > strong { font-size: 22px; }
  .setup[data-phase="reveal"] .setup-affinity span { padding: 5px 7px; }
}

@media (max-width: 1023px), (max-height: 599px) {
  .turn-strip { grid-template-columns: minmax(0, 1fr); }
  .turn-buttons { flex-wrap: wrap; justify-content: flex-start; }
  .turn-buttons button { min-width: 0; }
}

@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) {
  body.is-playing .game-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: 66px 36px 26px minmax(0, 1fr) 100px clamp(216px, 30vh, 260px);
  }
  body.is-playing .card-body { grid-template-columns: 30px minmax(0, 1fr); }
  body.is-playing .card-thumb { width: 30px; height: 46px; }
  body.is-playing .card-name { font-size: 11px; }
  body.is-playing .card-copy small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  body.is-playing .card { background: linear-gradient(120deg, #302719, #11151d); }
}

@media (min-width: 1024px) and (min-height: 600px) {
  body.is-playing { height: 100dvh; min-height: 0; overflow: hidden; }
  body.is-playing .app {
    width: 100%; max-width: 1920px; height: 100dvh; min-height: 0;
    padding: 12px 18px; overflow: hidden;
    background: linear-gradient(180deg, #080b10ed, #090a0eee), url('data/image/main.jpg') center / cover;
  }
  body.is-playing .game-layout {
    display: grid;
    width: 100%; height: 100%; min-height: 0;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: 76px 42px 30px minmax(0, 1fr) 108px 188px;
    gap: 8px 14px; align-items: stretch;
  }
  body.is-playing .play-column, body.is-playing .actions { display: contents; }
  body.is-playing .match-hud {
    grid-column: 1 / -1; grid-row: 1;
    position: relative; top: auto; margin: 0; padding: 0 8px;
    grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
    height: 76px; box-shadow: none; border-bottom: 1px solid #b6a27645;
  }
  body.is-playing .match-faction { min-height: 0; }
  body.is-playing .match-god-portrait { width: 48px; height: 62px; flex-basis: 48px; }
  body.is-playing .match-god-copy > span { display: none; }
  body.is-playing .match-god-copy strong { font-size: 18px; }
  body.is-playing .match-center h2 { font-size: 24px; }
  body.is-playing .match-center { display: grid; grid-template-columns: auto auto; gap: 2px 12px; align-content: center; justify-content: center; }
  body.is-playing .match-center h2 { grid-column: 1; grid-row: 1 / 5; align-self: center; margin: 0; }
  body.is-playing .match-center > :not(h2) { grid-column: 2; margin: 0; }
  body.is-playing .match-mp b { font-size: 22px; }
  body.is-playing .turn-strip {
    grid-column: 1 / -1; grid-row: 2; position: static;
    margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
    min-width: 0; gap: 10px;
  }
  body.is-playing .turn-buttons { gap: 5px; align-items: center; }
  body.is-playing .turn-buttons button { min-width: 0; min-height: 34px; padding: 6px 9px; font-size: 12px; }
  body.is-playing .turn-strip #turnOwner { height: 36px; font-size: 13px; }
  body.is-playing .turn-strip #turnOwner::after { font-size: 12px; }
  body.is-playing .turn-roadmap {
    grid-column: 1; grid-row: 3; position: static; margin: 0;
    border: 0; padding: 0; box-shadow: none;
  }
  body.is-playing .turn-roadmap-step { padding: 4px 10px; grid-template-areas: 'count title'; }
  body.is-playing .turn-roadmap-step small { display: none; }
  body.is-playing .turn-roadmap-step strong { font-size: 12px; }
  body.is-playing .divine-board-panel {
    grid-column: 1; grid-row: 4; min-height: 0; height: 100%; margin: 0;
    position: relative; display: block; border: 0;
  }
  body.is-playing .divine-board { height: 100%; min-height: 0; border: 0; border-radius: 0; }
  body.is-playing .divine-board-head {
    position: absolute; left: 12px; right: 12px; top: 8px; z-index: 4; pointer-events: none;
  }
  body.is-playing .divine-board-head > div:first-child { display: none; }
  body.is-playing .board-camera-controls { margin-left: auto; pointer-events: auto; }
  body.is-playing .divine-board-foot { display: none; }
  body.is-playing .villages {
    grid-column: 1; grid-row: 5; min-height: 0; gap: 8px;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.is-playing .village { height: 100%; min-height: 0; padding: 4px 10px; display: grid; grid-template-rows: 14px 20px 24px minmax(22px, 1fr); gap: 2px; align-content: stretch; }
  body.is-playing .village-target-ribbon { display: none; }
  body.is-playing .village-label-row { margin: 0; }
  body.is-playing .village-title > small { display: none; }
  body.is-playing .village-head { min-height: 0; margin: 0; }
  body.is-playing .village h3 { font-size: 15px; }
  body.is-playing .village .situation { margin: 0; grid-template-columns: 100px minmax(0, 1fr); align-items: center; }
  body.is-playing .village .alive { min-height: 0; height: 24px; display: flex; align-items: center; gap: 4px; background: none; justify-content: flex-start; }
  body.is-playing .village .alive small { font-size: 9px; }
  body.is-playing .village .alive { padding: 0; }
  body.is-playing .village .status-lines > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.is-playing .village .alive { font-size: 19px; }
  body.is-playing .village .status-lines { font-size: 10px; line-height: 1.25; gap: 2px; }
  body.is-playing .village .status-lines > span:first-child { display: none; }
  body.is-playing .momentum-labels { display: none; }
  body.is-playing .village-momentum { margin: 0; padding: 0; }
  body.is-playing .momentum-scale { height: 6px; }
  body.is-playing .momentum-scale i { height: 10px; }
  body.is-playing .momentum-axis { font-size: 9px; }
  body.is-playing .village-outcome-ribbon { position: absolute; bottom: 0; top: auto; left: 0; right: 0; min-height: 23px; padding: 4px 6px; }
  body.is-playing .spell-panel {
    grid-column: 1; grid-row: 6; position: relative;
    min-height: 0; padding: 10px;
    display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px 12px;
    border: 0; border-top: 1px solid #ddc68c3d; border-radius: 0;
    background: linear-gradient(180deg, #181b20ed, #0e1116);
  }
  body.is-playing .panel-head--spell { grid-column: 1; grid-row: 1; display: grid; gap: 8px; align-content: start; }
  body.is-playing .spell-modifiers { grid-column: 1; grid-row: 2; min-height: 0; overflow: auto; align-content: start; padding: 0; border: 0; }
  body.is-playing #targetHint { max-width: none; width: 100%; font-size: 12px; }
  body.is-playing .spells {
    grid-column: 2; grid-row: 1 / 3; grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 0; height: 100%; margin: 0; max-height: none; overflow: auto;
    align-content: start; gap: 5px; padding-right: 5px;
    grid-auto-rows: max-content; align-items: start;
    scrollbar-width: thin; scrollbar-color: #97875f #11151b;
  }
  body.is-playing .spell-phase-notice { grid-column: 1 / -1; }
  body.is-playing .spell { position: relative; padding: 10px; gap: 7px; min-height: 72px; }
  body.is-playing .spell-description { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  body.is-playing .spell-heading > strong { font-size: 16px; line-height: 1.4; font-weight: 700; white-space: normal; }
  body.is-playing .spell-description > span { font-size: 12px; line-height: 1.5; font-weight: 400; color: #c8cbd1; }
  body.is-playing .spell-effect { font-size: 13px; line-height: 1.5; font-weight: 500; display: flex; flex-wrap: wrap; gap: 2px 6px; padding-top: 0; border-top: 0; }
  body.is-playing .spell-effect > b { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  body.is-playing .spell-effect b { font-size: 11px; font-weight: 500; letter-spacing: 0; margin: 0; }
  body.is-playing .spell-tier { font-size: 11px; line-height: 1.3; }
  body.is-playing .spell-cost { font-size: 14px; }
  body.is-playing .spell-cost small { font-size: 10px; }
  body.is-playing .spell-preview { position: absolute; z-index: 12; bottom: calc(100% + 8px); left: 0; width: min(620px, 100%); max-height: min(320px, 45dvh); overflow: auto; margin: 0; padding: 10px; border: 1px solid #9ab5c355; background: #0c131ff5; box-shadow: 0 8px 30px #0008; }
  body.is-playing .hand-panel {
    grid-column: 2; grid-row: 3 / 7; min-height: 0; padding: 12px;
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px;
    border: 0; border-left: 1px solid #ddc68c55; border-radius: 0;
    background: linear-gradient(180deg, #171a2099, #090c11);
  }
  body.is-playing .panel-head--hand { min-height: 34px; padding: 0; border: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  body.is-playing .panel-head--hand button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
  body.is-playing .hand-title-row { flex-wrap: wrap; }
  body.is-playing .panel-head--hand .panel-kicker { display: none; }
  body.is-playing .cards {
    grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: stretch;
    min-height: 0; height: 100%; margin: 0; padding: 0; gap: 7px;
    overflow: auto; max-height: none;
  }
  body.is-playing .card { min-width: 0; height: 100%; min-height: 0; padding: 7px; gap: 5px; grid-template-rows: minmax(0, 1fr) 28px; }
  body.is-playing .card-body { grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 5px 6px; align-items: start; }
  body.is-playing .card-copy { display: contents; }
  body.is-playing .card-thumb { grid-column: 1; grid-row: 2; width: 32px; height: 48px; }
  body.is-playing .card-name { grid-column: 1 / -1; grid-row: 1; font-size: 14px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
  body.is-playing .card-copy small { grid-column: 2; grid-row: 2; font-size: 12px; line-height: 1.5; font-weight: 400; color: #d1d2d6; -webkit-line-clamp: 3; }
  body.is-playing .card-actions { margin: 0; gap: 4px; }
  body.is-playing .card-actions button { min-height: 28px; padding: 2px; font-size: 12px; font-weight: 600; }
  body.is-playing .cards .discard-notice { grid-column: 1 / -1; }
  body.is-playing .hand-panel.is-discarding {
    position: fixed; inset: 0; z-index: 35;
    width: min(900px, calc(100vw - 64px)); height: min(480px, calc(100dvh - 64px));
    margin: auto; padding: 20px;
    border: 1px solid var(--gold); border-radius: 8px;
    background: #0c1016;
    box-shadow: 0 0 0 100vmax #030508cc, 0 24px 80px #000b;
  }
  body.is-playing .hand-panel.is-discarding .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto repeat(2, minmax(100px, 1fr));
    overflow: auto;
  }
  body.is-playing .broadcast-callout { bottom: 214px; width: min(520px, 55vw); min-height: 62px; }
  body.is-playing .card-reveal { z-index: 40; }
  body.is-playing .card-activation { z-index: 41; }
}

/* On small screens, choices precede the scenery instead of following a long board. */
@media (max-width: 1023px), (max-height: 599px) {
  body.is-playing .play-column { display: flex; flex-direction: column; gap: 8px; }
  body.is-playing .match-hud { order: 0; }
  body.is-playing .turn-strip { order: 1; margin: 0; }
  body.is-playing .hand-panel { order: 2; }
  body.is-playing .turn-roadmap { order: 3; }
  body.is-playing .villages { order: 4; }
  body.is-playing .actions { display: contents; }
  body.is-playing .spell-panel { order: 5; }
  body.is-playing .divine-board-panel { order: 6; }
  body.is-playing .hand-panel:not(.is-discarding) { min-width: 0; padding: 10px; }
  body.is-playing .panel-head--hand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  body.is-playing .panel-head--hand button { min-height: 40px; padding: 6px 9px; font-size: 12px; }
  body.is-playing .hand-panel:not(.is-discarding) .cards {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(220px, 78vw); grid-template-rows: 206px;
    min-height: 0; max-height: none; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 6px 2px 8px;
    scroll-snap-type: x proximity;
  }
  body.is-playing .hand-panel:not(.is-discarding) .card { height: 206px; min-height: 0; padding: 8px; display: grid; grid-template-rows: minmax(0, 1fr) 40px; gap: 8px; align-content: stretch; scroll-snap-align: start; }
  body.is-playing .hand-panel:not(.is-discarding) .card-body { grid-template-columns: 60px minmax(0, 1fr); align-items: start; gap: 8px; min-height: 0; }
  body.is-playing .hand-panel:not(.is-discarding) .card-thumb { width: 60px; height: 90px; object-fit: contain; }
  body.is-playing .hand-panel:not(.is-discarding) .card-copy { display: grid; gap: 5px; max-height: 100%; overflow: auto; }
  body.is-playing .hand-panel:not(.is-discarding) .card-name { font-size: 13px; line-height: 1.4; }
  body.is-playing .hand-panel:not(.is-discarding) .card-copy small { display: block; font-size: 12px; line-height: 1.5; overflow: visible; }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions button { min-height: 40px; font-size: 12px; }
  body.is-playing .villages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; scroll-margin-top: 8px; }
  body.is-playing .village { min-width: 0; height: 100px; min-height: 0; padding: 6px; display: grid; grid-template-rows: 14px 22px 16px 24px; gap: 2px; align-content: start; }
  body.is-playing .village-target-ribbon, body.is-playing .village-title > small, body.is-playing .village-label-row > small, body.is-playing .village .status-lines, body.is-playing .village-momentum { display: none; }
  body.is-playing .village-label-row { margin: 0; }
  body.is-playing .village-label-row > span { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.is-playing .village-head { display: contents; }
  body.is-playing .village-title { grid-row: 2; }
  body.is-playing .village h3 { margin: 0; font-size: 13px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.is-playing .village .lean { grid-row: 3; position: static; padding: 0; border: 0; background: none; font-size: 10px; line-height: 16px; }
  body.is-playing .village .situation { grid-row: 4; display: block; margin: 0; }
  body.is-playing .village .alive { display: flex; gap: 3px; align-items: center; min-height: 0; height: 24px; padding: 0; background: none; }
  body.is-playing .village .alive strong { font-size: 18px; }
  body.is-playing .village .alive small { font-size: 9px; }
  body.is-playing .village-outcome-ribbon { top: auto; bottom: 0; padding: 3px; min-height: 24px; }
  body.is-playing .village-outcome-ribbon small { display: none; }
  body.is-playing .village-outcome-ribbon strong { font-size: 10px; }
}

@media (min-width: 1024px) and (max-height: 760px) and (min-height: 600px) {
  body.is-playing .game-layout { grid-template-rows: 66px 36px 26px minmax(0, 1fr) 100px 188px; gap: 6px 12px; }
  body.is-playing .match-hud { height: 66px; }
  body.is-playing .match-god-portrait { height: 52px; width: 40px; flex-basis: 40px; }
  body.is-playing .match-god-copy small.match-god-title { display: none; }
  body.is-playing .match-kicker, body.is-playing .turn-progress { display: none; }
  body.is-playing .match-center h2 { font-size: 22px; }
  body.is-playing .broadcast-callout { bottom: 210px; }
}

/* Names, readable body copy, and quiet metadata have distinct visual weights. */
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) {
  body.is-playing .game-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: 66px 36px 26px minmax(0, 1fr) 100px clamp(216px, 30vh, 260px);
  }
  body.is-playing .spell-panel { grid-template-columns: 100px minmax(0, 1fr); }
  body.is-playing .spells { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(58px, 1fr); align-content: stretch; }
  body.is-playing .spell { min-height: 58px; padding: 7px; gap: 4px; }
  body.is-playing .spell-heading { gap: 3px; }
  body.is-playing .spell-heading > strong { font-size: 14px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
  body.is-playing .spell-tier { padding: 1px 3px; font-size: 9px; }
  body.is-playing .spell-cost { padding: 1px 3px; font-size: 12px; }
  body.is-playing .spell-effect { font-size: 11px; line-height: 1.3; }
}
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) and (max-height: 660px) {
  body.is-playing .spells { grid-auto-rows: minmax(52px, 1fr); }
  body.is-playing .spell { min-height: 52px; padding: 5px; gap: 3px; }
  body.is-playing .spell-heading > strong { font-size: 14px; }
  body.is-playing .spell-tier { font-size: 9px; }
  body.is-playing .spell-cost { font-size: 11px; }
  body.is-playing .spell-effect {
    display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    font-size: 11px; line-height: 1.2;
  }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 660px) {
  body.is-playing .app { padding-block: 8px; }
  body.is-playing .game-layout { grid-template-rows: 58px 36px 24px minmax(0, 1fr) 96px 172px; row-gap: 5px; }
  body.is-playing .match-hud { height: 58px; }
  body.is-playing .match-god-portrait { height: 46px; }
  body.is-playing .hand-panel:not(.is-discarding) { padding-block: 8px; gap: 6px; }
  body.is-playing .hand-panel:not(.is-discarding) #drawCard:disabled { display: none; }
  body.is-playing .broadcast-callout { bottom: 192px; }
}

.setup, .game-layout, .result, .day-resolution, #battleLogDialog { letter-spacing: 0; }
.setup-village-pick > span { font-size: 12px; font-weight: 400; line-height: 1.5; }
.setup-village-pick b { font-size: 12px; font-weight: 600; }
.setup-village-detail { font-size: 13px; line-height: 1.5; }
.setup-affinity span { font-variant-numeric: tabular-nums; }
.setup-village-detail .setup-affinity span { font-size: 12px; font-weight: 500; }
.setup-village-detail > small { font-size: 11px; font-weight: 400; line-height: 1.5; }
@media (min-width: 1024px) and (min-height: 600px) {
  .setup[data-phase="god"] .god-title { font-size: 12px; font-weight: 500; }
  .setup[data-phase="god"] .god-choice-details > strong { font-size: 22px; line-height: 1.4; }
  .setup[data-phase="god"] .god-copy { font-size: 13px !important; line-height: 1.6; font-weight: 400; }
  .setup[data-phase="god"] .god-playstyle { font-size: 12px; line-height: 1.6; font-weight: 400; }
  .setup[data-phase="god"] .god-specialties { font-size: 12px; line-height: 1.5; font-weight: 500; }
  .setup[data-phase="god"] .god-spell-tier { font-size: 12px; line-height: 1.5; }
  body.is-playing .village-label-row { font-size: 11px; line-height: 1.3; }
  body.is-playing .village .status-lines { font-size: 12px; line-height: 1.4; font-weight: 400; }
  body.is-playing .village .alive small { font-size: 10px; white-space: nowrap; }
  body.is-playing .momentum-axis { font-size: 10px; font-weight: 400; }
  body.is-playing .panel-kicker, body.is-playing .match-mp > small { font-size: 10px; letter-spacing: 0; }
}

/* Keep the result summary and return commands together on short landscape screens. */
@media (min-width: 600px) and (max-height: 500px) {
  .result { padding: 12px 20px; }
  .result .result-box {
    width: 100%; max-height: calc(100dvh - 24px); padding: 0; gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start;
  }
  .result-heading { grid-column: 1; grid-row: 1; gap: 4px; }
  .result-heading > span { font-size: 10px; }
  .result-heading h2 { font-size: 36px; }
  .result-heading > strong { font-size: 13px; line-height: 1.5; }
  .result-score { gap: 7px; padding: 0; font-size: 10px; }
  .result-score b { font-size: 19px; }
  .result #resultText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .result .result-match-stats { grid-column: 2; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: center; margin: 0; padding: 4px 0; gap: 4px 0; }
  .result-match-stats > span { padding-inline: 8px; gap: 0; }
  .result-match-stats > span:nth-child(odd) { padding-left: 0; }
  .result-match-stats > span:nth-child(even) { border-right: 0; }
  .result-match-stats small { font-size: 10px; }
  .result-match-stats b { font-size: 18px; }
  .result .result-villages { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .result .result-village { padding: 8px; gap: 3px; }
  .result .result-village-name { font-size: 15px; }
  .result-village-winner { font-size: 11px; }
  .result-village > span:not(.result-village-letter), .result-village > small { font-size: 10px; }
  .result .result-actions { grid-column: 1 / -1; grid-row: 3; margin-top: 0; width: 100%; gap: 8px; }
  .result .result-actions button { min-height: 36px; font-size: 12px; }
}

@media (min-width: 701px) and (min-height: 501px) and (max-height: 660px) {
  .result { padding: 14px 24px; }
  .result .result-box {
    max-height: calc(100dvh - 28px); padding: 12px 24px; gap: 9px;
    align-content: start;
  }
  .result-heading { gap: 5px; }
  .result-heading h2 { font-size: 54px; }
  .result-heading > strong { font-size: 16px; }
  .result-score { padding-block: 2px; }
  .result-match-stats { padding-block: 6px; margin-block: 0; }
  .result-match-stats b { font-size: 21px; }
  .result .result-villages { gap: 8px; }
  .result .result-village { gap: 5px; padding: 9px; }
  .result .result-village-name { font-size: 16px; }
  .result-village-winner { font-size: 12px; }
  .result .result-actions { margin-top: 0; gap: 8px; }
  .result .result-actions button { min-height: 40px; font-size: 13px; }
}

/* Each opened verdict is a full-screen scene, not a floating confirmation card. */
.day-resolution {
  isolation: isolate; padding: 24px 40px; overflow: hidden;
  background: #0a0d12; backdrop-filter: none;
  --verdict-color: #e2c68b;
}
.day-resolution.wolf-executed { background: #0a1511; --verdict-color: #9fefc6; }
.day-resolution.human-executed { background: #190c12; --verdict-color: #ffabbc; }
.resolution-backdrop {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; opacity: .58;
}
.resolution-backdrop.hidden { display: none; }
.day-resolution:not(.counting) .resolution-backdrop:not(.hidden) { animation: resolution-backdrop-enter .82s cubic-bezier(.2, .8, .2, 1) both; }
.day-resolution::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #05090fc9, #05090f48 36%, #05090fd9);
  pointer-events: none;
}
.day-resolution .day-resolution-box {
  width: min(1100px, 100%); height: 100%; max-height: calc(100dvh - 48px);
  grid-template-rows: auto auto auto minmax(100px, 1fr) auto auto 46px;
  gap: 14px; padding: 0; overflow: auto;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  align-content: stretch; text-shadow: 0 2px 12px #0009;
}
.day-resolution.wolf-executed .day-resolution-box,
.day-resolution.human-executed .day-resolution-box { border: 0; box-shadow: none; }
.day-resolution .day-resolution-kicker { font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--verdict-color); }
.day-resolution h2 { font-size: 32px; line-height: 1.4; }
.day-resolution .resolution-progress { width: min(700px, 100%); justify-self: center; margin: 0; }
.day-resolution .resolution-progress-step { background: #0a0f1780; border-radius: 3px; }
.day-resolution .resolution-progress-step small { font-size: 12px; font-weight: 500; }
.day-resolution .resolution-progress-step.is-current > i { border-color: var(--verdict-color); color: var(--verdict-color); }
.day-resolution .day-resolution-result {
  min-height: 100px; padding: 16px 0; border: 0; border-radius: 0;
  background: transparent; gap: 10px;
}
.day-resolution .day-resolution-result strong {
  font-size: 52px; line-height: 1.3; color: var(--verdict-color);
  text-shadow: 0 0 22px color-mix(in srgb, var(--verdict-color) 30%, transparent), 0 2px 18px #000c;
}
.day-resolution .day-resolution-result span,
.day-resolution .day-resolution-result small { font-size: 13px; font-weight: 400; color: #d4d8df; }
.day-resolution.counting .day-resolution-result { background: transparent; }
.day-resolution.counting .day-resolution-result strong { font-size: 44px; animation: voteCountingPulse .8s steps(2, end) infinite; }
.day-resolution.already-decided .day-resolution-result { background: transparent; }
.day-resolution blockquote {
  width: min(900px, 100%); justify-self: center; padding: 18px 8px; margin: 0;
  border: 0; border-block: 1px solid #ddc68c40; border-radius: 0;
  background: #060b1270; text-align: center; font-size: 24px; line-height: 1.6;
  font-weight: 400; color: #fff0d6; overflow-wrap: anywhere;
}
.day-resolution .day-resolution-details { gap: 12px; }
.day-resolution :is(#dayResolutionLastWord, #dayResolutionDetails):focus-visible { outline: 1px solid #d8c18b; outline-offset: 2px; }
.day-resolution .resolution-events { font-size: 13px; font-weight: 400; line-height: 1.5; }
.day-resolution .resolution-events span { padding: 0 8px; background: transparent; border: 0; font-size: 13px; font-weight: 400; }
.day-resolution .resolution-population { display: grid; justify-self: center; grid-template-columns: auto auto auto; }
.day-resolution .resolution-population span { border: 0; background: none; padding: 0; }
.day-resolution .resolution-survivors,
.day-resolution .resolution-faction-counts > div { border: 0 !important; border-radius: 0; background: #080d1480; }
.day-resolution .resolution-faction-counts { display: grid; }
.day-resolution .resolution-survivors small,
.day-resolution .resolution-faction-counts small { font-size: 12px; font-weight: 400; }
.day-resolution .resolution-survivors strong,
.day-resolution .resolution-faction-counts strong { font-size: 26px; }
.day-resolution #dayResolutionNext { justify-self: end; min-height: 46px; min-width: 180px; font-size: 14px; border-radius: 4px; }
.day-resolution:not(.counting) .day-resolution-result { animation: verdict-reveal .32s ease-out both; }
.day-resolution:not(.counting) .day-resolution-result strong { animation: verdict-stamp .46s cubic-bezier(.2, .8, .2, 1) both; }
.day-resolution:not(.counting) #dayResolutionLastWord { animation: lastword-reveal .36s ease-out .16s both; }
.day-resolution:not(.counting) .day-resolution-details { animation: lastword-reveal .28s ease-out .3s both; }
@keyframes verdict-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes verdict-stamp {
  from { opacity: 0; transform: translateY(9px) scale(.92); filter: blur(3px); }
  72% { opacity: 1; transform: translateY(-1px) scale(1.025); filter: blur(0); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes lastword-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes resolution-backdrop-enter { from { opacity: 0; transform: scale(1.035); } to { opacity: .58; transform: scale(1); } }
@media (max-height: 660px) and (min-width: 701px) {
  .day-resolution { padding: 16px 32px; }
  .day-resolution .day-resolution-box { max-height: calc(100dvh - 32px); gap: 9px; }
  .day-resolution h2 { font-size: 28px; }
  .day-resolution .day-resolution-result strong { font-size: 44px; }
  .day-resolution blockquote { font-size: 21px; padding-block: 12px; }
}
@media (max-width: 700px) {
  .day-resolution { padding: 16px; }
  .day-resolution .day-resolution-box { height: auto; max-height: calc(100dvh - 32px); gap: 12px; grid-template-rows: auto; }
  .day-resolution h2 { font-size: 24px; }
  .day-resolution .day-resolution-result strong { font-size: 36px; }
  .day-resolution blockquote { font-size: 20px; padding: 14px 6px; }
  .day-resolution .resolution-progress-step small { display: none; }
  .day-resolution .resolution-population { grid-template-columns: auto auto; }
  .day-resolution .resolution-winner { grid-column: 1 / -1; }
  .day-resolution #dayResolutionNext { justify-self: stretch; }
}
@media (min-width: 600px) and (max-height: 500px) {
  .day-resolution { padding: 12px 20px; }
  .day-resolution .day-resolution-box {
    height: 100%; max-height: calc(100dvh - 24px); overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 16px 30px minmax(0, 1fr) auto 40px; gap: 6px 20px;
  }
  .day-resolution .day-resolution-kicker { grid-column: 1; grid-row: 1; font-size: 10px; text-align: left; }
  .day-resolution h2 { grid-column: 1; grid-row: 2; font-size: 22px; text-align: left; }
  .day-resolution .resolution-progress { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 100%; }
  .day-resolution .resolution-progress-step small { display: none; }
  .day-resolution .day-resolution-result { grid-column: 1; grid-row: 3 / 5; min-height: 0; padding: 8px 0; align-content: center; }
  .day-resolution .day-resolution-result strong { font-size: 36px; }
  .day-resolution blockquote { grid-column: 2; grid-row: 3; min-height: 0; padding: 8px 4px; font-size: 18px; overflow: auto; align-self: stretch; align-content: center; }
  .day-resolution .day-resolution-details { grid-column: 2; grid-row: 4; max-height: 110px; overflow: auto; gap: 6px; }
  .day-resolution .resolution-events span { font-size: 11px; }
  .day-resolution .resolution-survivors strong,
  .day-resolution .resolution-faction-counts strong { font-size: 20px; }
  .day-resolution #dayResolutionNext { grid-column: 1 / -1; grid-row: 5; min-height: 40px; height: 40px; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 700px) {
  .setup[data-phase="god"] .god-choices { gap: 6px; }
  .setup[data-phase="god"] .god-choice { padding: 3px; }
  .setup[data-phase="god"] .god-choice .god-stars { display: none; }
  .setup[data-phase="god"] .god-choice .god-choice-details > strong { font-size: 14px; line-height: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
  .day-resolution:not(.counting) .day-resolution-result,
  .day-resolution:not(.counting) .day-resolution-result strong,
  .day-resolution:not(.counting) #dayResolutionLastWord,
  .day-resolution:not(.counting) .day-resolution-details,
  .day-resolution:not(.counting) .resolution-backdrop,
  .day-resolution.counting .day-resolution-result strong { animation: none; }
}

/* Spell tier color is stable across factions; labels keep the tier readable without color. */
.game-layout .spell[data-tier="common"] { --tier-accent: #72d5d0; --tier-wash: #123432; }
.game-layout .spell[data-tier="basic"] { --tier-accent: #74baff; --tier-wash: #142d49; }
.game-layout .spell[data-tier="middle"] { --tier-accent: #f3ce70; --tier-wash: #40351b; }
.game-layout .spell[data-tier="advanced"] { --tier-accent: #ff5c6b; --tier-wash: #451b25; }
.game-layout .spell[data-tier="mythic"] { --tier-accent: #e3eaf4; --tier-wash: #303746; }
.game-layout .spell[data-tier] {
  border-color: color-mix(in srgb, var(--tier-accent) 48%, transparent);
  border-left: 4px solid var(--tier-accent);
  background: linear-gradient(105deg, color-mix(in srgb, var(--tier-accent) 17%, var(--tier-wash)), color-mix(in srgb, var(--tier-wash) 72%, #10131b) 76%);
  box-shadow: inset 0 1px #ffffff0d;
}
.game-layout .spell[data-tier] .spell-tier {
  border-color: color-mix(in srgb, var(--tier-accent) 76%, transparent);
  background: color-mix(in srgb, var(--tier-accent) 18%, #090d13);
  color: var(--tier-accent);
  font-weight: 800;
}
.game-layout .spell[data-tier]:hover:not(:disabled),
.game-layout .spell[data-tier]:focus-visible {
  border-color: color-mix(in srgb, var(--tier-accent) 88%, transparent);
  background: linear-gradient(105deg, color-mix(in srgb, var(--tier-accent) 25%, var(--tier-wash)), color-mix(in srgb, var(--tier-wash) 54%, #171923) 78%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier-accent) 24%, transparent), 0 6px 16px #0006, inset 0 1px #ffffff18;
}
.game-layout .spell[data-tier]:focus-visible { outline-color: var(--tier-accent); }
.game-layout .spell[data-tier]:disabled {
  opacity: .72;
  filter: saturate(.72);
  border-left-color: var(--tier-accent);
}

@media (min-width: 1200px) and (min-height: 700px) {
  .setup[data-phase="god"] .god-selection-preview .god-choice-details {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(6, max-content); gap: 3px 12px; align-content: start;
  }
  .setup[data-phase="god"] .god-selection-preview .god-title { grid-area: 1 / 1; }
  .setup[data-phase="god"] .god-selection-preview .god-choice-details > strong { grid-area: 2 / 1; }
  .setup[data-phase="god"] .god-selection-preview .god-title + strong + .god-stars { grid-area: 1 / 2; }
  .setup[data-phase="god"] .god-selection-preview .god-stars + .god-stars { grid-area: 2 / 2; }
  .setup[data-phase="god"] .god-selection-preview .god-copy { grid-area: 3 / 1 / 4 / 3; min-height: 0; }
  .setup[data-phase="god"] .god-selection-preview .god-specialties:not(.weakness) { grid-area: 4 / 1; }
  .setup[data-phase="god"] .god-selection-preview .god-specialties.weakness { grid-area: 5 / 1; }
  .setup[data-phase="god"] .god-selection-preview .god-playstyle { grid-area: 6 / 1; min-height: 0; }
  .setup[data-phase="god"] .god-selection-preview .god-spells { grid-area: 4 / 2 / 7 / 3; padding-top: 0; }
}
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) and (max-height: 660px) {
  .setup[data-phase="god"] .god-selection-preview .god-choice-details {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(6, max-content); gap: 1px 8px; align-content: start;
  }
  .setup[data-phase="god"] .god-selection-preview .god-title { grid-area: 1 / 1; font-size: 10px; line-height: 1.1; }
  .setup[data-phase="god"] .god-selection-preview .god-choice-details > strong { grid-area: 2 / 1; font-size: 16px; line-height: 1.1; }
  .setup[data-phase="god"] .god-selection-preview .god-title + strong + .god-stars { grid-area: 1 / 2; font-size: 10px; line-height: 1.1; }
  .setup[data-phase="god"] .god-selection-preview .god-stars + .god-stars { grid-area: 2 / 2; font-size: 10px; line-height: 1.1; }
  .setup[data-phase="god"] .god-selection-preview .god-stars small { font-size: 8px; }
  .setup[data-phase="god"] .god-selection-preview .god-copy {
    grid-area: 3 / 1 / 4 / 3; min-height: 0; font-size: 11px !important; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .setup[data-phase="god"] .god-selection-preview .god-specialties:not(.weakness) { grid-area: 4 / 1; padding-block: 0; font-size: 11px; }
  .setup[data-phase="god"] .god-selection-preview .god-specialties.weakness { grid-area: 5 / 1; padding-block: 0; font-size: 11px; }
  .setup[data-phase="god"] .god-selection-preview .god-specialties { gap: 0; }
  .setup[data-phase="god"] .god-selection-preview .god-playstyle {
    grid-area: 6 / 1; min-height: 0; font-size: 11px; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .setup[data-phase="god"] .god-selection-preview .god-spells { grid-area: 4 / 2 / 7 / 3; padding-top: 0; gap: 1px; }
  .setup[data-phase="god"] .god-selection-preview .god-spell-tier {
    grid-template-columns: 42px repeat(2, minmax(0, 1fr)); gap: 3px; font-size: 10px; line-height: 1.2;
  }
  .setup[data-phase="god"] .god-selection-preview .god-spell-tier b,
  .setup[data-phase="god"] .god-selection-preview .god-spell-tier span { font-size: 10px; line-height: 1.2; }
}

/* The archive has a persistent navigation rail and independently scrollable records. */
.archive-panel { padding: 24px 32px; background: #090d14; }
.archive-modal {
  width: min(1440px, 100%); height: 100%; max-height: none; overflow: hidden;
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr); gap: 18px 24px;
  padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
.archive-head { grid-column: 1 / -1; margin: 0; border-bottom: 1px solid #d8bd7938; padding-bottom: 12px; }
.archive-head span { color: #adbacb; font-size: 12px; font-weight: 400; line-height: 1.5; }
.archive-head strong { font-size: 28px; line-height: 1.4; }
.archive-head button { min-height: 40px; padding: 6px 18px; }
.archive-tabs { margin: 0; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 8px; align-self: start; }
.archive-tabs button { min-height: 48px; border: 0; border-left: 2px solid transparent; border-radius: 0; background: transparent; text-align: left; padding: 10px 14px; font-size: 15px; font-weight: 500; }
.archive-tabs button.active { border-left-color: #e4c980; color: #ffe4a6; background: #dbc38112; }
.archive-content { min-width: 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #8b7952 #101620; }
.archive-panel:is([data-view="gods"], [data-view="villages"]) .archive-content { overflow: hidden; }
.archive-browser { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; height: 100%; min-height: 0; }
.archive-browser-list { min-height: 0; overflow: auto; padding-right: 8px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: #8b7952 #101620; }
.archive-list-count { margin: 0 0 8px; font-size: 12px; color: #a5b2c2; line-height: 1.5; }
.archive-entry {
  flex: 0 0 auto; display: flex; gap: 10px; align-items: center;
  padding: 8px; min-height: 68px; width: 100%; border: 1px solid #ffffff14;
  border-radius: 4px; background: #111721; text-align: left;
}
.archive-entry.selected { background: #302b20; border-color: #d8be7866; }
.archive-entry > img { width: 36px; height: 50px; object-fit: cover; object-position: center 12%; border-radius: 2px; }
.archive-entry > span { min-width: 0; display: grid; gap: 4px; }
.archive-entry small { color: #aeb7c6; font-size: 11px; font-weight: 400; }
.archive-entry strong { color: #eae6db; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.archive-entry.selected strong { color: #ffe9b1; }
.archive-entry--village { min-height: 60px; }
.archive-god-detail { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(160px, .85fr) minmax(240px, 1fr); gap: 24px; }
.archive-detail-portrait { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 12%; background: #111620; }
.archive-god-detail.locked .archive-detail-portrait { object-fit: contain; opacity: .35; }
.archive-detail-copy { min-height: 0; min-width: 0; overflow: auto; padding: 4px 8px 16px 0; scrollbar-width: thin; scrollbar-color: #8b7952 #101620; }
.archive-detail-heading small { color: #c5ad74; font-size: 12px; font-weight: 500; }
.archive-detail-heading h3 { margin: 8px 0 14px; color: #f8eacd; font-size: 28px; line-height: 1.4; }
.archive-detail-copy > p { margin: 12px 0; color: #cbd1da; font-size: 14px; line-height: 1.7; font-weight: 400; }
.archive-record-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 0; margin: 18px 0; border-block: 1px solid #ffffff1c; gap: 10px; }
.archive-record-stats > div { display: grid; gap: 6px; }
.archive-record-stats small { color: #aeb7c6; font-size: 12px; font-weight: 400; }
.archive-record-stats strong { color: #eee4c8; font-size: 22px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.archive-unlock-state { display: inline-block; color: #a9d9be; font-size: 12px; padding-bottom: 10px; }
.archive-god-detail.locked .archive-unlock-state { color: #d8a6b3; }
.archive-tactics { display: grid; gap: 8px; margin: 8px 0; font-size: 13px; line-height: 1.5; }
.archive-tactics > div { display: grid; grid-template-columns: 40px minmax(0, 1fr); }
.archive-tactics dt { color: #d8bd7b; }
.archive-tactics dd { margin: 0; color: #d3dae5; }
.archive-spells { gap: 0; }
.archive-spells div { padding: 9px 0; border-radius: 0; border-top: 1px solid #ffffff12; background: transparent; font-size: 13px; line-height: 1.5; }
.archive-spells b { font-size: 11px; font-weight: 500; margin-bottom: 4px; }
.archive-village-detail { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(130px, .7fr) minmax(0, 1fr); gap: 20px; }
.archive-village-scene { position: relative; overflow: hidden; background: linear-gradient(180deg, #17232b, var(--village-mist)); border-bottom: 1px solid var(--village-accent); }
.archive-village-scene .village-scene { inset: 0; width: 100%; height: 100%; opacity: .9; }
.archive-village-scene > span { position: absolute; bottom: 14px; left: 18px; color: #ffedc5; font-size: 14px; text-shadow: 0 2px 6px #000; }
.archive-village-scene > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.archive-village-scene.has-model-preview .village-scene { display: none; }
.archive-village-detail .archive-detail-copy { padding: 0 8px 0 0; }
.archive-village-detail .archive-record-stats { margin: 10px 0; padding: 10px 0; }
.archive-affinity .setup-affinity { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.archive-affinity .setup-affinity span { padding: 10px; font-size: 14px; font-weight: 500; border-radius: 3px; }
.archive-summary { gap: 0; margin-bottom: 24px; border-block: 1px solid #d8bd7940; }
.archive-summary > div { background: transparent; border: 0; border-radius: 0; padding: 18px 14px; }
.archive-summary span { font-size: 13px; font-weight: 400; line-height: 1.5; }
.archive-summary strong { font-size: 30px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.archive-columns section { border-radius: 0; background: transparent; padding: 0 14px; }
.archive-columns h4 { font-size: 16px; border-bottom: 1px solid #ffffff24; padding-bottom: 12px; }
.archive-columns p { font-size: 13px; font-weight: 400; line-height: 1.6; margin: 0; padding: 10px 0; border-bottom: 1px solid #ffffff10; }
.archive-grid { grid-auto-rows: max-content; }
.archive-card { border-radius: 4px; padding: 16px; gap: 10px; }
.archive-card > span { font-size: 12px; font-weight: 500; }
.archive-card p { font-size: 13px; font-weight: 400; line-height: 1.6; }
.achievement-summary { display: flex; align-items: center; gap: 24px; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid #d8bd7938; }
.achievement-summary > div { display: flex; align-items: baseline; gap: 16px; }
.achievement-summary small { color: #bac4d1; font-size: 13px; }
.achievement-summary strong { color: #ffe5a7; font-size: 28px; font-variant-numeric: tabular-nums; }
.achievement-summary strong span { color: #96a1b0; font-size: 16px; font-weight: 400; }
.achievement-summary > progress { width: 160px; }
.achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 4px; }
.achievement-entry {
  min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 5px 12px;
  padding: 12px; border: 1px solid #aab8c826; border-radius: 3px; background: linear-gradient(120deg, #202630, #11161e);
  box-shadow: inset 0 1px #ffffff06;
}
.achievement-seal { grid-column: 1; grid-row: 1 / 4; align-self: center; display: grid; place-items: center; height: 48px; border: 1px solid #99a9bc44; color: #9cabbc; background: #0b1017; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; clip-path: polygon(0 0,100% 0,100% 78%,50% 100%,0 78%); }
.achievement-state { color: #9ca9b9; font-size: 10px; line-height: 1.4; }
.achievement-entry h4 { margin: 0; color: #dce3ec; font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.achievement-progress { display: flex; align-items: center; gap: 8px; min-width: 0; }
.achievement-progress > span { flex: 0 0 auto; color: #aab7c7; font-size: 11px; font-variant-numeric: tabular-nums; }
.achievement-summary progress, .achievement-progress progress { appearance: none; min-width: 0; height: 4px; border: 0; border-radius: 0; background: #ffffff12; accent-color: #d5b96d; }
.achievement-progress progress { width: 100%; flex: 1; }
.achievement-summary progress::-webkit-progress-bar, .achievement-progress progress::-webkit-progress-bar { background: #ffffff12; }
.achievement-summary progress::-webkit-progress-value, .achievement-progress progress::-webkit-progress-value { background: #d5b96d; }
.achievement-summary progress::-moz-progress-bar, .achievement-progress progress::-moz-progress-bar { background: #d5b96d; }
.achievement-entry.is-unlocked { border-color: #d8bc6b77; background: linear-gradient(120deg, #342e20, #181a1d); }
.achievement-entry.is-unlocked .achievement-seal { border-color: #e0c47c; background: #44391f; color: #ffe6a4; }
.achievement-entry.is-unlocked h4, .achievement-entry.is-unlocked .achievement-state { color: #ffe6a4; }
@media (min-width: 1600px) { .achievement-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .achievement-grid { grid-template-columns: 1fr; } .achievement-summary { gap: 12px; } .achievement-summary > progress { width: auto; flex: 1; } .achievement-summary > div { gap: 10px; } }
@media (max-width: 1199px) and (min-width: 701px) {
  .archive-panel { padding: 20px; }
  .archive-modal { grid-template-columns: 116px minmax(0, 1fr); gap: 14px; }
  .archive-browser { grid-template-columns: 170px minmax(0, 1fr); gap: 14px; }
  .archive-god-detail { grid-template-columns: minmax(120px, .7fr) minmax(210px, 1fr); gap: 14px; }
  .archive-detail-heading h3 { font-size: 24px; }
}
@media (max-width: 700px) {
  .archive-panel { padding: 12px; }
  .archive-modal { grid-template-columns: 1fr; grid-template-rows: 62px 42px minmax(0, 1fr); gap: 12px; }
  .archive-tabs { flex-direction: row; align-self: stretch; gap: 0; }
  .archive-tabs button { flex: 1; min-height: 42px; padding: 7px 4px; font-size: 13px; border-left: 0; border-bottom: 2px solid transparent; text-align: center; }
  .archive-tabs button.active { border-bottom-color: #e4c980; }
  .archive-browser { grid-template-columns: 1fr; grid-template-rows: 84px minmax(0, 1fr); gap: 12px; }
  .archive-browser-list { flex-direction: row; overflow: auto; padding: 0 0 6px; gap: 6px; }
  .archive-list-count { display: none; }
  .archive-entry { width: 150px; min-height: 0; padding: 6px; }
  .archive-entry--village { width: 108px; }
  .archive-god-detail { overflow: auto; display: block; }
  .archive-detail-portrait { height: 260px; object-fit: contain; }
  .archive-detail-copy { overflow: visible; padding: 12px 0; }
  .archive-detail-heading h3 { font-size: 24px; }
  .archive-village-detail { overflow: auto; display: block; }
  .archive-village-scene { height: 150px; }
  .archive-affinity .setup-affinity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-summary > div { padding: 12px 8px; }
  .archive-summary strong { font-size: 25px; }
  .archive-columns { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
}

/* Card families share a short ritual but point their energy at different HUD targets. */
.card-activation { --activation-color: #ffe1a0; }
.card-activation--mp { --activation-color: #9ef0cc; }
.card-activation--magic { --activation-color: #a7dfff; }
.card-activation--interference { --activation-color: #ff97b9; }
.card-activation:not(.card-activation--amplify) .card-activation-card { width: min(224px, 68vw); }
.card-activation-copy { gap: 6px; }
.card-activation-copy strong { font-size: 24px; line-height: 1.4; }
.card-activation-copy b { font-size: 14px; line-height: 1.5; font-weight: 500; }
.card-activation-copy span, .card-activation-copy b { color: var(--activation-color); }
.card-activation .card-activation-sigil,
.card-activation .card-activation-sigil::before,
.card-activation .card-activation-sigil::after,
.card-activation .card-activation-sigil i { border-color: color-mix(in srgb, var(--activation-color) 60%, transparent); }
.card-activation .card-activation-ripple { border-color: var(--activation-color); }
.card-activation .card-activation-particles i { background: var(--activation-color); box-shadow: 0 0 10px color-mix(in srgb, var(--activation-color) 80%, transparent); }
.card-activation.is-impact .card-activation-card { border-color: var(--activation-color); box-shadow: 0 0 0 1px var(--activation-color), 0 0 36px color-mix(in srgb, var(--activation-color) 35%, transparent), 0 18px 48px #000a; }
.card-activation--mp .card-activation-sigil { display: none; }
.card-activation--interference .card-activation-sigil::before { border-style: dashed; }
@media (min-width: 600px) and (max-height: 500px) {
  .card-activation-stage { height: calc(100dvh - 24px); }
  .card-activation .card-activation-card,
  .card-activation:not(.card-activation--amplify) .card-activation-card {
    width: auto; height: min(calc(100dvh - 56px), 48vw); max-width: 68vw;
  }
  .card-activation-copy { gap: 3px; padding: 28px 10px 10px; }
  .card-activation-copy strong { font-size: 20px; }
  .card-activation-copy b { font-size: 12px; }
}
.card-activation-transfer {
  position: absolute; z-index: 4; width: 6px; height: 6px; border-radius: 50%;
  background: var(--activation-color); box-shadow: 0 0 12px var(--activation-color);
  opacity: 0; pointer-events: none; animation: card-energy-transfer .24s ease-in both;
}
@keyframes card-energy-transfer {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  12% { opacity: 1; transform: translate(0, 0) scale(1); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--transfer-x), var(--transfer-y)) scale(.6); }
}
.card-feedback-target { --feedback-color: #a7dfff; animation: card-target-receive .42s .12s ease-out both; }
.card-feedback-target[data-card-feedback="mp"] { --feedback-color: #9ef0cc; }
.card-feedback-target[data-card-feedback="amplify"] { --feedback-color: #ffe1a0; }
.card-feedback-target[data-card-feedback="interference"] { --feedback-color: #ff97b9; }
@keyframes card-target-receive {
  0%, 100% { box-shadow: inset 0 0 0 transparent; }
  40% { box-shadow: inset 0 0 18px color-mix(in srgb, var(--feedback-color) 25%, transparent), 0 0 0 1px var(--feedback-color); }
}
@media (prefers-reduced-motion: reduce) {
  .card-activation-transfer { display: none; animation: none; }
  .card-feedback-target { animation: none; outline: 1px solid var(--feedback-color); outline-offset: -2px; }
}

.setup-village-preview { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #131b25; }
.setup-village-preview > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.setup-village-preview .village-scene { width: 100%; height: 100%; inset: 0; }
.setup-village-preview.has-model-preview .village-scene { display: none; }
.village-trait-media { position: relative; height: 160px; min-height: 0; background: #131b25; }
.village-trait-media .setup-village-preview { height: 100%; }
.village-trait-media .setup-village-preview > img { transform: scale(1.3); }
.village-trait-media > div:last-child { position: absolute; top: 10px; left: 12px; display: grid; gap: 4px; text-align: left; pointer-events: none; text-shadow: 0 2px 6px #000; }
.village-trait-media span { color: #d4c08f; font-size: 11px; }
.village-trait-media strong { color: #fff0cd; font-size: 26px; line-height: 1.4; }
.setup-village-pick .setup-village-preview { display: none; }
@media (min-width: 1024px) and (min-height: 600px) {
  .setup[data-phase="reveal"] .village-trait-list { grid-template-rows: minmax(0, 1fr); }
  .setup[data-phase="reveal"] .village-trait-list-title { display: none; }
  .setup[data-phase="reveal"] .village-trait-card {
    grid-template-rows: minmax(100px, 1fr) auto auto auto auto;
    padding: 10px; gap: 8px; align-content: stretch;
  }
  .setup[data-phase="reveal"] .village-trait-media { height: auto; }
  .setup[data-phase="reveal"] .village-trait-card p { min-height: 0; margin: 0; line-height: 1.5; font-weight: 400; }
  .setup[data-phase="reveal"] .village-trait-card > small { min-height: 0; font-weight: 400; line-height: 1.5; }
  .setup[data-phase="reveal"] .setup-affinity { gap: 6px; }
  .setup[data-phase="reveal"] .setup-affinity span { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 6px; line-height: 1.5; font-size: 12px; font-weight: 500; }
  .setup[data-phase="reveal"] .setup-affinity b { display: inline; font-weight: 500; }
  .setup[data-phase="reveal"] .village-winrate-reference { padding: 6px 8px; gap: 3px 8px; }
  .setup[data-phase="reveal"] .village-winrate-reference span { font-size: 22px; line-height: 1.3; }
  .setup[data-phase="reveal"] .village-winrate-reference small { font-size: 10px; line-height: 1.4; }
  .setup[data-phase="god"] .setup-village-pick {
    grid-template-columns: 100px minmax(0, 1fr); grid-template-rows: auto auto auto auto;
    min-height: 96px; padding: 6px; gap: 3px 12px;
  }
  .setup[data-phase="god"] .setup-village-pick .setup-village-preview { display: block; grid-column: 1; grid-row: 1 / 5; }
  .setup[data-phase="god"] .setup-village-pick .setup-village-preview > img { transform: scale(1.8); }
  .setup[data-phase="god"] .setup-village-pick > small,
  .setup[data-phase="god"] .setup-village-pick > strong,
  .setup[data-phase="god"] .setup-village-pick > b,
  .setup[data-phase="god"] .setup-village-pick > span { grid-column: 2; text-align: left; }
  .setup[data-phase="god"] .setup-village-pick > small { font-size: 11px; }
  .setup[data-phase="god"] .setup-village-pick > strong { font-size: 16px; line-height: 1.4; }
  .setup[data-phase="god"] .setup-village-detail-copy p { font-size: 12px; line-height: 1.5; }
  .setup[data-phase="god"] .setup-village-affinity span { font-size: 12px; font-weight: 500; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 660px) {
  .setup[data-phase="reveal"] .village-trait-card { grid-template-rows: minmax(70px, 1fr) auto auto auto auto; gap: 6px; padding: 8px; }
  .setup[data-phase="reveal"] .village-trait-media strong { font-size: 22px; }
  .setup[data-phase="reveal"] .village-trait-media > div:last-child { top: 6px; left: 8px; gap: 2px; }
  .setup[data-phase="reveal"] .setup-affinity span { padding: 4px 6px; }
}
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) {
  .setup[data-phase="god"] .setup-village-pick { grid-template-columns: 72px minmax(0, 1fr); gap: 3px 8px; }
}

/* A brief, skippable duel reveal uses the actual selected gods, without touching match state. */
body:has(#matchIntro:not(.hidden)) { overflow: hidden; }
.match-intro {
  position: fixed; inset: 0; z-index: 44; isolation: isolate; overflow: hidden;
  display: grid; grid-template-rows: 60px minmax(0, 1fr) 72px 44px;
  gap: 18px; padding: 24px 48px; background: #090c13;
  transition: opacity .18s ease;
}
.match-intro.hidden { display: none; }
.match-intro.is-leaving { opacity: 0; }
.match-intro::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #05091080, transparent 26%, #05091055 55%, #050910f5 88%);
}
.intro-portrait { position: absolute; z-index: -2; top: 0; width: 54%; height: 100%; object-fit: cover; object-position: center 12%; opacity: .82; }
.intro-portrait--human { left: 0; mask-image: linear-gradient(90deg, #000 75%, transparent); }
.intro-portrait--wolf { right: 0; mask-image: linear-gradient(270deg, #000 75%, transparent); }
.match-intro h2 { margin: 0; align-self: start; text-align: center; font-size: 26px; line-height: 1.5; font-weight: 700; color: #f5e4bd; text-shadow: 0 2px 14px #000; }
.intro-duel { display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr); gap: 16px; align-items: end; }
.intro-god { min-width: 0; display: grid; gap: 7px; padding: 16px 0; border-bottom: 2px solid #96d6ff70; text-shadow: 0 2px 16px #000; }
.intro-god--wolf { text-align: right; border-color: #ff93b370; }
.intro-god span { color: #d6deeb; font-size: 12px; font-weight: 500; line-height: 1.5; }
.intro-god small { color: #b6e3ff; font-size: 16px; font-weight: 500; line-height: 1.5; }
.intro-god--wolf small { color: #ffb2c7; }
.intro-god strong { color: #fff0d1; font-size: 38px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.intro-versus { align-self: center; display: grid; justify-items: center; gap: 8px; color: #fff0c9; text-shadow: 0 2px 24px #000; }
.intro-versus small { font-size: 12px; line-height: 1.5; font-weight: 500; }
.intro-versus strong { font-size: 72px; line-height: 1; font-weight: 900; }
.intro-villages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-self: center; }
.intro-villages > span { min-width: 0; display: grid; gap: 4px; padding: 0 14px; border-left: 1px solid #cbb47755; }
.intro-villages small { color: #c1b18a; font-size: 11px; font-weight: 500; }
.intro-villages strong { color: #e8e4dc; font-size: 19px; line-height: 1.4; font-weight: 500; overflow-wrap: anywhere; }
#skipMatchIntro { justify-self: end; min-width: 150px; min-height: 44px; padding: 7px 16px; font-size: 14px; border-radius: 4px; border-color: #bba269; background: #171a21d9; }
.match-intro:not(.hidden) .intro-portrait--human { animation: intro-human-enter .42s ease-out both; }
.match-intro:not(.hidden) .intro-portrait--wolf { animation: intro-wolf-enter .42s ease-out both; }
.match-intro:not(.hidden) .intro-versus { animation: intro-versus-enter .36s .12s ease-out both; }
@keyframes intro-human-enter { from { opacity: 0; transform: translateX(-18px); } to { opacity: .82; transform: none; } }
@keyframes intro-wolf-enter { from { opacity: 0; transform: translateX(18px); } to { opacity: .82; transform: none; } }
@keyframes intro-versus-enter { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@media (max-height: 660px) and (min-width: 701px) {
  .match-intro { padding: 16px 32px; grid-template-rows: 50px minmax(0, 1fr) 62px 42px; gap: 12px; }
  .intro-god strong { font-size: 32px; }
}
@media (max-width: 700px) {
  .match-intro { padding: 18px 16px; grid-template-rows: 50px minmax(0, 1fr) 62px 44px; gap: 14px; }
  .match-intro h2 { font-size: 20px; }
  .intro-duel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; position: relative; }
  .intro-versus { position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%); }
  .intro-versus strong { font-size: 48px; }
  .intro-versus small { font-size: 11px; }
  .intro-god strong { font-size: 20px; }
  .intro-god small { font-size: 13px; }
  .intro-god span { font-size: 10px; }
  .intro-villages { gap: 8px; }
  .intro-villages > span { padding-left: 8px; padding-right: 0; }
  .intro-villages strong { font-size: 14px; }
  .match-intro:not(.hidden) .intro-versus { animation: none; }
}
@media (max-width: 380px) { .intro-god strong { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) {
  .match-intro { transition: none; }
  .match-intro:not(.hidden) .intro-portrait,
  .match-intro:not(.hidden) .intro-versus { animation: none; }
}

/* God awakenings are full-screen moments; achievements remain non-blocking records. */
body:has(#unlockFlash[data-kind="god"]:not(.hidden)) { overflow: hidden; }
.unlock-flash[data-kind="god"] {
  isolation: isolate; place-items: center start; padding: 32px 56px;
  background: #0a0e16; animation: none;
}
.unlock-flash[data-kind="god"]::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, #070b13f5, #070b1390 45%, #070b1320), repeating-linear-gradient(0deg, transparent 0 5px, #ffffff05 5px 6px);
}
.unlock-portrait {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%; opacity: .8;
  mask-image: linear-gradient(90deg, transparent, #000 50%);
}
.unlock-flash[data-kind="god"] .unlock-box {
  min-width: 0; width: min(660px, 58%); padding: 24px 0; gap: 16px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  text-align: left; animation: awakening-enter .42s ease-out both;
}
.unlock-flash[data-kind="god"] .unlock-box > span { color: #dac187; font-size: 13px; font-weight: 500; line-height: 1.5; }
.unlock-flash[data-kind="god"] .unlock-box strong { color: #fff0c7; font-size: 44px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; text-shadow: 0 0 28px #cfac5130; }
.unlock-flash[data-kind="god"] .unlock-box strong > small { display: block; font-size: 18px; line-height: 1.5; font-weight: 500; color: #d4bd84; margin-bottom: 8px; }
.unlock-flash[data-kind="god"] .unlock-box strong > span { display: block; font-size: inherit; font-weight: inherit; line-height: inherit; color: inherit; white-space: nowrap; }
.unlock-description { margin: 0; color: #d2d9e4; font-size: 15px; font-weight: 400; line-height: 1.7; }
.unlock-description:empty { display: none; }
.unlock-flash[data-kind="god"] .unlock-box b { color: #d6bd81; font-size: 16px; font-weight: 500; border-top: 1px solid #d6bd8160; padding-top: 16px; }
.unlock-flash[data-kind="god"] .unlock-dismiss { justify-self: start; min-width: 160px; min-height: 44px; margin-top: 12px; padding: 8px 18px; font-size: 14px; border-color: #c7ad72; border-radius: 4px; }
.unlock-flash[data-kind="achievement"] { padding: 20px; place-items: end; background: transparent; animation: none; pointer-events: none; }
.unlock-flash[data-kind="achievement"] .unlock-box {
  position: relative; min-width: 0; width: min(440px, calc(100vw - 40px));
  gap: 6px; padding: 18px 42px 18px 18px; border: 1px solid #d2b67070;
  border-left: 3px solid #dcc380; border-radius: 4px; background: #101722f5;
  box-shadow: 0 10px 32px #0008; text-align: left;
  animation: awakening-enter .3s ease-out both;
}
.unlock-flash[data-kind="achievement"] .unlock-box > span { color: #c2b38f; font-size: 11px; font-weight: 400; line-height: 1.5; }
.unlock-flash[data-kind="achievement"] .unlock-box strong { color: #eee5d2; font-size: 19px; line-height: 1.5; font-weight: 600; }
.unlock-flash[data-kind="achievement"] .unlock-box b { color: #a6dbbf; font-size: 12px; font-weight: 500; }
.unlock-flash[data-kind="achievement"] .unlock-dismiss { position: absolute; top: 10px; right: 8px; width: 30px; min-height: 30px; padding: 0; font-size: 22px; line-height: 1; border: 0; box-shadow: none; background: transparent; pointer-events: auto; }
@keyframes awakening-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .unlock-flash[data-kind="god"] { padding: 24px; place-items: end start; }
  .unlock-portrait { mask-image: linear-gradient(180deg, #000 50%, transparent); object-position: center 12%; }
  .unlock-flash[data-kind="god"]::after { background: linear-gradient(180deg, #070b1330, #070b1380 40%, #070b13f5 68%); }
  .unlock-flash[data-kind="god"] .unlock-box { width: 100%; gap: 12px; }
  .unlock-flash[data-kind="god"] .unlock-box strong { font-size: 28px; }
  .unlock-description { font-size: 14px; }
  .unlock-flash[data-kind="achievement"] { padding: 12px; }
  .unlock-flash[data-kind="achievement"] .unlock-box { width: min(440px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .unlock-flash[data-kind] .unlock-box { animation: none; }
}

.pause-dialog:not([open]) { display: none; }
.pause-dialog[open] {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 24px; border: 0; background: transparent; color: var(--text);
  display: grid; place-items: center; overflow: hidden;
}
.pause-dialog::backdrop { background: #04080de0; backdrop-filter: blur(5px); }
body:has(#pauseDialog[open]) { overflow: hidden; }
.pause-shell {
  width: min(760px, 100%); max-height: calc(100dvh - 48px); overflow: auto;
  padding: 24px 28px; border: 1px solid #b9a57655; border-radius: 6px;
  background: #101720; box-shadow: 0 20px 72px #000a; overscroll-behavior: contain;
}
.pause-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pause-header h2 { margin: 0; font-size: 28px; line-height: 1.4; color: #f1dfb7; }
.pause-header button { width: 40px; min-height: 40px; padding: 0; font-size: 24px; border: 0; background: transparent; box-shadow: none; }
.pause-status { margin: 12px 0 18px; font-size: 13px; line-height: 1.6; color: #b6c2d2; font-weight: 400; }
#pauseControls.hidden, #pauseExitConfirm.hidden { display: none; }
.pause-settings { border-block: 1px solid #ffffff20; margin-bottom: 22px; }
.pause-settings > label { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; border-bottom: 1px solid #ffffff10; padding: 10px 4px; font-size: 15px; font-weight: 500; }
.pause-settings > label:last-child { border-bottom: 0; }
.pause-settings input {
  appearance: none; position: relative; flex: 0 0 auto; width: 40px; min-width: 40px; height: 24px; margin: 0;
  border: 1px solid #738096; border-radius: 12px; background: #242e3c; cursor: pointer;
}
.pause-settings input::before { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: #b9c5d5; transition: transform .12s ease; }
.pause-settings input:checked { background: #4a4028; border-color: #d9c17c; }
.pause-settings input:checked::before { transform: translateX(16px); background: #f0db9f; }
.pause-settings input:focus-visible { outline: 2px solid #9ad9ff; outline-offset: 3px; }
.pause-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pause-actions button { min-height: 46px; font-size: 14px; border-radius: 4px; }
#resumeMatch { border-color: #c6ae73; background: #343020; color: #ffe7ac; }
.pause-exit {
  width: 100%; min-height: 42px; margin-top: 14px; padding: 8px 12px;
  border: 1px solid #73809655; border-radius: 4px; background: #151d28;
  box-shadow: inset 0 1px #ffffff08; color: #d4dce7; font-size: 13px;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.pause-exit:hover:not(:disabled) { border-color: #a88d58; background: #211e19; color: #ffe5ac; box-shadow: inset 0 1px #ffffff12; }
.pause-exit-confirm h3 { margin: 8px 0 24px; font-size: 20px; line-height: 1.6; font-weight: 500; color: #f0e5cf; }
#confirmExitMatch { border-color: #d0869870; background: #422532; color: #ffbdce; }
@media (max-width: 700px) {
  .pause-dialog[open] { padding: 12px; }
  .pause-shell { max-height: calc(100dvh - 24px); padding: 20px; }
  .pause-header h2 { font-size: 24px; }
  .pause-actions { gap: 8px; }
  .pause-exit-confirm h3 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .pause-settings input::before { transition: none; } }

/* Spell announcements belong to the board, never over the hand or spell controls. */
body.is-playing .divine-board .broadcast-callout {
  position: absolute; left: 50%; bottom: 10px; width: min(560px, calc(100% - 24px));
}
.broadcast-callout[data-tier="advanced"] { border-color: #d8bd80; }
.broadcast-callout[data-blocked="true"] { border-color: #9aa5b3; }
.broadcast-callout[data-blocked="true"] .broadcast-copy > span { color: #ccd3de; }
body.is-playing .divine-board .broadcast-callout[data-tier="mythic"][data-blocked="false"] {
  --invocation-color: #f0d18e;
  width: min(600px, calc(100% - 24px)); min-height: 104px;
  grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 24px 12px 132px;
  border: 0; border-block: 1px solid var(--invocation-color); border-radius: 0;
  background: linear-gradient(100deg, #131a24f0, #0c111bee 60%, #211424f0);
  box-shadow: 0 12px 36px #0008;
}
body.is-playing .divine-board .broadcast-callout--wolf[data-tier="mythic"][data-blocked="false"] { --invocation-color: #f1b1ce; }
.broadcast-callout[data-tier="mythic"][data-blocked="false"] > img {
  position: absolute; inset: 0 auto 0 0; width: 144px; height: 100%;
  object-position: center 15%; border: 0; border-radius: 0;
  mask-image: linear-gradient(90deg, #000 65%, transparent);
}
.broadcast-callout[data-tier="mythic"][data-blocked="false"] .broadcast-copy { position: relative; gap: 5px; }
.broadcast-callout[data-tier="mythic"][data-blocked="false"] .broadcast-copy > span { color: var(--invocation-color); font-size: 11px; font-weight: 500; }
.broadcast-callout[data-tier="mythic"][data-blocked="false"] .broadcast-copy strong { color: #fff1d1; font-size: 28px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; font-weight: 700; }
.broadcast-callout[data-tier="mythic"][data-blocked="false"] .broadcast-copy small { font-size: 12px; line-height: 1.5; font-weight: 400; color: #d0d7e1; }
.broadcast-callout[data-tier="mythic"][data-blocked="false"] > i { display: none; }
@media (max-width: 700px), (max-height: 660px) {
  body.is-playing .divine-board .broadcast-callout[data-tier="mythic"][data-blocked="false"] { min-height: 96px; padding: 10px 14px 10px 104px; }
  .broadcast-callout[data-tier="mythic"][data-blocked="false"] > img { width: 118px; }
  .broadcast-callout[data-tier="mythic"][data-blocked="false"] .broadcast-copy strong { font-size: 22px; }
}

.card-reveal-inner { width: min(320px, 68vw, calc((100dvh - 176px) * 2 / 3)); }
.card-reveal-copy { width: min(420px, 90vw); justify-self: center; gap: 5px; }
.card-reveal-copy p { font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.card-reveal-copy small { font-size: 13px; line-height: 1.55; font-weight: 400; }
.card-reveal-frame { inset: 0; padding: 0; border: 0; }
.card-reveal-frame::after, .card-reveal-frame > span { display: none; }
.card-reveal-frame b { position: absolute; top: -8px; right: 12px; padding: 3px 6px; font-size: 10px; line-height: 1.3; font-weight: 500; background: #101721f5; border-radius: 2px; }
@media (min-width: 600px) and (max-height: 500px) {
  .card-reveal { grid-template-columns: minmax(0, 210px) minmax(0, 320px); gap: 24px; align-items: center; }
  .card-reveal-inner { width: min(210px, calc((100dvh - 48px) * 2 / 3)); justify-self: end; }
  .card-reveal-copy { width: 100%; max-width: none; text-align: left; padding: 12px 16px; }
  .card-reveal-copy p { font-size: 24px; }
  .card-reveal-copy small { font-size: 14px; }
}

/* Desktop offerings read as cards in a hand, rather than rows of descriptive text. */
@media (min-width: 1024px) and (min-height: 600px) {
  body.is-playing .hand-panel:not(.is-discarding) { grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  body.is-playing .hand-panel:not(.is-discarding) .panel-head--hand h3 { font-size: 14px; line-height: 20px; }
  body.is-playing .hand-panel:not(.is-discarding) #drawCard:disabled { display: none; }
  body.is-playing .hand-panel:not(.is-discarding) .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); align-content: stretch;
    gap: 8px; padding: 4px 0 0; overflow: visible;
  }
  body.is-playing .hand-panel:not(.is-discarding) .cards[data-card-count="3"],
  body.is-playing .hand-panel:not(.is-discarding) .cards[data-card-count="4"] { grid-template-rows: repeat(2, minmax(0, 1fr)); }
  body.is-playing .hand-panel:not(.is-discarding) .card {
    position: relative; display: block; padding: 0; border-radius: 4px;
    border: 1px solid #b79e635c; background: #080d13; box-shadow: 0 5px 12px #0008;
    transition: transform .12s ease, border-color .12s ease;
  }
  body.is-playing .hand-panel:not(.is-discarding) .card-body { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: 3px; }
  body.is-playing .hand-panel:not(.is-discarding) .card-thumb {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
    border: 0; border-radius: 0; background: #080d13;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 18%, #000 28%, #000 74%, transparent 84%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, transparent 18%, #000 28%, #000 74%, transparent 84%, transparent 100%);
  }
  body.is-playing .hand-panel:not(.is-discarding) .card-name {
    position: absolute; inset: 0 0 auto; padding: 4px 3px;
    font-size: 12px; line-height: 1.4; font-weight: 600; text-align: center;
    color: #fff1cb; background: #0b1019; border-bottom: 1px solid #b79e6330;
  }
  body.is-playing .hand-panel:not(.is-discarding) .card-copy small {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions { position: absolute; inset: auto 2px 2px; height: 28px; gap: 3px; }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions button { height: 28px; min-height: 28px; padding: 2px; font-size: 11px; background: #0c1725f5; }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions button:disabled { opacity: 1; filter: none; color: #7c8795; border-color: #35404e; background: #0b1019f5; }
  body.is-playing .hand-panel:not(.is-discarding) .card:not(.card--activation-selected):is(:hover, :focus-within) { transform: translateY(-4px); border-color: #e3c78b; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-playing .hand-panel:not(.is-discarding) .card { transition: none; }
  body.is-playing .hand-panel:not(.is-discarding) .card:not(.card--activation-selected):is(:hover, :focus-within) { transform: none; }
}

@media (min-width: 1024px) and (min-height: 600px) {
  body.is-playing .spells:has(> .spell-phase-notice) {
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
  }
  body.is-playing .spell-phase-notice {
    display: grid;
    align-content: center;
    gap: 8px;
    height: 100%;
    min-height: 112px;
    padding: 12px 20px;
    border: 0;
    border-left: 2px solid #74c7ff80;
    border-radius: 0;
    background: linear-gradient(90deg, #15344a72, transparent 76%);
    color: #d9e8f1;
  }
  body.is-playing .spell-phase-notice strong { color: #dff4ff; font-size: 16px; }
  body.is-playing .spell-phase-notice span { max-width: 38em; color: #b9cad7; font-size: 12px; line-height: 1.6; }
}

/* Large capture surfaces need readable commands, not just a larger empty board. */
@media (min-width: 1440px) and (min-height: 900px) {
  .setup[data-phase="god"] .god-selection-preview {
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .setup[data-phase="god"] .god-selection-preview .god-choice-details {
    align-content: center;
  }
  .god-stat-profile {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #d4b97755;
  }
  .god-stat-profile--human { --god-stat-accent: #78c9ff; }
  .god-stat-profile--wolf { --god-stat-accent: #ff8295; }
  .god-stat-profile-head { display: flex; align-items: baseline; justify-content: space-between; }
  .god-stat-profile-head strong { color: #f1d795; font-size: 12px; }
  .god-stat-profile-head small { color: #96a2b3; font-size: 10px; }
  .god-stat-profile-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .god-stat-profile-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; min-width: 0; padding: 8px; border-left: 2px solid color-mix(in srgb, var(--god-stat-accent) 70%, transparent); background: #0b1018b8; }
  .god-stat-profile-item > span { overflow: hidden; color: #c5cfdd; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .god-stat-profile-item > b { color: #f1e5c6; font-size: 11px; font-variant-numeric: tabular-nums; }
  .god-stat-profile-meter { position: relative; grid-column: 1 / -1; display: block; height: 3px; overflow: hidden; background: #ffffff16; }
  .god-stat-profile-meter::after { position: absolute; inset: 0 auto 0 66.67%; width: 1px; background: #f5e5ba; content: ""; }
  .god-stat-profile-meter > i { display: block; width: var(--fill); height: 100%; background: var(--god-stat-accent); }
  .setup[data-phase="menu"] { grid-template-columns: minmax(0, 1fr) 380px minmax(0, 1fr); }
  .setup[data-phase="menu"] .main-menu-start span { font-size: 24px; }
  .setup[data-phase="menu"] .archive-menu { gap: 8px; }
  .setup[data-phase="menu"] .archive-menu button:not(#bgmToggleSetup) { min-width: 76px; min-height: 48px; padding: 10px 12px; font-size: 16px; }
  .setup[data-phase="menu"] .main-menu-record { width: min(360px, 100%); }
  .setup[data-phase="menu"] .main-menu-record b { font-size: 24px; }
  .setup[data-phase="menu"] .main-menu-record span { font-size: 12px; }
  body.is-playing .game-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-rows: 88px 44px 32px minmax(0, 1fr) 124px 252px;
  }
  body.is-playing .match-hud { height: 88px; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr); }
  body.is-playing .match-god-portrait { width: 58px; height: 74px; flex-basis: 58px; }
  body.is-playing .match-god-copy strong { font-size: 24px; }
  body.is-playing .match-center h2 { font-size: 30px; }
  body.is-playing .match-mp b { font-size: 30px; }
  body.is-playing .match-seat { font-size: 12px; }
  body.is-playing .turn-buttons button { font-size: 14px; min-height: 38px; }
  body.is-playing .turn-strip #turnOwner { height: 40px; font-size: 14px; }
  body.is-playing .turn-strip #turnOwner::after { font-size: 14px; }
  body.is-playing .turn-roadmap-step strong { font-size: 14px; }
  body.is-playing .board-village-label { min-width: 132px; max-width: 188px; }
  body.is-playing .board-village-label strong { font-size: 16px; }
  body.is-playing .board-village-label small { font-size: 12px; }
  body.is-playing .village { grid-template-rows: 18px 26px 28px minmax(28px, 1fr); }
  body.is-playing .village h3 { font-size: 19px; }
  body.is-playing .village .alive { font-size: 24px; height: 28px; }
  body.is-playing .village .status-lines { font-size: 12px; }
  body.is-playing .village .alive small, body.is-playing .momentum-axis { font-size: 11px; }
  body.is-playing .spell { min-height: 86px; gap: 8px; }
  body.is-playing .spell-heading > strong { font-size: 18px; }
  body.is-playing .spell-effect { font-size: 15px; }
  body.is-playing .spell-tier { font-size: 12px; }
  body.is-playing .spell-cost { font-size: 18px; }
  body.is-playing .spell-cost small { font-size: 11px; }
  body.is-playing #targetHint { font-size: 14px; }
  body.is-playing .hand-panel:not(.is-discarding) .cards { gap: 12px; }
  body.is-playing .hand-panel:not(.is-discarding) .panel-head--hand h3 { font-size: 16px; }
  body.is-playing .hand-panel:not(.is-discarding) .card-name { font-size: 14px; }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions { height: 32px; }
  body.is-playing .hand-panel:not(.is-discarding) .card-actions button { height: 32px; min-height: 32px; font-size: 13px; }
  body.is-playing .hand-panel:not(.is-discarding) .cards {
    grid-template-rows: repeat(3, minmax(0, min(24vh, 270px)));
    align-content: center;
  }
  body.is-playing .hand-panel:not(.is-discarding) .cards[data-card-count="3"],
  body.is-playing .hand-panel:not(.is-discarding) .cards[data-card-count="4"] {
    grid-template-rows: repeat(2, minmax(0, min(30vh, 300px)));
  }
  body.is-playing .hand-panel:not(.is-discarding) .card { aspect-ratio: 2 / 3; }
  body.is-playing .hand-panel:not(.is-discarding) .card-thumb {
    inset: 0; height: 100%; object-fit: contain;
  }
}
