:root {
  --bg: #0f1720;
  --bg-alt: #16212c;
  --card: #1c2b38;
  --card-border: #2b3d4d;
  --text: #eef3f7;
  --text-dim: #9fb2c2;
  --accent: #4fd1c5;
  --accent-dark: #2fa89c;
  --green: #3ecf8e;
  --yellow: #e8c547;
  --orange: #ef9c4d;
  --red: #e8555f;
  --radius: 14px;
  --maxw: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand .globe { font-size: 1.6rem; }

nav.tabs { display: flex; gap: 8px; }
nav.tabs a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s ease;
}
nav.tabs a:hover { color: var(--text); border-color: var(--card-border); }
nav.tabs a.active { color: var(--bg); background: var(--accent); }

.subtitle { color: var(--text-dim); margin: -8px 0 20px; font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.progress-row strong { color: var(--text); }

.progress-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--card-border);
}
.progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width .3s ease;
}

.vs-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}
.nation {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
}
.nation .flag { display: flex; justify-content: center; margin-bottom: 10px; }
.nation .name { font-weight: 700; font-size: 1rem; line-height: 1.25; }

.flag-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 40px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 2px 6px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.flag-box.flag-emoji { font-size: 1.9rem; background: transparent; box-shadow: none; line-height: 1; }
.flag-box.flag-swatch { font-size: 1.3rem; font-weight: 700; }
.flag-box.flag-fallback {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--card-border);
  color: var(--text-dim);
}
.round-list .flag-box { width: 28px; height: 20px; font-size: 0.95rem; border-radius: 4px; }
.round-list .flag-box.flag-emoji { font-size: 1.1rem; }
.vs-badge {
  align-self: center;
  font-weight: 800;
  color: var(--accent);
  font-size: 0.95rem;
  padding: 0 4px;
}

.hint-box {
  background: rgba(79, 209, 197, 0.08);
  border: 1px dashed var(--accent-dark);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.hint-box strong { color: var(--accent); }

.guess-area { margin-bottom: 8px; }
.guess-year-display {
  text-align: center;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-bottom: 6px;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #08201d;
  transition: transform .1s ease, background .15s ease;
}
.btn:hover { background: #6be1d6; }
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

.feedback {
  text-align: center;
  padding: 6px 0 6px;
}
.feedback .badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
}
.feedback .points {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.feedback .detail { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 16px; }
.feedback .detail b { color: var(--text); }

.results-total {
  text-align: center;
  padding: 10px 0 6px;
}
.results-total .big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
}
.results-total .of { color: var(--text-dim); font-size: 1rem; }

.round-list { list-style: none; padding: 0; margin: 18px 0; }
.round-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9rem;
}
.round-list li:last-child { border-bottom: none; }
.round-list .sq { font-size: 1.1rem; }
.round-list .pair { flex: 1; color: var(--text-dim); }
.round-list .pts { font-weight: 700; }

.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s ease;
}
.archive-item:hover { border-color: var(--accent); }
.archive-item .date-block { display: flex; flex-direction: column; }
.archive-item .date { font-weight: 700; }
.archive-item .daynum { font-size: 0.8rem; color: var(--text-dim); }
.archive-item .status {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
}
.archive-item .status.played { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.archive-item.today { border-color: var(--accent); }
.archive-empty {
  list-style: none;
  text-align: center;
  color: var(--text-dim);
  padding: 28px 16px;
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  font-size: 0.95rem;
}

.footer-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 24px;
}
.footer-note a { color: var(--text-dim); text-decoration: underline; }
.footer-note a:hover { color: var(--accent); }

/* Splash page */
.splash-card { text-align: center; padding: 32px 20px; }
.hero { margin-bottom: 22px; }
.hero-icon { font-size: 3.2rem; line-height: 1; margin-bottom: 10px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero-tagline { color: var(--text-dim); font-size: 1rem; margin: 0; }
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.feature-list strong { color: var(--text); }
.splash-secondary { margin-top: 10px; }

/* Legal / privacy page */
.legal-card { text-align: left; }
.legal-card h1 { font-size: 1.6rem; margin: 0 0 4px; }
.legal-updated { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 20px; }
.legal-card h2 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--accent); }
.legal-card p, .legal-card li { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; }
.legal-card p:first-of-type { margin-top: 0; }
.legal-card ul { padding-left: 20px; margin: 8px 0; }
.legal-card a { color: var(--accent); }
.legal-card code {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.88em;
}
.legal-note { font-style: italic; opacity: 0.8; }

.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #08201d;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 50;
}
.share-toast.show { opacity: 1; }

@media (max-width: 420px) {
  .guess-year-display { font-size: 2.1rem; }
  .results-total .big { font-size: 2.4rem; }
}
