:root {
  color-scheme: dark;
  --ink: #f0e2bf;
  --muted: #b5a98d;
  --paper: #cdbb8e;
  --black: #17170f;
  --panel: rgba(47, 49, 36, 0.94);
  --panel-strong: rgba(35, 37, 27, 0.98);
  --line: rgba(218, 195, 145, 0.28);
  --gold: #b89246;
  --gold-bright: #e2c477;
  --blue: #547488;
  --blue-bright: #91b8c8;
  --red: #8d493c;
  --red-bright: #d7846c;
  --green: #82936a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1120px;
  min-height: 720px;
  background: #0d0f0e;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    "Noto Serif SC", "Songti SC", "STSong", "Times New Roman", serif;
  background:
    radial-gradient(circle at 50% 20%, rgba(205, 173, 104, 0.14), transparent 38%),
    linear-gradient(rgba(22, 24, 17, 0.64), rgba(20, 20, 14, 0.78)),
    repeating-linear-gradient(
      90deg,
      #443726 0,
      #443726 2px,
      #392e21 2px,
      #392e21 78px,
      #2c241a 79px,
      #2c241a 81px
    );
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(64, 66, 47, 0.98), rgba(37, 39, 29, 0.98));
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  color: var(--gold-bright);
  font: 700 13px/1 system-ui, sans-serif;
}

.brand-mark::first-line {
  transform: rotate(-45deg);
}

.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 10px/1 system-ui, sans-serif;
  letter-spacing: 0.34em;
}

.header-actions,
.selection-actions,
.battle-actions,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.local-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font: 12px/1 system-ui, sans-serif;
}

.ghost-button,
.secondary-button,
.primary-button,
.ready-button,
.roll-button {
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.ghost-button,
.secondary-button {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: rgba(241, 206, 124, 0.62);
  background: rgba(241, 206, 124, 0.07);
}

.primary-button {
  padding: 13px 26px;
  border-color: #cba85f;
  background:
    linear-gradient(180deg, #cfac61, #8e6b31);
  color: #100f0d;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(183, 139, 61, 0.18);
}

.primary-button:hover:not(:disabled),
.ready-button:hover:not(:disabled),
.roll-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#app {
  min-height: calc(100vh - 72px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.selection-screen {
  max-width: 1440px;
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 30px 34px 28px;
}

.selection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.selection-heading h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: 0.06em;
}

.selection-heading p:not(.eyebrow) {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--muted);
  font: 14px/1.7 system-ui, sans-serif;
}

.selection-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.versus {
  position: sticky;
  top: 40px;
  align-self: center;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 230px auto 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  background: #121411;
  font: 800 16px/1 system-ui, sans-serif;
  box-shadow: 0 0 0 8px rgba(214, 173, 88, 0.06);
}

.roster-panel {
  padding: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(55, 58, 42, 0.96), rgba(37, 39, 29, 0.97)),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.02) 8px);
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.18),
    var(--shadow);
  box-shadow: var(--shadow);
}

.roster-panel.player-one {
  border-top: 3px solid var(--blue);
}

.roster-panel.player-two {
  border-top: 3px solid var(--red);
}

.roster-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.roster-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.player-token {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  color: #0e1110;
  font: 800 12px/1 system-ui, sans-serif;
}

.player-one .player-token {
  background: var(--blue-bright);
}

.player-two .player-token {
  background: var(--red-bright);
}

.selected-summary {
  color: var(--muted);
  font: 12px/1 system-ui, sans-serif;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.roster-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: #171a18;
  cursor: pointer;
  aspect-ratio: 2 / 3;
}

.roster-card img,
.battle-card-image img,
.zoom-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.roster-card img {
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.roster-card:hover img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.roster-card.selected {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.player-one .roster-card.selected {
  outline-color: var(--blue-bright);
}

.player-two .roster-card.selected {
  outline-color: var(--red-bright);
}

.rank-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(10, 12, 11, 0.84);
  color: #fff5d8;
  font: 800 11px/1 system-ui, sans-serif;
}

.card-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 7px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.94));
  color: white;
  font: 700 11px/1.3 system-ui, sans-serif;
  text-align: left;
}

.selection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.selection-footer p {
  margin: 0;
  color: var(--muted);
  font: 12px/1.5 system-ui, sans-serif;
}

.battle-screen {
  position: relative;
  min-height: calc(100vh - 72px);
  padding: 20px 24px 22px;
  background:
    linear-gradient(90deg, rgba(70, 111, 134, 0.18), transparent 29%, transparent 71%, rgba(145, 65, 52, 0.18)),
    radial-gradient(ellipse at 50% 48%, rgba(213, 190, 136, 0.18), transparent 36%),
    repeating-radial-gradient(ellipse at 48% 44%, transparent 0 34px, rgba(218, 199, 153, 0.045) 35px 36px),
    linear-gradient(rgba(46, 51, 37, 0.74), rgba(35, 38, 28, 0.82)),
    #303526;
}

.battle-topbar {
  max-width: 1420px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 auto 16px;
}

.battle-topbar h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-align: center;
}

.round-state {
  color: var(--muted);
  font: 12px/1 system-ui, sans-serif;
}

