:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe8df;
  --text: #1c2220;
  --muted: #5d6964;
  --border: #d6d2c6;
  --accent: #0e6b4e;
  --accent-text: #ffffff;
  --red: #c62828;
  --pass: #2e7d32;
  --dbl: #c62828;
  --rdbl: #1565c0;
  --turn: #fff1bf;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513;
    --surface: #1b211f;
    --surface-2: #252d2a;
    --text: #e6ebe8;
    --muted: #9aa6a0;
    --border: #313a36;
    --accent: #3cbf8e;
    --accent-text: #08130f;
    --red: #ff6e6e;
    --pass: #4caf50;
    --dbl: #ef5350;
    --rdbl: #5c9ded;
    --turn: #3b3518;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111513;
  --surface: #1b211f;
  --surface-2: #252d2a;
  --text: #e6ebe8;
  --muted: #9aa6a0;
  --border: #313a36;
  --accent: #3cbf8e;
  --accent-text: #08130f;
  --red: #ff6e6e;
  --pass: #4caf50;
  --dbl: #ef5350;
  --rdbl: #5c9ded;
  --turn: #3b3518;
  --shadow: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

input[type="text"],
select {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  width: 100%;
}

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

.suit-H,
.suit-D {
  color: var(--red);
}
