:root {
  --ink: #1c1712;
  --muted: #655b4e;
  --paper: #f3ead9;
  --paper-strong: #fff8e8;
  --metal: #7a847f;
  --rust: #b84f2d;
  --cargo: #166d71;
  --cargo-dark: #0d474a;
  --gold: #d59b35;
  --danger: #b33b37;
  --good: #1f7a5b;
  --line: rgba(28, 23, 18, 0.16);
  --shadow: 0 24px 70px rgba(28, 23, 18, 0.2);
  color: var(--ink);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(28, 23, 18, 0.07) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(28, 23, 18, 0.05) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 18% 20%, rgba(213, 155, 53, 0.2), transparent 28%),
    linear-gradient(135deg, #efe0c4 0%, #d6c2a2 100%);
}

button {
  border: 0;
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.game-board {
  width: min(1320px, 100%);
  min-height: min(850px, calc(100vh - 48px));
  padding: 22px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.95), rgba(237, 222, 190, 0.94)),
    repeating-linear-gradient(45deg, rgba(28, 23, 18, 0.04) 0 2px, transparent 2px 10px);
  border: 2px solid rgba(28, 23, 18, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(28, 23, 18, 0.13) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.16;
  mix-blend-mode: multiply;
}

.top-bar,
.play-screen,
.start-screen,
.reveal-screen,
.final-screen {
  position: relative;
  z-index: 1;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "SimSun", serif;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.9;
}

h2 {
  margin-bottom: 8px;
  font-family: Georgia, "SimSun", serif;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 8px;
  font-size: 21px;
}

.round-pill {
  min-width: 136px;
  padding: 11px 16px;
  color: var(--paper-strong);
  text-align: center;
  font-weight: 900;
  background: var(--ink);
  border: 2px solid rgba(255, 248, 232, 0.65);
  box-shadow: 6px 6px 0 rgba(184, 79, 45, 0.34);
}

.hidden {
  display: none !important;
}

.start-screen {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: 48px;
}

.container-art {
  height: min(480px, 58vh);
  min-height: 340px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  background: var(--cargo-dark);
  border: 5px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(28, 23, 18, 0.22);
  transform: rotate(-1.2deg);
}

.container-door {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, var(--cargo) 0%, var(--cargo-dark) 100%);
  border-right: 3px solid rgba(28, 23, 18, 0.42);
}

.right-door {
  border-right: 0;
  border-left: 3px solid rgba(255, 248, 232, 0.22);
}

.lock-plate {
  width: 86px;
  height: 120px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(#d7d1c0, #878b82);
  border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 8px rgba(28, 23, 18, 0.1);
}

.start-copy {
  max-width: 520px;
}

.start-copy p:not(.label) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.primary-btn,
.bid-btn,
.pass-btn {
  min-height: 48px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.primary-btn {
  padding: 14px 26px;
  color: var(--paper-strong);
  background: var(--rust);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.primary-btn:hover,
.bid-btn:hover,
.pass-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.primary-btn:active,
.bid-btn:active,
.pass-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.play-screen {
  padding-top: 20px;
}

.auction-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-top {
  min-height: 112px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1fr) minmax(300px, 0.9fr);
  align-items: stretch;
  gap: 14px;
  background: rgba(255, 248, 232, 0.78);
  border: 2px solid var(--line);
}

.stage-title h2 {
  margin-bottom: 0;
}

.clue-strip {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 8px;
}

.clue-chip,
.type-chip {
  padding: 8px 10px;
  color: var(--paper-strong);
  font-size: 13px;
  font-weight: 900;
  background: var(--cargo-dark);
  border: 2px solid rgba(28, 23, 18, 0.35);
}

.type-chip {
  background: var(--gold);
  color: var(--ink);
}

.table-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.table-status div {
  min-height: 78px;
  padding: 10px;
  color: var(--paper-strong);
  background:
    linear-gradient(135deg, rgba(28, 23, 18, 0.94), rgba(28, 23, 18, 0.78)),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 248, 232, 0.08) 10px 12px);
  border: 2px solid rgba(28, 23, 18, 0.75);
}