.battle-actions {
  justify-content: flex-end;
}

.battle-grid {
  max-width: 1420px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px minmax(0, 1fr);
  gap: 18px;
  margin: 0 auto;
}

.player-board {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  min-height: 510px;
  padding: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(61, 64, 46, 0.97), rgba(35, 38, 28, 0.98)),
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(255, 255, 255, 0.018) 12px);
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.player-board.p1 {
  border-top: 3px solid var(--blue);
}

.player-board.p2 {
  border-top: 3px solid var(--red);
}

.player-board.attacker {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 2px rgba(241, 206, 124, 0.12),
    var(--shadow);
}

.attacker-ribbon {
  position: absolute;
  top: -12px;
  left: 16px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, #dfc47c, #a9803c);
  color: #19150d;
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.16em;
}

.battle-card {
  min-width: 0;
}

.battle-card-image {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: #141615;
  cursor: zoom-in;
  aspect-ratio: 2 / 3;
}

.battle-card-meta {
  margin-top: 10px;
}

.battle-card-meta h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.battle-card-meta p {
  margin: 5px 0 0;
  color: var(--muted);
  font: 12px/1.5 system-ui, sans-serif;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: #d9cfbe;
  font: 10px/1 system-ui, sans-serif;
}

.skill-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.skill-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.skill-heading h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.ready-state {
  color: var(--muted);
  font: 11px/1 system-ui, sans-serif;
}

.ready-state.locked {
  color: var(--green);
}

.skills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-wrap {
  display: grid;
  gap: 6px;
}

.skill {
  position: relative;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(221, 205, 164, 0.055), rgba(0, 0, 0, 0.08));
  text-align: left;
}

button.skill {
  cursor: pointer;
}

button.skill:hover:not(:disabled) {
  border-color: rgba(241, 206, 124, 0.48);
  background: rgba(241, 206, 124, 0.06);
}

.skill.selected {
  border-color: var(--gold-bright);
  background: rgba(198, 154, 75, 0.13);
  box-shadow: inset 3px 0 0 var(--gold-bright);
}

.skill.triggered {
  z-index: 2;
  border-color: #f0d47f;
  animation: passive-trigger 900ms ease-in-out;
  box-shadow:
    inset 4px 0 0 #f0d47f,
    0 0 0 2px rgba(240, 212, 127, 0.2),
    0 0 28px rgba(240, 194, 82, 0.52);
}

.skill.passive.triggered::after {
  content: "被动触发";
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 3px 7px;
  border: 1px solid #f0d47f;
  background: #4a3b1f;
  color: #fff0b7;
  font: 800 9px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
}

@keyframes passive-trigger {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.025);
  }
  60% {
    transform: scale(1.01);
  }
}

.skill.passive {
  background: rgba(115, 145, 108, 0.06);
}

.skill-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.kind-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--gold-bright);
  font: 800 11px/1 system-ui, sans-serif;
}

.kind-icon.active {
  border-radius: 3px;
}

.kind-icon.special {
  position: relative;
  border-width: 2px;
  border-radius: 0;
  font-size: 0;
}

.kind-icon.special.shape-circle {
  border-radius: 50%;
}

.kind-icon.special.shape-square {
  border-radius: 2px;
}

.kind-icon.special.shape-triangle {
  border: 0;
  isolation: isolate;
}

.kind-icon.special.shape-triangle::before {
  content: "△";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: currentColor;
  font-family: "Times New Roman", "Noto Serif", serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  transform: translate(-50%, -54%) scaleX(1.08);
  z-index: 0;
}

.kind-icon.special .special-icon-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: currentColor;
  font: 800 9px/1 system-ui, sans-serif;
  transform: translateY(0.5px);
}

.kind-icon.special.shape-triangle .special-icon-label {
  font-size: 8px;
  transform: translateY(2px);
}

.kind-icon.passive {
  color: #91b087;
}

.inline-special-icon {
  position: relative;
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1.5px solid currentColor;
  color: var(--gold-bright);
  font-size: 0;
  vertical-align: -3px;
}

.inline-special-icon.shape-circle {
  border-radius: 50%;
}

.inline-special-icon.shape-square {
  border-radius: 1px;
}

.inline-special-icon.shape-triangle {
  border: 0;
  isolation: isolate;
}

.inline-special-icon.shape-triangle::before {
  content: "△";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
  font-family: "Times New Roman", "Noto Serif", serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transform: translate(-50%, -54%) scaleX(1.08);
  z-index: 0;
}

.inline-special-icon .special-icon-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: currentColor;
  font: 800 7px/1 system-ui, sans-serif;
  transform: translateY(0.5px);
}

.inline-special-icon.shape-triangle .special-icon-label {
  font-size: 7px;
  transform: translateY(1.5px);
}

.skill-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uses {
  margin-left: auto;
  color: var(--gold-bright);
  font: 700 11px/1 system-ui, sans-serif;
}

.skill-text {
  display: block;
  color: var(--muted);
  font: 11px/1.45 system-ui, sans-serif;
}

.skill-option {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #151816;
  color: var(--ink);
  font: 11px/1 system-ui, sans-serif;
}

.skill-target {
  border-color: rgba(145, 184, 200, 0.42);
}

