:root {
  --bg: #0b1416;
  --card: #132225;
  --text: #e8f4f1;
  --muted: #8fa9a5;
  --line: rgba(151, 252, 228, 0.12);
  --mint: #97fce4;
  --mint-2: #50d2b4;
  --ink: #062a24;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang TC", "Microsoft JhengHei", sans-serif;
  overflow-x: hidden;
  line-height: 1.55;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

button, input, select { font: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
  background: rgba(11, 20, 22, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-logo { width: 32px; height: 32px; flex: none; }

.lang select {
  max-width: 46vw;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #132225;
  color: var(--muted);
  font-size: 16px;
}

.col {
  width: min(480px, calc(100% - 32px));
  margin: 18px auto 28px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}

.hero { text-align: center; }

h1, h2, h3 { margin: 0 0 10px; line-height: 1.25; letter-spacing: -0.02em; }

h1 { font-size: 1.75rem; }

h2 { font-size: 1.2rem; }

p { margin: 0 0 12px; }

.muted, .hint { color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mint), var(--mint-2));
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.stats li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
}

.stats strong { display: block; font-size: 1.25rem; }

.stats span { color: var(--muted); font-size: 0.72rem; }

.tiers { display: grid; gap: 10px; }

.tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.tier b { display: block; font-size: 1.05rem; }

.tier span, .tier small { color: var(--muted); font-weight: 500; font-size: 0.78rem; }

.tier > strong { color: var(--mint); font-size: 1.35rem; text-align: end; }

.tier-top { border-color: rgba(151, 252, 228, 0.45); }

.tier em {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
}

.steps, .rules, .notes { margin: 0; padding: 0; list-style: none; }

.steps li, .rules li, .notes li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.steps { counter-reset: step; }

.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  align-items: start;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(151, 252, 228, 0.14);
  color: var(--mint);
  font-size: 0.82rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.steps strong, .steps span { display: block; grid-column: 2; margin: 0; }

.steps span { color: var(--muted); font-size: 0.92rem; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.pills li {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.rules li { color: var(--muted); font-size: 0.92rem; }

.progress { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

.progress i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(151, 252, 228, 0.25);
  flex: none;
}

.progress b { flex: 1; height: 2px; background: rgba(151, 252, 228, 0.2); }

.progress i.on, .progress i.done { background: var(--mint); }

.step-label { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }

.fstep { display: none; }
.fstep.on { display: block; }

label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: 0.95rem; }

input[type="text"], select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d1a1c;
  color: var(--text);
  font-size: 16px;
}

input.invalid { border-color: #ff8d8d; }

.err { display: none; color: #ffb4b4; font-size: 0.85rem; }
.err.show { display: block; }

.badge {
  margin: 8px 0 0;
  color: var(--mint);
  font-size: 0.85rem;
}

.badge[hidden] { display: none; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }

.row { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 10px; margin-top: 12px; }

.claim .btn { margin-top: 12px; }
.row .btn { margin-top: 0; }

footer {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 10, 0.86);
}

.modal.open { display: flex; align-items: center; }

.modal-card {
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px;
}

.variant {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.variant strong { display: block; margin-bottom: 8px; }

.variant pre {
  margin: 0 0 10px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
}

.follow-line b { color: var(--mint); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[dir="rtl"] .tier { flex-direction: row-reverse; }
[dir="rtl"] .brand { flex-direction: row-reverse; }
[dir="rtl"] .check { flex-direction: row-reverse; }

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  .col, footer { width: min(480px, calc(100% - 24px)); }
  .brand { white-space: nowrap; font-size: 0.92rem; }
  .lang select { max-width: 42vw; }
  input[type="text"], select, .lang select { font-size: 16px; }
}

@media (min-width: 720px) {
  .modal { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
