:root {
  color-scheme: light;
  --ink: #17322f;
  --evergreen: #0b3b35;
  --evergreen-light: #dceee8;
  --cranberry: #a91e35;
  --cranberry-dark: #7d1327;
  --gold: #efb83e;
  --snow: #f7fbfa;
  --green: #157452;
  --green-light: #e0f5ea;
  --red: #a52832;
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 7%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 90% 13%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 68% 5%, #dff6ff 0 1.5px, transparent 2.5px),
    linear-gradient(160deg, #082f39 0, var(--evergreen) 18rem, var(--snow) 18.05rem);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 18rem;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 115%, #ffffff18 0 45%, transparent 46%);
}

.snowfall {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.48;
  background-image: radial-gradient(circle, white 0 1px, transparent 1.5px), radial-gradient(circle, #dff7ff 0 1.5px, transparent 2px);
  background-position: 0 0, 38px 52px;
  background-size: 68px 72px, 94px 104px;
}

button { font: inherit; }
.app-header { position: relative; display: flex; align-items: center; gap: 0.85rem; width: min(100% - 2rem, 34rem); margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) 0 1.1rem; color: white; }
.event-mark { display: grid; width: 3.6rem; height: 3.6rem; flex: 0 0 auto; place-items: center; border: 2px solid var(--gold); border-radius: 50% 50% 45% 45%; background: #ffffff1e; box-shadow: 0 0 0 4px #ffffff0f; font-size: 2.1rem; }
.eyebrow { margin: 0 0 0.15rem; color: #ffd878; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.35rem, 6vw, 1.85rem); line-height: 1.05; }
main { width: min(100% - 1.25rem, 34rem); margin: 0 auto; }

.panel { overflow: hidden; border: 1px solid #c7ddd8; border-radius: 1.35rem; background: linear-gradient(180deg, white, #fbfdfc); box-shadow: 0 0.8rem 2rem #072f3030; }
.status-band { position: relative; padding: 0.95rem 1rem; color: white; background: var(--cranberry); text-align: center; font-size: clamp(1.15rem, 6vw, 1.65rem); font-weight: 950; letter-spacing: 0.045em; }
.status-band::before, .status-band::after { content: "✦"; margin: 0 0.55rem; color: #ffd878; }
.panel.correct .status-band { background: var(--green); }
.panel.wrong .status-band { background: var(--cranberry-dark); }
.panel.complete .status-band { color: #14302d; background: var(--gold); }
.panel-body { position: relative; padding: clamp(1.1rem, 5vw, 1.8rem); text-align: center; }
.panel-body::after { content: "❄"; position: absolute; right: 1rem; bottom: 0.65rem; color: #c9e6e9; font-size: 2rem; pointer-events: none; }
.instruction { margin: 0; color: #58716d; font-size: 0.82rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }

.target-visual { display: grid; width: min(48vw, 11.5rem); aspect-ratio: 1; margin: 0.6rem auto 0.4rem; place-items: center; border: 4px solid var(--gold); border-radius: 50%; background: radial-gradient(circle at 50% 42%, #fff 0 45%, #edf8f7 100%); box-shadow: 0 0 0 7px #edf6f3, inset 0 -0.5rem 1rem #d9ece844; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: min(28vw, 7.5rem); line-height: 1; }
.target-visual img { width: 82%; height: 82%; object-fit: contain; }
.target-name { margin: 0.65rem 0 0; color: var(--evergreen); font-size: clamp(1.9rem, 9vw, 3rem); line-height: 1; text-transform: uppercase; }
.message { margin: 0.8rem auto 0; max-width: 25rem; color: #4f6763; font-size: 1.05rem; line-height: 1.4; }
.progress-label { margin: 1.15rem 0 0.55rem; font-weight: 900; }
.progress-track { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
.progress-dot { width: 1.05rem; height: 1.05rem; border: 2px solid #8ca29e; border-radius: 50%; background: white; }
.progress-dot.found { border-color: var(--green); background: var(--green); }
.progress-dot.current { border-color: var(--cranberry); box-shadow: 0 0 0 3px #efd1d6; }

.primary-button, .secondary-button, .danger-button { width: 100%; min-height: 3.2rem; margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 0.8rem; font-weight: 900; cursor: pointer; }
.primary-button { color: white; border: 0; background: var(--evergreen); }
.secondary-button { color: var(--evergreen); border: 2px solid var(--evergreen); background: white; }
.danger-button { color: var(--red); border: 2px solid #e5b9bc; background: #fff5f5; }
.choice-grid { display: grid; gap: 0.35rem; margin-top: 1rem; }
.id-chip { display: inline-block; margin: 0.55rem 0; padding: 0.4rem 0.7rem; border-radius: 0.55rem; color: var(--evergreen); background: var(--evergreen-light); font-weight: 950; letter-spacing: 0.08em; }
.claim-code { margin: 0.8rem 0; padding: 0.8rem; border: 3px dashed var(--cranberry); border-radius: 1rem; background: #fff5d7; }
.claim-code strong { display: block; color: var(--cranberry-dark); font-size: clamp(1.7rem, 9vw, 2.7rem); letter-spacing: 0.12em; }
.complete-icon { font-size: clamp(4.6rem, 24vw, 8rem); line-height: 1.1; }
.offline-note { padding: 0.7rem; border-radius: 0.7rem; color: #6c4a14; background: #fff1c9; }

.app-footer { width: min(100% - 2rem, 34rem); margin: 0 auto; padding: 1rem 0 max(1rem, env(safe-area-inset-bottom)); text-align: center; }
.text-button, summary { color: #486660; background: none; border: 0; text-decoration: underline; cursor: pointer; }
details { margin-top: 0.8rem; }
details .danger-button { max-width: 18rem; }
.sync-status { min-height: 1.2em; margin: 0.75rem 0 0; color: #617874; font-size: 0.78rem; }
dialog { width: min(92vw, 30rem); border: 2px solid #c8ded9; border-radius: 1.2rem; padding: 1.4rem; color: var(--ink); background: #fbfefd; }
dialog::backdrop { background: #062c2bbb; }
.dialog-close { float: right; border: 0; color: var(--evergreen); background: none; font-size: 2rem; cursor: pointer; }
.dialog-note { color: #5e7671; }
.route-list { padding-left: 0; list-style: none; counter-reset: route; }
.route-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem; border-bottom: 1px solid #e3eeeb; font-weight: 850; }
.route-list li::before { counter-increment: route; content: counter(route); display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border-radius: 50%; color: white; background: var(--cranberry); font-size: 0.8rem; }
.route-list .mini-icon { margin-left: auto; font-size: 2rem; }

@media (min-width: 40rem) { body { padding-top: 1rem; } }
@media (prefers-reduced-motion: no-preference) {
  .panel.correct .target-visual { animation: pop 350ms ease-out; }
  .snowfall { animation: snowdrift 18s linear infinite; }
  @keyframes pop { 0% { transform: scale(0.75); } 70% { transform: scale(1.06); } 100% { transform: scale(1); } }
  @keyframes snowdrift { to { background-position: 68px 144px, -56px 260px; } }
}