.choice-rule {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 196, 119, 0.42);
  background: rgba(184, 146, 70, 0.1);
  color: var(--gold-bright);
  font: 11px/1.35 system-ui, sans-serif;
}

.choice-rule strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.choice-rule span {
  color: var(--muted);
}

.choice-rule .choice-symbol {
  padding: 2px 5px;
  border: 1px solid currentColor;
  color: var(--gold-bright);
  font-size: 9px;
}

.battle-card-meta .damage-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #d8cba9;
}

.damage-preview strong {
  color: var(--gold-bright);
}

.ready-button {
  width: 100%;
  margin-top: auto;
  padding: 12px 14px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.p1 .ready-button.active {
  border-color: var(--blue-bright);
  background: rgba(100, 143, 188, 0.18);
}

.p2 .ready-button.active {
  border-color: var(--red-bright);
  background: rgba(168, 76, 67, 0.18);
}

.center-stage {
  display: flex;
  flex-direction: column;
  min-height: 510px;
  align-items: center;
}

.timer {
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  margin-top: 18px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle, #4b4d38 0 44%, #26281d 46% 64%, #a5813f 66% 68%, #1d1f17 70%);
  box-shadow:
    0 0 0 8px rgba(214, 173, 88, 0.05),
    0 20px 45px rgba(0, 0, 0, 0.34);
}

.timer::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(214, 173, 88, 0.35);
  border-radius: inherit;
}

.timer.reaction {
  border-color: var(--red-bright);
  box-shadow:
    0 0 0 8px rgba(238, 139, 118, 0.07),
    0 20px 45px rgba(0, 0, 0, 0.34);
}

.timer.reaction .timer-number {
  color: var(--red-bright);
}

.timer-number {
  position: relative;
  z-index: 1;
  font: 500 45px/1 "Times New Roman", serif;
}

.timer-label {
  position: absolute;
  bottom: 27px;
  z-index: 1;
  color: var(--muted);
  font: 9px/1 system-ui, sans-serif;
  letter-spacing: 0.2em;
}

.phase-copy {
  margin: 18px 0 0;
  color: var(--gold-bright);
  font-size: 14px;
  text-align: center;
}

.phase-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font: 11px/1.5 system-ui, sans-serif;
  text-align: center;
}

.dice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.die {
  width: 64px;
  height: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent),
    #171a18;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.die.p1-die {
  border-color: rgba(143, 195, 239, 0.56);
}

.die.p2-die {
  border-color: rgba(238, 139, 118, 0.56);
}

.pip {
  width: 9px;
  height: 9px;
  place-self: center;
  border-radius: 50%;
  background: transparent;
}

.p1-die .pip.visible {
  background: var(--blue-bright);
  box-shadow: 0 0 7px rgba(143, 195, 239, 0.45);
}

.p2-die .pip.visible,
.check-die .pip.visible {
  background: var(--red-bright);
  box-shadow: 0 0 7px rgba(238, 139, 118, 0.45);
}

.die-question {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  place-self: center;
  color: var(--muted);
  font: 700 31px/1 "Times New Roman", serif;
}

.die.rolling {
  animation: dice-tumble 650ms linear infinite;
}

.die.settled {
  animation: dice-land 280ms ease-out;
}

@keyframes dice-tumble {
  0% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  35% {
    transform: translateY(-13px) rotateX(150deg) rotateY(95deg) rotateZ(45deg);
  }
  70% {
    transform: translateY(3px) rotateX(290deg) rotateY(225deg) rotateZ(120deg);
  }
  100% {
    transform: translateY(0) rotateX(360deg) rotateY(360deg) rotateZ(180deg);
  }
}

@keyframes dice-land {
  0% {
    transform: translateY(-10px) scale(1.08) rotate(12deg);
  }
  70% {
    transform: translateY(3px) scale(0.97) rotate(-3deg);
  }
  100% {
    transform: none;
  }
}

.damage-score {
  margin-top: 10px;
  color: var(--muted);
  font: 11px/1.5 system-ui, sans-serif;
  text-align: center;
}

.damage-score strong {
  color: var(--gold-bright);
  font-size: 14px;
}

.roll-button {
  width: 160px;
  margin-top: 24px;
  padding: 13px;
  border-color: var(--gold);
  background: linear-gradient(135deg, #7a5b28, #c49b4c);
  color: #11100e;
  font-weight: 800;
}

.reaction-center-message {
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid rgba(238, 139, 118, 0.28);
  color: #d8b3a8;
  background: rgba(168, 76, 67, 0.08);
  font: 10px/1.5 system-ui, sans-serif;
  text-align: center;
}

.dice-check-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 6, 0.68);
  backdrop-filter: blur(9px);
}

.dice-check-card {
  width: 300px;
  padding: 28px;
  border: 1px solid rgba(238, 139, 118, 0.48);
  background:
    radial-gradient(circle at 50% 42%, rgba(168, 76, 67, 0.18), transparent 42%),
    #171a18;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.dice-check-card h2 {
  margin: 0 0 22px;
  font-size: 21px;
}

.dice-check-card .check-die {
  width: 82px;
  height: 82px;
  margin: 0 auto;
  padding: 13px;
}

