:root {
  --bg: #0f2a22;
  --bg2: #163a2f;
  --card: #fffaf2;
  --ink: #2a1f1a;
  --muted: #7a6a5f;
  --red: #b8322a;
  --red-dark: #8f241e;
  --gold: #d9a441;
  --line: #eadfce;
  --ok: #2f7a4f;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at top, var(--bg2), var(--bg) 70%) fixed;
}

.snow {
  position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90px 120px, #fff, transparent),
    radial-gradient(2px 2px at 160px 60px, #fff, transparent),
    radial-gradient(1px 1px at 230px 170px, #fff, transparent);
  background-size: 260px 220px;
  animation: snow 30s linear infinite;
}
@keyframes snow { to { background-position: 0 220px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.wrap { position: relative; max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }

.lang { display: flex; justify-content: flex-end; gap: 10px; font-size: 13px; }
.lang a { color: #cfe3d9; text-decoration: none; opacity: .7; }
.lang a[aria-current] { opacity: 1; font-weight: 600; }

.hero { text-align: center; color: #fdf6ea; padding: 20px 0 16px; position: relative; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: clamp(28px, 7vw, 40px); margin: 4px 0; }
.hero .inline { position: absolute; right: 0; top: 0; }
.hero .link { color: #cfe3d9; }
.ornament { color: var(--gold); font-size: 22px; }
.note { color: #d7e7df; margin: 6px 0 0; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  border-top: 4px solid var(--red);
}
.card h2 { font-family: Georgia, serif; font-size: 20px; margin: 0 0 8px; }
.card h3 { font-size: 15px; margin: 18px 0 6px; }

.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.row select { flex: 1 1 120px; }
.inline { display: inline; margin: 0; }

label { font-weight: 600; font-size: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--red); flex: none; }

input:not([type=checkbox]), select, textarea {
  font: inherit; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.row select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 12px 18px; border-radius: 10px; border: 0;
  background: var(--red); color: #fff; text-decoration: none; display: inline-block; text-align: center;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn.ghost:hover { background: #fbeceb; }
.btn.danger { background: #5a4a42; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--red); cursor: pointer; text-decoration: underline; }

.x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.x:hover { color: var(--red); }

.chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: #f3e9da; border-radius: 999px; padding: 4px 10px 4px 14px; display: flex; align-items: center; gap: 6px; }

.rules { list-style: none; padding: 0; margin: 8px 0 0; }
.rules li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rules li > span:first-child { flex: 1; }

.count { font-family: -apple-system, sans-serif; font-size: 13px; background: var(--gold); color: #fff; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.tag { font-size: 13px; color: var(--muted); }
.tag.seen { color: var(--ok); font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; margin: 4px 0; }
form.danger { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); }

.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; font-size: 14px; }
.flash.ok { background: #e3f2e8; color: var(--ok); }
.flash.err { background: #fbe3e1; color: var(--red-dark); }

.lead { text-align: center; margin: 4px 0; color: var(--muted); }
.target {
  text-align: center; font-family: Georgia, serif; font-size: clamp(34px, 10vw, 52px);
  color: var(--red); margin: 8px 0 12px; animation: pop .6s ease-out;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.warn { text-align: center; font-size: 14px; background: #fdf1d8; border-radius: 10px; padding: 10px; margin: 0; }
.big { font-size: 18px; text-align: center; margin: 8px 0; }

.btn.small { padding: 8px 12px; font-size: 14px; flex: none; }
.center { text-align: center; }
.muted-link { color: var(--muted); }

.links { list-style: none; padding: 0; margin: 12px 0 0; }
.links li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.link-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.link-row { display: flex; gap: 8px; margin-top: 6px; }
.link-row input { font-size: 13px; padding: 8px 10px; color: var(--muted); min-width: 0; }
.link-actions { display: flex; gap: 16px; justify-content: flex-end; margin-top: 4px; }
.all-links { margin-top: 14px; }
.all-links summary { cursor: pointer; font-size: 14px; color: var(--red); }
.all-links textarea { font-size: 13px; margin: 8px 0; }

code.url { display: inline-block; margin-top: 4px; background: #f3e9da; padding: 4px 8px; border-radius: 6px; word-break: break-all; }

.foot { text-align: center; font-size: 13px; }
.foot a { color: #9fc2b2; }