.table-status span {
  display: block;
  color: rgba(255, 248, 232, 0.66);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.table-status strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.table-arena {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 260px);
  align-items: stretch;
  gap: 16px;
}

.player-panel {
  --seat-accent: var(--rust);
  min-height: 468px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.92), rgba(237, 222, 190, 0.86)),
    linear-gradient(90deg, transparent 0 12px, rgba(28, 23, 18, 0.04) 12px 14px);
  border: 3px solid rgba(28, 23, 18, 0.2);
  box-shadow: 7px 7px 0 rgba(28, 23, 18, 0.12);
}

.player-panel::before {
  content: "";
  height: 6px;
  position: absolute;
  inset: -3px -3px auto;
  background: var(--seat-accent);
}

.player-panel.active {
  border-color: rgba(28, 23, 18, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 1), rgba(242, 231, 205, 0.94)),
    linear-gradient(90deg, transparent 0 12px, rgba(28, 23, 18, 0.04) 12px 14px);
  box-shadow: 9px 9px 0 rgba(213, 155, 53, 0.34);
}

.seat-left,
.seat-right {
  margin-top: 34px;
}

.seat-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.seat-right .seat-header {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.seat-right .player-avatar {
  grid-column: 2;
}

.seat-right .speech-bubble {
  grid-column: 1;
  grid-row: 1;
}

.player-avatar {
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--paper-strong);
  font-family: Georgia, "SimSun", serif;
  font-size: 34px;
  font-weight: 900;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 248, 232, 0.34), transparent 28%),
    linear-gradient(135deg, var(--seat-accent), var(--ink));
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 rgba(28, 23, 18, 0.2);
}

.player-panel.active .player-avatar {
  transform: translateY(-2px);
  box-shadow: 5px 7px 0 rgba(28, 23, 18, 0.28);
}

.speech-bubble {
  min-height: 82px;
  padding: 12px 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  background: var(--paper-strong);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(28, 23, 18, 0.16);
}

.speech-bubble::before {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  left: -10px;
  top: 30px;
  background: inherit;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.seat-right .speech-bubble::before {
  left: auto;
  right: -10px;
  border: 0;
  border-right: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
}

.speech-bubble strong {
  font-size: 22px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.speech-bubble span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.speech-bid {
  background: #fff0bd;
}

.speech-pass {
  background: #f1d7cf;
}

.speech-thinking {
  background: #e9f4ec;
}

.speech-idle {
  background: rgba(255, 248, 232, 0.84);
}

.seat-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 2px solid rgba(28, 23, 18, 0.1);
}

.seat-identity strong {
  display: block;
  font-family: Georgia, "SimSun", serif;
  font-size: 24px;
}

.seat-identity span:not(.turn-badge) {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.identity-compact {
  display: none !important;
}

.turn-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--paper-strong);
  font-size: 12px;
  font-weight: 900;
  background: var(--good);
}

.seat-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seat-ledger div {
  min-width: 0;
  padding: 8px 0;
  border-bottom: 2px solid rgba(28, 23, 18, 0.14);
}

.seat-ledger span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.seat-ledger strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.channel-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.private-clue {
  margin: 0;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  background: rgba(213, 155, 53, 0.14);
  border-left: 4px solid var(--seat-accent);
}

.private-clue span {
  display: inline-block;
  margin-right: 6px;
  color: var(--rust);
  font-size: 11px;
  font-weight: 900;
}

.seat-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.seat-waiting {
  margin-top: auto;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  background: rgba(28, 23, 18, 0.05);
  border: 2px dashed rgba(28, 23, 18, 0.16);
}