.dice-check-card p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font: 12px/1.5 system-ui, sans-serif;
}

.manual-roll-button {
  display: block;
  margin: 20px auto 0;
}

.battle-topbar,
.player-board,
.combat-log,
.roster-panel,
.result-card,
.modal {
  border-radius: 1px;
}

.battle-topbar h1,
.skill-heading h3,
.combat-log h3,
.eyebrow {
  font-family: "Arial Narrow", "PingFang SC", system-ui, sans-serif;
  text-transform: uppercase;
}

.player-board::after,
.roster-panel::after {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(224, 200, 145, 0.08);
}

.roster-panel {
  position: relative;
}

.tag {
  background: rgba(17, 18, 13, 0.32);
  border-color: rgba(205, 180, 124, 0.36);
}

.ghost-button,
.secondary-button,
.ready-button,
.roll-button {
  border-radius: 1px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.combat-log {
  max-width: 1420px;
  height: 150px;
  margin: 18px auto 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(34, 36, 27, 0.94), rgba(25, 27, 20, 0.96));
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.32),
    0 12px 30px rgba(0, 0, 0, 0.22);
}

.combat-log h3 {
  margin: 0 0 9px;
  color: var(--gold);
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: 0.18em;
}

.log-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  padding: 3px 0;
  color: #c5bbab;
  font: 11px/1.45 system-ui, sans-serif;
}

.log-index {
  color: #6e695f;
}

.result-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(5, 7, 6, 0.76);
  backdrop-filter: blur(12px);
}

.result-card,
.modal {
  width: min(620px, 90vw);
  border: 1px solid rgba(214, 173, 88, 0.42);
  background:
    linear-gradient(145deg, rgba(214, 173, 88, 0.08), transparent 40%),
    #171a18;
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.62);
}

.result-card {
  width: min(780px, 94vw);
  max-height: calc(100vh - 44px);
  padding: 28px;
  overflow: auto;
  text-align: left;
}

.result-card .result-symbol {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-bright);
  font-size: 32px;
}

.result-card h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.result-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font: 14px/1.7 system-ui, sans-serif;
}

.result-summary {
  display: flex;
  align-items: center;
  gap: 22px;
}

.result-summary .eyebrow {
  margin: 0 0 6px;
}

.result-versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.result-player {
  padding: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.result-player.winner {
  border-color: rgba(214, 173, 88, 0.62);
  background: rgba(214, 173, 88, 0.07);
}

.result-player.p1 .player-token {
  background: var(--blue-bright);
}

.result-player.p2 .player-token {
  background: var(--red-bright);
}

.result-player-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.result-player-heading strong,
.result-player-heading small {
  display: block;
}

.result-player-heading small {
  margin-top: 4px;
  color: var(--muted);
  font: 11px/1.4 system-ui, sans-serif;
}

.result-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}

.result-numbers span {
  padding: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 11px/1.4 system-ui, sans-serif;
}

.result-numbers strong {
  display: block;
  margin-top: 2px;
  color: var(--gold-bright);
  font: 700 21px/1.2 "Times New Roman", serif;
}

.result-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.result-skills span {
  padding: 4px 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: #cec4b4;
  font: 10px/1.3 system-ui, sans-serif;
}

.resolution-report {
  margin-top: 14px;
  padding: 13px 15px;
  border-left: 3px solid var(--gold);
  background: rgba(214, 173, 88, 0.055);
}

.resolution-report h3 {
  margin: 0 0 7px;
  color: var(--gold-bright);
  font-size: 12px;
}

.resolution-report ol {
  max-height: 105px;
  margin: 0;
  padding-left: 20px;
  overflow: auto;
  color: var(--muted);
  font: 11px/1.55 system-ui, sans-serif;
}

.result-actions {
  justify-content: center;
  margin-top: 18px;
}

.modal {
  max-height: calc(100vh - 56px);
  overflow: auto;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #171a18;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.rules-content {
  padding: 22px 26px 28px;
  color: #d4caba;
  font: 13px/1.75 system-ui, sans-serif;
}

.rules-content h3 {
  margin: 20px 0 6px;
  color: var(--gold-bright);
  font-family: inherit;
  font-size: 13px;
}

.rules-content h3:first-child {
  margin-top: 0;
}

.rules-content p,
.rules-content ol,
.rules-content ul {
  margin: 7px 0;
}

.rules-content .draft-note {
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(214, 173, 88, 0.08);
}

