:root {
  --bg: #1c1430;
  --panel: #271d42;
  --line: #3d3063;
  --text: #ece6f5;
  --muted: #bcb2d4;
  --gold: #e9cf93;
  --gold-strong: #f3dca6;
  --button-text: #23183b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

h1, h2, h3, .logo { font-family: Georgia, "Times New Roman", serif; font-weight: normal; line-height: 1.25; }
h1 { font-size: 2.1rem; margin: 0 0 .6rem; color: var(--gold-strong); }
h2 { font-size: 1.55rem; margin: 2.4rem 0 .8rem; color: var(--gold); }
h3 { font-size: 1.15rem; margin: 1.4rem 0 .4rem; }

a { color: var(--gold-strong); }
a:hover { color: #fff; }
p { margin: 0 0 1rem; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header and footer */
.top { border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.logo { font-size: 1.4rem; color: var(--text); text-decoration: none; }
.logo span { color: var(--gold); }
.links { display: flex; gap: 18px; }
.links a, .langs a { text-decoration: none; }
.langs { margin-left: auto; display: flex; gap: 10px; font-size: .9rem; }
.langs span { color: var(--muted); }
.bottom { margin-top: 64px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }

/* Buttons and call to action */
.button {
  display: inline-block; padding: 12px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: var(--button-text); font: inherit; font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--gold-strong); color: var(--button-text); }
.cta { margin: 40px 0; padding: 24px; border: 1px solid var(--gold); border-radius: 14px; background: var(--panel); }
.cta h2 { margin-top: 0; }

/* Home page */
.intro { padding: 36px 0 8px; }
.group h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 14px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; font-size: .9rem; line-height: 1.3; }
.tile img { width: 100%; height: auto; border-radius: 6px; transition: transform .15s; }
.tile:hover img { transform: translateY(-3px); }

/* Card of the day and yes or no */
.draw { margin: 28px 0; padding: 24px; border-radius: 14px; background: var(--panel); }
.draw h2 { margin-top: 0; }
.question input {
  display: block; width: 100%; max-width: 520px; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.draw-result { display: flex; gap: 24px; margin-top: 20px; align-items: flex-start; }
.draw-result[hidden] { display: none; }
.draw-card img { width: 200px; height: auto; border-radius: 8px; transition: transform .4s; }
.draw-card img.is-reversed { transform: rotate(180deg); }
.draw-name { font-family: Georgia, serif; font-size: 1.4rem; color: var(--gold-strong); margin-bottom: .3rem; }
.draw-answer { font-size: 1.8rem; font-weight: 700; margin-bottom: .4rem; }
.draw-answer:empty { display: none; }
.draw-done { color: var(--muted); }
.more { color: var(--muted); }

/* Card page */
.crumbs { margin: 20px 0 0; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.card-head { display: flex; gap: 32px; margin-top: 20px; align-items: flex-start; }
.card-figure { margin: 0; flex: 0 0 300px; }
.card-image { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.card-intro { flex: 1; min-width: 0; }
.keywords { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 18px; }
.keywords dt { color: var(--gold); }
.keywords dd { margin: 0; }
.facts { border-collapse: collapse; width: 100%; font-size: .95rem; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 7px 10px 7px 0; border-top: 1px solid var(--line); }
.facts th { color: var(--muted); font-weight: normal; width: 34%; }
.toc { margin: 32px 0 0; padding: 18px 24px; background: var(--panel); border-radius: 12px; }
.toc h2 { margin: 0 0 6px; font-size: 1.2rem; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.reversed-thumb { float: right; width: 96px; height: auto; margin: 0 0 12px 18px; border-radius: 6px; transform: rotate(180deg); }
.answers { font-size: 1.15rem; }
.combos { list-style: none; padding: 0; margin: 0; }
.combos li { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.combos img { width: 64px; height: auto; border-radius: 4px; }
.combos h3 { margin: 0 0 4px; font-size: 1.05rem; }
.combos p { margin: 0; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  .card-head { flex-direction: column; gap: 16px; }
  .card-figure { flex: none; width: 62%; max-width: 260px; margin: 0 auto; }
  .toc ol { columns: 1; }
  .draw-result { flex-direction: column; }
  .draw-card img { width: 160px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .langs { margin-left: 0; }
}
