* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  --background: #0b211b;
  --surface: #142e26;
  --border: #48695a;
  --text: #fff5df;
  --muted: #cbd9cd;
  --gold: #ffdc87;
  --green: #9ce5b0;
  background: var(--background);
  color: var(--text);
}

body { margin: 0; }

main {
  max-width: 1080px;
  margin: auto;
  padding: 24px clamp(12px, 4vw, 24px);
}

.hero {
  text-align: center;
  padding: clamp(28px, 6vw, 64px) clamp(16px, 5vw, 48px);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-bottom: 4px solid #b95159;
  border-radius: 24px;
  background:
    radial-gradient(circle, #fff5df45 1px, transparent 2px) 10px 16px / 71px 61px,
    radial-gradient(circle, #fff5df28 1px, transparent 2px) 25px 7px / 47px 43px,
    radial-gradient(ellipse at top, #26503e, #102a21 76%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--background);
  text-align: left;
}

.brand img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  background: #fff5df;
  object-fit: contain;
}

.brand p {
  margin: 0;
  color: var(--text);
  font-weight: 750;
}

h1 {
  font: 700 clamp(2rem, 6.5vw, 4.25rem)/1.05 Georgia, serif;
  margin: 20px 0 12px;
  text-wrap: balance;
}

p {
  line-height: 1.55;
  color: var(--muted);
  margin: 8px 0;
}

.scratch {
  display: inline-block;
  margin-top: 16px;
  background: var(--gold);
  color: var(--background);
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
}

.progress,
.quest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#stars,
.stars { color: var(--gold); }

progress {
  width: 100%;
  height: 12px;
  margin-top: 14px;
  accent-color: var(--gold);
}

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

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}

button {
  font: inherit;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 15px;
}

button[aria-pressed="true"] {
  background: var(--text);
  color: var(--background);
  font-weight: 700;
}

button:hover,
.scratch:hover { filter: brightness(1.15); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}

.quest {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest[hidden] { display: none; }
.quest.complete { border-color: var(--green); }

.meta {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
}

.level1 { --accent: var(--green); --panel: #204334; }
.level2 { --accent: var(--gold); --panel: #493a24; }
.level3 { --accent: #ffb3b8; --panel: #4c2930; }

.difficulty {
  color: var(--accent);
  font-weight: 800;
}

.art {
  background: var(--panel);
  border-radius: 12px;
  text-align: center;
  padding: 16px;
}

.emoji { font-size: 52px; line-height: 1.3; }
.stars { letter-spacing: 4px; }
h2 { font-size: 21px; margin: 0; }
.description { margin: 0; flex: 1; }

details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

summary { cursor: pointer; font-weight: 600; }
details p { color: var(--gold); font-size: 14px; }
.bonus { font-size: 14px; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 8px 0;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.complete .check { color: var(--green); }
footer { text-align: center; margin: 32px 0; }
footer button { font-size: 13px; }

@media print {
  :root { color-scheme: light; background: white; color: black; }
  .hero, nav, .progress, footer, .check, details { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }

  .quest {
    background: white;
    color: black;
    break-inside: avoid;
    border: 1px solid #999;
  }

  .quest p, .meta, .difficulty, .stars { color: black; }
  .art { background: #eee; }
}
