:root {
  color-scheme: dark;
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #0f172a;
  --border: #334155;
  --accent: #22c55e;
  --warn: #f59e0b;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--text);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.hero,
.panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
  margin-bottom: 20px;
}

.status {
  background: #0b1220;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.controls,
.actions,
.history-panel,
.todo-panel {
  padding: 16px;
  margin-bottom: 20px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.row.compact {
  align-items: center;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

input,
button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, #166534, #14532d);
  border-color: #15803d;
}

button.secondary {
  background: #1e293b;
  border-color: var(--border);
}

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

.table-wrap {
  margin-bottom: 20px;
}

.table {
  padding: 20px;
  min-height: 350px;
  background: radial-gradient(circle at center, #14532d, #052e16 65%);
}

.table-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.board {
  min-height: 72px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 16px 0 24px;
}

.card {
  width: 54px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(248, 250, 252, 0.92);
  color: #111827;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
}

.sprite-card {
  width: 72px;
  height: 100px;
  border: none;
  background: transparent;
}

.sprite-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.seat {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
}

.seat.self {
  border-color: var(--accent);
}

.seat.turn {
  box-shadow: 0 0 0 2px var(--warn) inset;
}

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

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #172554;
  color: #bfdbfe;
  font-size: 12px;
}

.cards {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.actions h2,
.history-panel h2,
.todo-panel h2 {
  margin-top: 0;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

#history,
#todo {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.join-button {
  width: 100%;
  margin-top: 10px;
}

.empty {
  color: var(--muted);
}

@media (max-width: 700px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