.zoom-modal {
  width: auto;
  max-width: min(480px, 88vw);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.zoom-card {
  height: min(82vh, 900px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72);
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid rgba(230, 133, 109, 0.55);
  border-radius: 3px;
  background: #261917;
  color: #ffd5c9;
  font: 12px/1.5 system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-height: 800px) {
  .site-header {
    height: 62px;
  }

  #app,
  .selection-screen,
  .battle-screen {
    min-height: calc(100vh - 62px);
  }

  .player-board,
  .center-stage {
    min-height: 452px;
  }

  .battle-card-image {
    max-height: 300px;
  }

  .combat-log {
    height: 118px;
  }
}

/* 2026-07-30 · 胡桃木多人战场 */

:root {
  --ink: #f2e6cb;
  --muted: #c0ad8f;
  --paper: #e5d7ba;
  --black: #120f0c;
  --panel: rgba(25, 20, 15, 0.92);
  --panel-strong: rgba(17, 14, 11, 0.96);
  --line: rgba(224, 197, 148, 0.3);
  --line-soft: rgba(224, 197, 148, 0.16);
  --gold: #b88a43;
  --gold-bright: #e5c27b;
  --red: #7d2e24;
  --red-bright: #d26a54;
  --green: #9eaf83;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.48);
}

html {
  min-width: 1180px;
  background: #24180f;
}

body {
  color: var(--ink);
  background-color: #2b1d13;
  background-image: url("./assets/walnut-world-table.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(10, 7, 5, 0.2);
}

.grain {
  display: none;
}

.site-header,
#app {
  position: relative;
  z-index: 1;
}

.site-header {
  height: 58px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(222, 190, 135, 0.34);
  background: rgba(17, 14, 11, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
}

body[data-screen="battle"] .site-header {
  display: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: #1d1812;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  color: #9f8d73;
}

#app {
  min-height: calc(100vh - 58px);
}

body[data-screen="battle"] #app {
  min-height: 100vh;
}

.ghost-button,
.secondary-button,
.primary-button,
.ready-button,
.roll-button,
.mode-button,
.target-buttons button,
.direction-buttons button {
  border-radius: 2px;
}

.ghost-button,
.secondary-button {
  border-color: rgba(226, 199, 148, 0.3);
  background: rgba(19, 15, 12, 0.66);
}

.primary-button {
  border-color: #c69a53;
  background: #9b6b2e;
  color: #160f09;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.36),
    0 10px 26px rgba(0, 0, 0, 0.32);
}

.selection-screen {
  width: min(1440px, 100%);
  min-height: calc(100vh - 58px);
  padding: 28px 34px;
}

.selection-heading {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.selection-heading h1 {
  font-size: 36px;
  letter-spacing: 0.1em;
}

.selection-heading p:not(.eyebrow) {
  max-width: 720px;
  color: #cfbea0;
}

.mode-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

body[data-mode="ai-duel"] .player-pick-wrap:nth-child(2) .player-pick-slot,
body[data-mode="ai-duel"] .player-board.p2 {
  box-shadow:
    inset 0 0 0 1px rgba(197, 151, 80, 0.3),
    0 0 26px rgba(131, 83, 34, 0.16);
}

body[data-mode="ai-duel"] .player-board.p2 .ready-state:not(.locked) {
  color: #d8b36e;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  background: rgba(22, 17, 13, 0.7);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.mode-button strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.mode-button span {
  color: var(--muted);
  font: 11px/1 system-ui, sans-serif;
}

.mode-button.selected {
  border-color: var(--gold-bright);
  background: rgba(102, 67, 29, 0.68);
  box-shadow: inset 3px 0 0 var(--gold-bright);
}

.player-pick-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.player-pick-wrap {
  position: relative;
  min-width: 0;
}

.player-pick-slot {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  min-height: 96px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: rgba(18, 14, 11, 0.76);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.player-pick-wrap .player-pick-slot {
  width: 100%;
}

.player-pick-wrap:has(.controller-toggle) .player-pick-slot {
  padding-bottom: 36px;
}

.controller-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  min-width: 76px;
  min-height: 22px;
  padding: 3px 9px;
  border: 1px solid rgba(216, 183, 126, 0.36);
  border-radius: 999px;
  background: rgba(18, 14, 11, 0.9);
  color: #cbb998;
  cursor: pointer;
  font: 10px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
}

.controller-toggle.ai {
  border-color: #d1a75e;
  background: rgba(110, 72, 30, 0.9);
  color: #f1d79d;
}

.player-pick-wrap.ai-controlled .player-pick-slot {
  border-color: rgba(209, 167, 94, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(197, 151, 80, 0.18),
    0 0 18px rgba(131, 83, 34, 0.12);
}

.player-pick-slot img {
  grid-row: 1 / 4;
  width: 54px;
  height: 76px;
  object-fit: cover;
  border: 1px solid rgba(242, 225, 193, 0.26);
}

.player-pick-slot span,
.player-pick-slot strong,
.player-pick-slot small {
  align-self: center;
}

.player-pick-slot span {
  color: var(--gold-bright);
  font: 10px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
}

.player-pick-slot strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-pick-slot small {
  color: var(--muted);
  font: 10px/1 system-ui, sans-serif;
}

.player-pick-slot.active {
  border-color: var(--gold-bright);
  box-shadow:
    inset 0 0 0 1px rgba(229, 194, 123, 0.28),
    0 0 20px rgba(176, 121, 45, 0.14);
}

.roster-gallery {
  margin-top: 14px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(15, 12, 10, 0.58);
}

.roster-gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.roster-gallery-heading div {
  display: grid;
  gap: 4px;
}

.roster-gallery-heading span {
  color: var(--muted);
  font: 11px/1 system-ui, sans-serif;
}

.roster-gallery-heading strong {
  color: var(--gold-bright);
  font-size: 15px;
}

.roster-gallery .card-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 9px;
}

.roster-card {
  border-color: rgba(236, 217, 181, 0.22);
  border-radius: 4px;
  background: #17110d;
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.3);
  aspect-ratio: 1013 / 1552;
}

