:root {
  --bg: #fbfcff;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --card-2: #f2efe4;
  --text: #14161f;
  --muted: #4e5566;
  --accent: #2f6bd8;
  --correct: #2e7d32;
  --wrong: #c62828;
  --border: #7e89a3;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fbfcff;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Header & Nav ============ */
header.site-header {
  text-align: center;
  padding: 28px 16px 8px;
}

.site-header .brand {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

h1 {
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #14161f;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.15rem);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 6px;
  padding: 0 12px;
}

.site-nav a {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.site-nav a:hover { border-color: var(--accent); text-decoration: none; }
.site-nav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

main { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ============ Scorebar ============ */
.scorebar {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  text-align: center;
  min-width: 92px;
}
.stat .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.stat .value { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }

#daily-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform .1s ease, opacity .2s;
}
#daily-btn:hover { transform: translateY(-1px); }
#daily-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ Game card ============ */
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 20px 28px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.prompt { color: var(--muted); font-size: .95rem; margin-bottom: 4px; }

.flag-wrap {
  width: min(320px, 78vw);
  margin: 10px auto 22px;
  aspect-ratio: 5 / 3.33;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #eef1f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flag-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.option {
  min-height: 52px;
  padding: 12px 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.option:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.option:active:not(:disabled) { transform: translateY(0); }
.option:disabled { cursor: default; }
.option.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.option.wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; }
.option.reveal { background: var(--correct); border-color: var(--correct); color: #fff; }

.feedback { min-height: 26px; margin-top: 16px; font-weight: 700; font-size: 1.05rem; }
.feedback.good { color: #2e7d32; }
.feedback.bad { color: #c62828; }

/* ============ Daily result ============ */
.daily-result { text-align: center; padding: 8px 0 4px; }
.daily-result .big { font-size: 2rem; font-weight: 800; }
#share-btn {
  margin-top: 14px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
}
#share-btn:hover { filter: brightness(0.92); }
#back-btn {
  margin-top: 12px;
  background: var(--card-2);
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  max-width: 240px;
}

.daily-result .daily-emoji {
  font-size: 1.6rem;
  letter-spacing: 4px;
  margin: 10px 0 4px;
}
#share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
#share-links[hidden] { display: none; }
#share-links .share-link {
  padding: 9px 16px;
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
}
#share-links .share-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ============ Ad slot ============ */
#ad-slot {
  margin: 28px auto;
  max-width: 728px;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #f2efe4;
}

/* ============ More games ============ */
.section-title { font-size: 1.5rem; font-weight: 800; margin: 8px 0 18px; text-align: center; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}

.game-card-link {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  color: var(--text);
  transition: border-color .15s ease, transform .1s ease;
  display: block;
}
.game-card-link:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-flags { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
.card-flags img { border-radius: 3px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.game-card-link .name { font-weight: 700; font-size: .98rem; }
.game-card-link .soon { display: block; margin-top: 4px; color: #4a5160; font-size: .78rem; }
.game-card-link.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* ============ Text sections ============ */
section.text-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  margin-bottom: 24px;
}
section.text-section h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 14px; }
section.text-section p { color: #3a4152; margin-bottom: 14px; }
section.text-section p:last-child { margin-bottom: 0; }

details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--card-2);
  overflow: hidden;
}
details summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--muted);
}
details[open] summary::after { content: "\2013"; }
details h3 { display: inline; font-size: 1rem; font-weight: 700; }
details .answer { padding: 0 16px 14px; color: #3a4152; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

@media (max-width: 520px) {
  .options { grid-template-columns: 1fr 1fr; gap: 10px; }
  .option { min-height: 48px; font-size: .95rem; }
  .stat { min-width: 76px; padding: 8px 12px; }
  .site-nav { gap: 6px; }
  .site-nav a { padding: 6px 11px; font-size: .82rem; }
}