.cargo-visual {
  min-height: 468px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(213, 155, 53, 0.18), transparent 33%),
    linear-gradient(180deg, var(--cargo), var(--cargo-dark));
  border: 4px solid var(--ink);
  box-shadow:
    inset 0 0 0 8px rgba(255, 248, 232, 0.08),
    10px 10px 0 rgba(28, 23, 18, 0.18);
}

.container-shell {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  opacity: 0.35;
  pointer-events: none;
}

.rib {
  border-right: 5px solid rgba(255, 248, 232, 0.17);
  background:
    linear-gradient(90deg, rgba(255, 248, 232, 0.13) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
}

.item-grid {
  min-height: 432px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.item-card {
  min-height: 188px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  background: var(--paper-strong);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(28, 23, 18, 0.35);
}

.item-card.hidden-card {
  color: rgba(255, 248, 232, 0.88);
  background:
    linear-gradient(135deg, rgba(28, 23, 18, 0.72), rgba(28, 23, 18, 0.92)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 248, 232, 0.08) 8px 11px);
  border-color: rgba(255, 248, 232, 0.55);
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hidden-card .item-meta {
  color: rgba(255, 248, 232, 0.62);
}

.item-name {
  margin: 14px 0 8px;
  font-size: 25px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.item-value {
  font-size: 31px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.value-negative {
  color: var(--danger);
}

.value-positive {
  color: var(--good);
}

.bid-btn,
.pass-btn {
  min-width: 0;
  padding: 10px 8px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(28, 23, 18, 0.18);
  overflow-wrap: anywhere;
}

.pass-btn {
  color: var(--paper-strong);
  background: var(--danger);
}

.bid-btn small,
.pass-btn small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  opacity: 0.8;
}

.bid-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: 4px 4px 0 rgba(28, 23, 18, 0.1);
}

.bid-btn:disabled:hover {
  transform: none;
  box-shadow: 4px 4px 0 rgba(28, 23, 18, 0.1);
}

.hint-line {
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  color: rgba(255, 248, 232, 0.8);
  line-height: 1.45;
  background: rgba(28, 23, 18, 0.88);
  border: 2px solid var(--ink);
}

.reveal-screen,
.final-screen {
  padding-top: 26px;
}

.reveal-header,
.final-plate {
  padding: 20px;
  background: rgba(255, 248, 232, 0.84);
  border: 2px solid var(--line);
}

.reveal-header p:not(.label) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.reveal-grid {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.revealed-card {
  min-height: 150px;
  padding: 14px;
  background: var(--paper-strong);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(28, 23, 18, 0.17);
}

.revealed-card .item-name {
  font-size: 21px;
}

.bonus-line {
  margin-top: 8px;
  color: var(--rust);
  font-size: 13px;
  font-weight: 900;
}

.score-strip {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.score-box {
  padding: 14px;
  background: rgba(28, 23, 18, 0.86);
  color: var(--paper-strong);
  border: 2px solid var(--ink);
}

.score-box span {
  display: block;
  color: rgba(255, 248, 232, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.score-box strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.final-plate {
  min-height: 640px;
}

.final-scores {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.final-card {
  padding: 18px;
  background: var(--paper-strong);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(28, 23, 18, 0.18);
}

.final-card.winner {
  background: #fff0bd;
  box-shadow: 7px 7px 0 rgba(213, 155, 53, 0.45);
}

.final-card h3 {
  font-family: Georgia, "SimSun", serif;
  font-size: 30px;
}

.history-list {
  margin: 18px 0;
  display: grid;
  gap: 8px;
}

.history-row {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(28, 23, 18, 0.06);
  border-left: 5px solid var(--cargo);
}

.history-row strong {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 12px;
  }

  .game-board {
    min-height: calc(100vh - 24px);
    padding: 14px;
  }

  .start-screen {
    grid-template-columns: 1fr;
  }

  .start-screen {
    min-height: auto;
    padding-top: 18px;
  }

  .container-art {
    height: 280px;
    min-height: 260px;
  }

  .player-panel {
    min-height: auto;
  }

  .stage-top {
    grid-template-columns: 1fr;
  }

  .table-arena {
    grid-template-columns: 1fr;
  }

  .seat-left,
  .seat-right {
    margin-top: 0;
  }

  .seat-right .seat-header {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .seat-right .player-avatar {
    grid-column: 1;
  }

  .seat-right .speech-bubble {
    grid-column: 2;
  }

  .seat-right .speech-bubble::before {
    left: -10px;
    right: auto;
    border: 0;
    border-left: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .clue-strip {
    justify-content: flex-start;
  }

  .reveal-grid,
  .score-strip,
  .final-scores {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 30px;
  }

  .item-grid,
  .table-status,
  .seat-ledger,
  .seat-actions,
  .reveal-grid,
  .score-strip,
  .final-scores {
    grid-template-columns: 1fr;
  }

  .cargo-visual {
    min-height: auto;
  }

  .item-grid {
    min-height: auto;
  }

  .history-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

body[data-phase="auction"] {
  overflow: hidden;
}

body[data-phase="auction"] .app-shell {
  height: 100vh;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

body[data-phase="auction"] .game-board {
  height: calc(100vh - 24px);
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-phase="auction"] .top-bar {
  flex: 0 0 auto;
  gap: 10px;
  padding-bottom: 10px;
}

body[data-phase="auction"] h1 {
  font-size: clamp(36px, 4vw, 54px);
}

body[data-phase="auction"] h2 {
  font-size: clamp(26px, 3vw, 38px);
}

body[data-phase="auction"] .round-pill {
  padding: 9px 14px;
  box-shadow: 4px 4px 0 rgba(184, 79, 45, 0.34);
}

body[data-phase="auction"] .play-screen {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 10px;
}

body[data-phase="auction"] .auction-stage {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

body[data-phase="auction"] .stage-top {
  min-height: 0;
  padding: 10px;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1fr) minmax(280px, 0.9fr);
  align-items: center;
  gap: 10px;
}

body[data-phase="auction"] .stage-title h2 {
  line-height: 1;
}

body[data-phase="auction"] .clue-strip {
  align-content: center;
  gap: 6px;
}

body[data-phase="auction"] .clue-chip,
body[data-phase="auction"] .type-chip {
  padding: 6px 8px;
  font-size: 12px;
}

body[data-phase="auction"] .table-status div {
  min-height: 56px;
  padding: 8px;
}

body[data-phase="auction"] .table-status strong {
  margin-top: 3px;
  font-size: 20px;
}

body[data-phase="auction"] .table-arena {
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 240px);
  gap: 12px;
}

body[data-phase="auction"] .seat-left,
body[data-phase="auction"] .seat-right {
  margin-top: 0;
}

body[data-phase="auction"] .player-panel {
  height: 100%;
  min-height: 0;
  padding: 10px;
  gap: 8px;
  overflow: hidden;
}

body[data-phase="auction"] .seat-header {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 9px;
}

body[data-phase="auction"] .seat-right .seat-header {
  grid-template-columns: minmax(0, 1fr) 56px;
}

body[data-phase="auction"] .player-avatar {
  width: 56px;
  font-size: 27px;
  border-width: 2px;
}

body[data-phase="auction"] .speech-bubble {
  min-height: 64px;
  padding: 8px 10px;
}

body[data-phase="auction"] .speech-bubble::before {
  width: 13px;
  height: 13px;
  left: -8px;
  top: 24px;
}

body[data-phase="auction"] .seat-right .speech-bubble::before {
  left: auto;
  right: -8px;
}

body[data-phase="auction"] .speech-bubble strong {
  font-size: 18px;
}

body[data-phase="auction"] .speech-bubble span {
  margin-top: 4px;
  font-size: 11px;
}

body[data-phase="auction"] .seat-identity {
  padding-top: 5px;
}

body[data-phase="auction"] .seat-identity strong {
  font-size: 20px;
}

body[data-phase="auction"] .seat-identity span:not(.turn-badge) {
  font-size: 12px;
}

body[data-phase="auction"] .seat-ledger {
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-phase="auction"] .seat-ledger div {
  padding: 5px 0;
}

body[data-phase="auction"] .seat-ledger strong {
  font-size: 17px;
}

body[data-phase="auction"] .channel-note {
  display: none;
}

body[data-phase="auction"] .private-clue {
  display: -webkit-box;
  padding: 6px 8px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 11px;
}

body[data-phase="auction"] .seat-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body[data-phase="auction"] .seat-waiting {
  padding: 8px;
  font-size: 12px;
}

body[data-phase="auction"] .cargo-visual {
  height: 100%;
  min-height: 0;
  padding: 12px;
}

body[data-phase="auction"] .item-grid {
  height: 100%;
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body[data-phase="auction"] .item-card {
  min-height: 0;
  padding: 11px;
  box-shadow: 5px 5px 0 rgba(28, 23, 18, 0.28);
}

body[data-phase="auction"] .item-name {
  margin: 8px 0;
  font-size: 22px;
}

body[data-phase="auction"] .item-value {
  font-size: 28px;
}

body[data-phase="auction"] .bid-btn,
body[data-phase="auction"] .pass-btn {
  min-height: 44px;
  padding: 7px 6px;
  box-shadow: 3px 3px 0 rgba(28, 23, 18, 0.18);
}

body[data-phase="auction"] .bid-btn small,
body[data-phase="auction"] .pass-btn small {
  margin-top: 2px;
  font-size: 10px;
}

body[data-phase="auction"] .hint-line {
  min-height: 34px;
  max-height: 40px;
  padding: 7px 10px;
  overflow: hidden;
  font-size: 13px;
}

@media (max-width: 760px) {
  body[data-phase="auction"] .app-shell {
    padding: 6px;
  }

  body[data-phase="auction"] .game-board {
    height: calc(100vh - 12px);
    padding: 8px;
  }

  body[data-phase="auction"] .top-bar {
    flex-direction: row;
    align-items: center;
    padding-bottom: 6px;
  }

  body[data-phase="auction"] .eyebrow {
    display: none;
  }

  body[data-phase="auction"] h1 {
    font-size: 30px;
  }

  body[data-phase="auction"] .round-pill {
    min-width: 90px;
    padding: 7px 8px;
    font-size: 14px;
  }

  body[data-phase="auction"] .play-screen {
    padding-top: 7px;
  }

  body[data-phase="auction"] .auction-stage {
    gap: 7px;
  }

  body[data-phase="auction"] .stage-top {
    grid-template-columns: 1fr;
    padding: 7px;
    gap: 6px;
  }

  body[data-phase="auction"] .stage-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  body[data-phase="auction"] .stage-title .label {
    display: none;
  }

  body[data-phase="auction"] h2 {
    font-size: 24px;
  }

  body[data-phase="auction"] .clue-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-phase="auction"] .clue-chip,
  body[data-phase="auction"] .type-chip {
    min-width: 0;
    padding: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  body[data-phase="auction"] .table-status {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-phase="auction"] .table-status div {
    min-height: 43px;
    padding: 5px;
  }

  body[data-phase="auction"] .table-status span {
    font-size: 10px;
  }

  body[data-phase="auction"] .table-status strong {
    font-size: 15px;
  }

  body[data-phase="auction"] .table-arena {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(148px, 164px) minmax(0, 1fr) minmax(148px, 164px);
    gap: 7px;
  }

  body[data-phase="auction"] .player-panel {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    padding: 7px;
    gap: 5px;
  }

  body[data-phase="auction"] .seat-header,
  body[data-phase="auction"] .seat-right .seat-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
  }

  body[data-phase="auction"] .seat-right .player-avatar {
    grid-column: 1;
  }

  body[data-phase="auction"] .seat-right .speech-bubble {
    grid-column: 2;
  }

  body[data-phase="auction"] .player-avatar {
    width: 44px;
    font-size: 22px;
  }

  body[data-phase="auction"] .speech-bubble {
    min-height: 50px;
    padding: 6px 8px;
  }

  body[data-phase="auction"] .speech-bubble::before,
  body[data-phase="auction"] .seat-right .speech-bubble::before {
    left: -7px;
    right: auto;
    top: 18px;
    width: 11px;
    height: 11px;
    border: 0;
    border-left: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
  }

  body[data-phase="auction"] .speech-bubble strong {
    font-size: 17px;
  }

  body[data-phase="auction"] .speech-bubble span {
    font-size: 10px;
  }

  body[data-phase="auction"] .seat-identity {
    padding-top: 1px;
    border-top: 0;
  }

  body[data-phase="auction"] .seat-identity strong {
    font-size: 16px;
  }

  body[data-phase="auction"] .seat-identity span:not(.turn-badge) {
    font-size: 10px;
  }

  body[data-phase="auction"] .identity-channel {
    display: none !important;
  }

  body[data-phase="auction"] .identity-compact {
    display: block !important;
  }

  body[data-phase="auction"] .turn-badge {
    padding: 4px 6px;
    font-size: 10px;
  }

  body[data-phase="auction"] .seat-ledger {
    display: none;
  }

  body[data-phase="auction"] .channel-note,
  body[data-phase="auction"] .seat-waiting {
    display: none;
  }

  body[data-phase="auction"] .private-clue {
    max-height: 23px;
    padding: 4px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.25;
    border-left-width: 3px;
  }

  body[data-phase="auction"] .private-clue span {
    margin-right: 4px;
    font-size: 9px;
  }

  body[data-phase="auction"] .seat-actions {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 5px;
    margin-top: 0;
  }

  body[data-phase="auction"] .bid-btn,
  body[data-phase="auction"] .pass-btn {
    min-height: 42px;
    padding: 4px 3px;
    font-size: 13px;
    box-shadow: 2px 2px 0 rgba(28, 23, 18, 0.18);
  }

  body[data-phase="auction"] .bid-btn small,
  body[data-phase="auction"] .pass-btn small {
    font-size: 9px;
    line-height: 1.15;
  }

  body[data-phase="auction"] .cargo-visual {
    padding: 7px;
    border-width: 3px;
    box-shadow: inset 0 0 0 5px rgba(255, 248, 232, 0.08);
  }

  body[data-phase="auction"] .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-phase="auction"] .item-card {
    padding: 8px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(28, 23, 18, 0.25);
  }

  body[data-phase="auction"] .item-meta {
    font-size: 10px;
  }

  body[data-phase="auction"] .item-name {
    margin: 5px 0;
    font-size: 18px;
  }

  body[data-phase="auction"] .item-value {
    font-size: 22px;
  }

  body[data-phase="auction"] .hint-line {
    min-height: 31px;
    max-height: 34px;
    padding: 5px 7px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-height: 740px) {
  body[data-phase="auction"] .game-board {
    padding: 8px;
  }

  body[data-phase="auction"] .top-bar {
    padding-bottom: 6px;
  }

  body[data-phase="auction"] .auction-stage {
    gap: 6px;
  }

  body[data-phase="auction"] .stage-top {
    padding: 6px;
  }

  body[data-phase="auction"] .hint-line {
    min-height: 28px;
    max-height: 31px;
    padding: 4px 7px;
  }
}

/* ===== Lobby Screen ===== */

.lobby-screen {
  min-height: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
  padding-top: 20px;
}

.lobby-brand {
  max-width: 480px;
}

.lobby-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.lobby-actions {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lobby-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.lobby-divider::before,
.lobby-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--line);
}

.lobby-join-row {
  display: flex;
  gap: 8px;
}

.lobby-join-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: var(--paper-strong);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  outline: none;
}

.lobby-join-row input:focus {
  box-shadow: 4px 4px 0 var(--gold);
  border-color: var(--gold);
}

.lobby-join-row .join-btn {
  flex: 0 0 auto;
  min-width: 80px;
}

.lobby-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 900;
}

.lobby-reconnect {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

/* ===== Room Screen ===== */

.room-screen {
  padding-top: 18px;
}

.room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}

.room-header h2 {
  margin-bottom: 0;
  font-family: "Trebuchet MS", "Microsoft YaHei", monospace;
  font-size: 42px;
  letter-spacing: 0.18em;
}

.secondary-btn {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 900;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: 2px solid rgba(28, 23, 18, 0.28);
  transition: background 0.16s ease;
}

.secondary-btn:hover {
  background: rgba(28, 23, 18, 0.06);
}

.room-slots {
  margin: 24px 0;
  display: grid;
  grid-template-columns: minmax(200px, 280px) auto minmax(200px, 280px);
  align-items: center;
  gap: 20px;
}

.room-vs {
  color: var(--rust);
  font-family: Georgia, "SimSun", serif;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.room-slot {
  min-height: 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(255, 248, 232, 0.84);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 rgba(28, 23, 18, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.room-slot.my-slot {
  border-color: rgba(28, 23, 18, 0.48);
  box-shadow: 8px 8px 0 rgba(213, 155, 53, 0.28);
}

.room-slot.opponent-ready {
  border-color: var(--good);
  box-shadow: 6px 6px 0 rgba(31, 122, 91, 0.2);
}

.slot-avatar {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--paper-strong);
  font-family: Georgia, "SimSun", serif;
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--rust), var(--ink));
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 4px 0 rgba(28, 23, 18, 0.2);
}

.room-slot:nth-child(3) .slot-avatar {
  background: linear-gradient(135deg, var(--cargo), var(--cargo-dark));
}

.slot-info {
  text-align: center;
}

.slot-info strong {
  display: block;
  font-family: Georgia, "SimSun", serif;
  font-size: 22px;
}

.slot-channel {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.slot-status {
  min-height: 22px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.status-you {
  padding: 3px 8px;
  color: var(--paper-strong);
  font-size: 11px;
  font-weight: 900;
  background: var(--rust);
}

.status-ready {
  padding: 3px 8px;
  color: var(--paper-strong);
  font-size: 11px;
  font-weight: 900;
  background: var(--good);
}

.status-waiting,
.status-empty {
  padding: 3px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  background: rgba(28, 23, 18, 0.06);
  border: 1px dashed rgba(28, 23, 18, 0.14);
}

.status-disconnected {
  padding: 3px 8px;
  color: var(--paper-strong);
  font-size: 11px;
  font-weight: 900;
  background: var(--danger);
}

.ready-toggle {
  display: block;
  min-width: 180px;
  margin: 0 auto;
}

.ready-toggle.ready {
  background: var(--good);
  box-shadow: 6px 6px 0 rgba(31, 122, 91, 0.35);
}

.room-hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

/* ===== Connection Dot ===== */

.connection-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  color: var(--paper-strong);
  background: rgba(28, 23, 18, 0.82);
  border: 1px solid rgba(255, 248, 232, 0.2);
}

.connection-dot .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
  flex: 0 0 auto;
}

.connection-dot.disconnected .dot {
  background: var(--danger);
}

.connection-dot .dot-label {
  color: rgba(255, 248, 232, 0.8);
}

@media (max-width: 760px) {
  .room-slots {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .room-vs {
    font-size: 22px;
    padding: 4px 0;
  }

  .room-slot {
    min-height: auto;
    padding: 16px;
    gap: 8px;
  }

  .slot-avatar {
    width: 60px;
    font-size: 28px;
  }

  .room-header h2 {
    font-size: 32px;
  }

  .lobby-join-row input {
    font-size: 22px;
    padding: 10px 12px;
  }
}