.roster-card img,
.battle-card-image img,
.zoom-card img,
.player-pick-slot img,
.multi-card-image img {
  object-fit: contain;
}

.roster-card.selected,
.player-one .roster-card.selected,
.player-two .roster-card.selected {
  outline-color: var(--gold-bright);
}

.selection-footer {
  margin-top: 16px;
}

.battle-screen {
  min-height: 100vh;
  padding: 0 24px 20px;
  background: rgba(18, 12, 8, 0.18);
}

.battle-topbar {
  max-width: none;
  min-height: 58px;
  margin: 0 -24px 14px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(228, 199, 144, 0.32);
  background: rgba(15, 12, 10, 0.88);
}

.round-state,
.mode-state {
  color: #e5d2ae;
  font: 12px/1.3 "Noto Serif SC", "Songti SC", serif;
  letter-spacing: 0.06em;
}

.mode-state {
  margin-right: 10px;
  color: var(--muted);
}

.battle-grid {
  max-width: 1460px;
  grid-template-columns: minmax(0, 1fr) 230px minmax(0, 1fr);
  gap: 20px;
}

.player-board {
  grid-template-columns: minmax(190px, 235px) minmax(260px, 1fr);
  min-height: 560px;
  padding: 12px 8px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(21, 16, 12, 0.3);
  box-shadow: none;
}

.player-board::after {
  display: none;
}

.player-board.p1,
.player-board.p2 {
  border-top: 1px solid var(--line);
}

.player-board.attacker {
  border-color: var(--gold-bright);
  box-shadow:
    inset 0 1px 0 rgba(229, 194, 123, 0.18),
    0 0 30px rgba(188, 130, 49, 0.12);
}

.attacker-ribbon {
  top: -10px;
  left: 8px;
  border: 1px solid #c39a56;
  background: #bc904b;
  color: #21150b;
}

.battle-card-image {
  border-color: rgba(242, 225, 193, 0.4);
  border-radius: 4px;
  background: #1a130e;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.48);
  aspect-ratio: 1013 / 1552;
}

.battle-card-meta h2 {
  font-size: 19px;
  font-weight: 500;
}

.battle-card-meta p {
  color: #c5b293;
}

.skill-column {
  padding: 2px 6px;
}

