:root {
  --bg: #0d1512;
  --panel: #131f1a;
  --accent: #3ddc84;
  --accent-dim: #1f6b45;
  --text: #d7f5e3;
  --muted: #7fa896;
  --border: #26433465;
  font-family: "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--accent-dim);
}

.topbar h1 {
  color: var(--accent);
  letter-spacing: 0.15em;
  font-size: 1.4rem;
  margin: 0;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.hidden { display: none !important; }

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
  margin: 3rem auto;
}

button {
  font-family: inherit;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent-dim);
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 4px;
}

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

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

.menu-btn { text-align: left; font-size: 1rem; padding: 0.8rem 1rem; }

h2 {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 0.4rem;
}

.field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.field label {
  width: 100px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input, .field select {
  font-family: inherit;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem;
  border-radius: 4px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

fieldset {
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  min-width: 0;
  padding: 0.75rem;
}

@media (max-width: 720px) {
  .sides { grid-template-columns: 1fr; }
}

legend {
  color: var(--accent);
  padding: 0 0.4rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

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

tr:hover td { background: var(--panel); cursor: pointer; }

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn.active { border-color: var(--accent); color: var(--accent); }

.tab-panel.hidden { display: none; }

.stat-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.stat-table caption {
  text-align: left;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.stat-table td, .stat-table th {
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
}

.record-line {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.game-box {
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.game-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-nav.hidden { display: none; }

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

.empty-msg { color: var(--muted); font-style: italic; margin: 1rem 0; }
