:root {
  color-scheme: light;
  --bg: #f2f4ef;
  --ink: #202322;
  --muted: #66706c;
  --line: #d7ded7;
  --panel: #ffffff;
  --soft: #f8faf7;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --blue: #2457a6;
  --gold: #a06316;
  --red: #b42318;
  --shadow: 0 18px 48px rgba(28, 39, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
}

button:hover {
  border-color: var(--accent);
}

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

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.danger-button {
  background: #fff5f3;
  border-color: #f0afa8;
  color: var(--red);
  font-weight: 800;
  margin-top: 10px;
}

.danger-button:hover {
  background: #ffe7e3;
  border-color: var(--red);
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.topbar,
.setup-panel,
.room-panel {
  margin: 0 auto;
  max-width: 1200px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill,
.round-badge,
.team-badge {
  background: #e6f1ee;
  border: 1px solid #bddbd5;
  border-radius: 999px;
  color: #0c5d56;
  flex: none;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.mode-grid,
.setup-grid,
.room-panel,
.sidebar,
.table-area,
.player-list,
.seat-board,
.log-list,
.action-area {
  display: grid;
  gap: 14px;
}

.mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.mode-card {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  height: auto;
  padding: 18px;
  text-align: left;
}

.mode-card span {
  font-size: 18px;
  font-weight: 900;
}

.mode-card small {
  color: var(--muted);
  margin-top: 5px;
}

.mode-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.setup-grid {
  grid-template-columns: minmax(0, 1fr);
}

.room-panel {
  grid-template-columns: 330px minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel h2 {
  margin-bottom: 14px;
}

.section-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

.room-code {
  align-items: center;
  background: #111827;
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-size: 42px;
  font-weight: 900;
  height: 96px;
  justify-content: center;
  letter-spacing: 6px;
  margin-bottom: 14px;
  user-select: all;
}

.notice,
.player-item,
.seat-card,
.log-item {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.player-item {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.player-actions { align-items: center; display: flex; gap: 8px; }
.kick-player-button { border-color: #f0afa8; color: #b42318; min-height: 30px; padding: 0 8px; }

.player-name,
.seat-name {
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
}

.player-meta,
.seat-meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  border-radius: 999px;
  color: #fff;
  flex: none;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.tag.online {
  background: var(--accent);
}

.tag.offline {
  background: var(--red);
}

.seat-board {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.score-board {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.score-card {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  padding: 12px;
}

.score-card.leader {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.score-value {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.seat-card {
  display: grid;
  gap: 10px;
  min-height: 142px;
}

.seat-card.current {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.seat-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.role-chip {
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
}

.role-captain {
  background: var(--blue);
}

.role-member {
  background: var(--gold);
}

.seat-empty {
  color: var(--muted);
  font-weight: 800;
}

.play-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.word-panel {
  align-content: center;
  display: grid;
  min-height: 170px;
}

.idiom-value {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  line-height: 1.15;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.idiom-value.hidden-word {
  color: var(--muted);
  font-size: 24px;
}

.log-item {
  display: grid;
  gap: 6px;
}

.log-line {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-title {
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

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

  .topbar,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-grid,
  .room-panel,
  .play-grid {
    grid-template-columns: 1fr;
  }
}
 .spectator-action-note { line-height: 1.6; }