.skill-heading {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

.skills {
  gap: 0;
}

.skill-wrap {
  gap: 0;
}

.skill {
  padding: 11px 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.skill.passive {
  background: transparent;
}

button.skill:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(112, 72, 29, 0.22);
}

.skill.selected {
  border-color: var(--gold-bright);
  background: rgba(111, 70, 26, 0.34);
  box-shadow: inset 3px 0 0 var(--gold-bright);
}

.skill-top {
  margin-bottom: 4px;
}

.skill-name {
  color: #f0dfc0;
  font-size: 13px;
}

.skill-text {
  color: #baa98e;
  font: 11px/1.5 system-ui, sans-serif;
}

.kind-icon,
.kind-icon.active {
  border-radius: 50%;
}

.kind-icon.special {
  border-width: 1px;
}

.kind-icon.special.shape-square {
  border-radius: 2px;
}

.kind-icon.special.shape-triangle::before {
  font-size: 25px;
  font-weight: 300;
}

.kind-icon.special.shape-triangle .special-icon-label {
  font-size: 8px;
  transform: translateY(1px);
}

.ready-button {
  margin-top: 12px;
  border-color: rgba(226, 199, 148, 0.34);
  background: rgba(21, 16, 12, 0.76);
}

.p1 .ready-button.active,
.p2 .ready-button.active {
  border-color: var(--gold-bright);
  background: rgba(119, 76, 29, 0.54);
}

.center-stage {
  min-height: 560px;
  justify-content: center;
}

.timer {
  width: 108px;
  height: 108px;
  margin-top: 0;
  border: 2px solid #9e7436;
  background: #231c15;
  box-shadow:
    inset 0 0 0 8px #332719,
    inset 0 0 0 10px rgba(216, 179, 108, 0.42),
    0 14px 34px rgba(0, 0, 0, 0.46);
}

.timer::after {
  inset: 13px;
  border-color: rgba(222, 188, 122, 0.38);
}

.timer-number {
  font-size: 40px;
}

.timer-label {
  bottom: 22px;
  color: #c8ad81;
  letter-spacing: 0.08em;
}

.phase-hint {
  max-width: 190px;
  margin-top: 13px;
  color: #bfae92;
}

.dice-row {
  margin-top: 18px;
  align-items: flex-end;
}

.die-player {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.die-owner-label {
  min-width: 58px;
  font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.die-player-one .die-owner-label {
  color: var(--gold-bright);
}

.die-player-two .die-owner-label {
  color: var(--red-bright);
}

.dice-separator {
  align-self: end;
  padding-bottom: 19px;
  color: var(--muted);
  font-weight: 700;
}

.die {
  width: 58px;
  height: 58px;
  padding: 9px;
  border: 1px solid #b5a382;
  border-radius: 9px;
  background: #e2d7bf;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.32),
    0 11px 24px rgba(0, 0, 0, 0.42);
}

.die.p1-die,
.die.p2-die {
  border-color: #b5a382;
}

.p1-die .pip.visible,
.p2-die .pip.visible,
.check-die .pip.visible {
  background: #2c2118;
  box-shadow: none;
}

.die-question {
  color: #4c3b2c;
}

.roll-button {
  width: 210px;
  min-height: 56px;
  margin-top: 20px;
  border: 1px solid #bd8a49;
  background: #69271f;
  color: #f1ddbb;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  box-shadow:
    inset 0 0 0 3px rgba(28, 13, 10, 0.7),
    inset 0 1px 0 rgba(255, 211, 151, 0.26),
    0 13px 26px rgba(0, 0, 0, 0.44);
}

.roll-button:hover:not(:disabled) {
  border-color: #e0b167;
  background: #7b3025;
}

.reaction-center-message {
  background: rgba(64, 22, 17, 0.72);
}

.combat-log {
  max-width: 1460px;
  height: 128px;
  border-color: var(--line-soft);
  background: rgba(15, 12, 10, 0.82);
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.26);
}

.match-order {
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 34px;
  margin: -2px auto 8px;
  color: #c3ad89;
  font: 11px/1 system-ui, sans-serif;
}

.match-order span {
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.match-order strong {
  font-weight: 500;
}

.multiplayer-arena {
  position: relative;
  max-width: 1460px;
  height: 690px;
  margin: 0 auto;
}

.multi-seat {
  position: absolute;
  width: 520px;
  min-height: 278px;
  padding: 7px 8px 9px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(19, 14, 10, 0.46);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.multi-seat-content {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 12px;
}

.multi-player-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  color: #ead8b8;
  font-size: 13px;
}

.multi-player-heading strong {
  color: var(--gold-bright);
  font: 10px/1 system-ui, sans-serif;
}

.multi-player-heading em {
  color: var(--green);
  font: 10px/1 system-ui, sans-serif;
}

.multi-card-image {
  width: 164px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(238, 217, 181, 0.42);
  border-radius: 4px;
  background: #1a130e;
  cursor: zoom-in;
  aspect-ratio: 1013 / 1552;
  box-shadow: 0 14px 25px rgba(0, 0, 0, 0.44);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.multi-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.multi-seat.current .multi-card-image {
  border-color: #f0c66f;
  box-shadow:
    0 0 0 2px rgba(237, 185, 85, 0.68),
    0 0 26px rgba(230, 165, 59, 0.5),
    0 15px 28px rgba(0, 0, 0, 0.5);
}

.multi-seat.target .multi-card-image {
  border-color: #d95f49;
  box-shadow:
    0 0 0 2px rgba(180, 54, 39, 0.78),
    0 0 30px rgba(199, 59, 40, 0.58),
    0 15px 28px rgba(0, 0, 0, 0.5);
}

.multi-seat.legal-target:not(.target) .multi-card-image {
  border-color: rgba(186, 83, 65, 0.7);
  cursor: pointer;
}

.multi-seat.legal-target:not(.target) .multi-card-image:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 18px rgba(171, 69, 51, 0.34),
    0 15px 28px rgba(0, 0, 0, 0.48);
}

.multi-seat.dead {
  opacity: 0.45;
}

.multi-seat.dead .multi-card-image {
  filter: grayscale(1);
}

.multi-seat.team-a {
  border-left: 2px solid rgba(210, 165, 80, 0.5);
}

.multi-seat.team-b {
  border-right: 2px solid rgba(150, 61, 48, 0.62);
}

.multi-skill-list {
  min-width: 0;
}

.multi-skill-list.interactive {
  max-height: 245px;
  overflow: auto;
  padding-right: 3px;
}

.multi-seat.supporting {
  border-color: rgba(229, 194, 123, 0.58);
  box-shadow:
    inset 0 0 28px rgba(177, 126, 52, 0.08),
    0 0 22px rgba(177, 126, 52, 0.08);
}

.support-panel {
  max-height: 245px;
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 3px;
}

.support-panel-title {
  min-height: 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line-soft);
}

.support-panel-title strong {
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 600;
}

.support-panel-title span {
  color: var(--muted);
  font: 9px/1 system-ui, sans-serif;
}

.support-skill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  padding: 7px;
  border: 1px solid rgba(218, 183, 126, 0.22);
  background: rgba(18, 13, 10, 0.68);
}

.support-skill-heading {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.support-skill-heading > span {
  min-width: 0;
}

.support-skill-heading strong,
.support-skill-heading small {
  display: block;
}

.support-skill-heading strong {
  color: #ead9bb;
  font-size: 12px;
}

.support-skill-heading small {
  margin-top: 3px;
  color: #ae9d84;
  font: 9px/1.35 system-ui, sans-serif;
}

.support-skill-heading em {
  color: var(--gold-bright);
  font: 700 10px/1 system-ui, sans-serif;
}

.support-skill .skill-option {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
}

.support-use-button,
.support-finish-button {
  min-height: 34px;
  border: 1px solid rgba(211, 169, 96, 0.48);
  background: #5d3821;
  color: #f0dfbd;
  cursor: pointer;
}

.support-use-button {
  grid-column: 1 / -1;
  width: 100%;
}

.support-use-button:disabled {
  border-color: var(--line-soft);
  background: rgba(27, 21, 16, 0.72);
  color: #776b59;
  cursor: not-allowed;
}

.support-finish-button {
  width: 100%;
  background: rgba(25, 18, 13, 0.82);
}

.multi-card-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
}

.multi-card-name strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-card-name span {
  flex: 0 0 auto;
  color: var(--muted);
  font: 9px/1 system-ui, sans-serif;
}

.multi-skill-summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}

