:root {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #e9edf3;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --cold: #3a5fcd;
  --warm: #e07b39;
  --hot: #d1453b;
  --win: #2fa86b;
  --border: #2a2e38;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #1a1d24;
    --muted: #626a7a;
    --border: #e2e5ec;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.app {
  width: 100%;
  max-width: 560px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.6rem; margin: 0; letter-spacing: 0.02em; }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

.lang-switch { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.lang-switch a.active { background: var(--accent); color: white; }

form { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }

input[type="text"] {
  flex: 1;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

button {
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.message { color: var(--muted); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 0.75rem; }
.message.win { color: var(--win); font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; }

.score-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.row-win { background: color-mix(in srgb, var(--win) 15%, transparent); }

footer { margin-top: 2rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
footer a { color: var(--muted); }
