@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-600.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-800.woff2") format("woff2");
}

:root {
  --bg: #f4f1ea;
  --ink: #1c2430;
  --muted: #5d6b73;
  --line: #e3dccf;
  --card: #fffdf9;
  --pine: #0f6e56;
  --lapis: #1e3a5f;
  --gold: #9a5b12;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Nunito, sans-serif;
  font-weight: 600;
  line-height: 1.5;
}
a { color: var(--pine); }
a:hover { color: var(--lapis); }

.wrap { width: min(920px, calc(100% - 32px)); margin: 0 auto; }
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 8px;
}
.brand { font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
nav { display: flex; flex-wrap: wrap; gap: 14px; font-weight: 800; }
nav a { text-decoration: none; }

.hero { padding: 28px 0 8px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.lede { font-size: 18px; color: var(--muted); max-width: 42rem; }

.games { display: grid; gap: 12px; margin: 28px 0; }
@media (min-width: 760px) { .games { grid-template-columns: repeat(3, 1fr); } }
.game {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 18px;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}
.game:hover { border-color: var(--pine); }
.game span { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pine); }
.game h2 { margin: 0; font-size: 22px; }
.game p { margin: 0; color: var(--muted); flex: 1; }
.game b { font-size: 14px; }
.game.planned { border-style: dashed; }
.region { margin: 22px 0 8px; font-size: 18px; }

h2.section { margin: 36px 0 8px; font-size: 26px; }
.note { color: var(--muted); max-width: 42rem; }
#import-message:not(:empty) { color: var(--ink); font-weight: 800; }

.programs { display: grid; gap: 10px; margin: 16px 0 8px; }
@media (min-width: 700px) { .programs { grid-template-columns: 1fr 1fr; } }
.programs a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
.programs a:hover { border-color: var(--lapis); }
.programs strong { display: block; }
.programs span { color: var(--muted); font-size: 14px; }

.books h2 { margin: 28px 0 8px; font-size: 22px; }
.books ul { list-style: none; padding: 0; margin: 0 0 8px; }
.books li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.books li span { color: var(--muted); }
.books .buy { flex: none; font-weight: 800; font-size: 14px; }

footer {
  margin-top: 40px;
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
footer p { margin: 0 0 8px; }

.deck-list { display: grid; gap: 12px; margin: 18px 0; }
.deck-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.deck-card h2 { margin: 0 0 4px; font-size: 20px; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.deck-actions button, .deck-form button {
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  padding: 8px 14px;
  cursor: pointer;
}
.deck-actions button.primary, .deck-form button.primary {
  background: var(--lapis);
  color: white;
  border-color: var(--lapis);
}
.deck-form { display: grid; gap: 8px; margin: 12px 0 24px; }
.deck-form input, .deck-form textarea {
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
}
.deck-form textarea { min-height: 120px; }
.visibility {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px 12px;
  display: grid;
  gap: 6px;
}
.visibility legend { font-weight: 800; padding: 0 4px; }
.visibility label { display: flex; gap: 8px; align-items: flex-start; }
.visibility input { width: auto; margin-top: 4px; }
.fact-rows {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}
.fact-row {
  display: grid;
  gap: 8px;
  align-items: end;
}
@media (min-width: 700px) {
  .fact-row { grid-template-columns: 1fr 1fr auto; }
}
.fact-field { display: grid; gap: 4px; font-size: 14px; font-weight: 800; }
.fact-field input { font-weight: 600; }
.fact-front { font-size: 22px; margin: 0; }
.fact-back { font-size: 20px; color: var(--pine); }
.public-facts { list-style: none; padding: 0; margin: 0 0 24px; }
.public-facts li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.public-facts b { display: block; }
.rank-list { display: grid; gap: 8px; margin: 12px 0 28px; }
.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.rank-row.you { border-color: var(--pine); }
.rank-row small { display: block; color: var(--muted); font-size: 13px; }