.multi-skill-summary > span {
  min-width: 0;
}

.multi-skill-summary strong,
.multi-skill-summary small {
  display: block;
}

.multi-skill-summary strong {
  overflow: hidden;
  color: #ead9bb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-skill-summary small {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: #ae9d84;
  font: 9px/1.35 system-ui, sans-serif;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.multi-skill-summary em {
  color: var(--gold-bright);
  font: 700 10px/1 system-ui, sans-serif;
}

.multiplayer-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  transform: translate(-50%, -50%);
}

.multiplayer-center .center-stage {
  min-height: 390px;
}

.multi-decision {
  padding: 22px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(18, 13, 10, 0.76);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.multi-decision h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.multi-decision > p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font: 11px/1.55 system-ui, sans-serif;
}

.target-buttons,
.direction-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.target-buttons button,
.direction-buttons button {
  min-height: 42px;
  border: 1px solid rgba(216, 183, 126, 0.34);
  background: #211912;
  color: #dfcfb2;
  cursor: pointer;
}

.target-buttons button.selected,
.direction-buttons button:hover {
  border-color: var(--gold-bright);
  background: #5c3820;
}

.confirm-attack {
  width: 100%;
  margin-top: 14px;
}

.multi-ffa .seat-0 {
  top: 0;
  left: 0;
}

.multi-ffa .seat-1 {
  top: 0;
  right: 0;
}

.multi-ffa .multiplayer-arena {
  height: 810px;
}

.multi-ffa .multiplayer-center {
  top: 112px;
  transform: translateX(-50%);
}

.multi-ffa .seat-2 {
  top: 525px;
  bottom: auto;
  left: 50%;
  width: 680px;
  min-height: 238px;
  transform: translateX(-50%);
}

.multi-ffa .seat-2 .multi-seat-content {
  grid-template-columns: 138px minmax(0, 1fr);
}

.multi-ffa .seat-2 .multi-card-image {
  width: 138px;
}

.multi-ffa .seat-2 .multi-skill-list.interactive {
  max-height: 208px;
}

.multi-team .multi-seat {
  width: 500px;
  min-height: 272px;
}

.multi-team .seat-0 {
  top: 0;
  left: 0;
}

.multi-team .seat-1 {
  top: 0;
  right: 0;
}

.multi-team .seat-2 {
  right: 0;
  bottom: 0;
}

.multi-team .seat-3 {
  bottom: 0;
  left: 0;
}

.multiplayer-screen .combat-log {
  height: 112px;
  margin-top: 12px;
}

.multiplayer-result {
  width: min(720px, 92vw);
}

.zoom-card {
  aspect-ratio: 1013 / 1552;
}

.multi-card-image img {
  object-fit: contain;
}

.team-reaction-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 5, 4, 0.78);
}

.team-reaction-card {
  width: min(560px, 92vw);
  padding: 28px;
  border: 1px solid rgba(213, 175, 111, 0.52);
  background: #19130f;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.team-reaction-card h2 {
  margin: 5px 0 10px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.team-reaction-card > p:not(.eyebrow) {
  margin: 0 auto;
  color: #c6b292;
  font: 12px/1.75 system-ui, sans-serif;
}

.team-reaction-rule {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: #d7c4a3;
  font: 11px/1.5 system-ui, sans-serif;
  text-align: left;
}

.team-reaction-rule strong {
  color: var(--gold-bright);
  white-space: nowrap;
}

.team-reaction-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.team-reaction-actions button {
  min-height: 46px;
}

.result-card,
.modal {
  border-color: rgba(213, 175, 111, 0.5);
  background: #19130f;
}

.dice-check-card {
  background: #1a130f;
}

@media (max-height: 820px) {
  .battle-topbar {
    min-height: 48px;
    margin-bottom: 8px;
  }

  .player-board,
  .center-stage {
    min-height: 480px;
  }

  .battle-card-image {
    max-height: 330px;
  }

  .multiplayer-arena {
    height: 580px;
  }

  .multi-ffa .multiplayer-arena {
    height: 740px;
  }

  .multi-ffa .multiplayer-center {
    top: 78px;
  }

  .multi-ffa .seat-2 {
    top: 478px;
  }

  .multi-seat,
  .multi-team .multi-seat {
    min-height: 238px;
  }

  .multi-card-image {
    width: 138px;
  }

  .multi-seat-content {
    grid-template-columns: 138px minmax(0, 1fr);
  }

  .multi-skill-list.interactive {
    max-height: 205px;
  }

  .multiplayer-screen .combat-log {
    height: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.online-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
