:root {
  --bg: #0b1416;
  --bg-2: #101c1f;
  --card: #132225;
  --card-2: #182b2f;
  --line: rgba(151, 252, 228, 0.12);
  --text: #e8f4f1;
  --muted: #8fa9a5;
  --accent: #97fce4;
  --accent-2: #50d2b4;
  --accent-ink: #062a24;
  --danger: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body {
  background:
    radial-gradient(900px 500px at 50% -200px, rgba(151, 252, 228, 0.12), transparent 60%),
    var(--bg);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(11, 20, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-name span { color: var(--muted); font-weight: 600; }

.lang-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}

.lang-select select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa9a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding-right: 18px;
  outline: none;
  cursor: pointer;
}

[dir="rtl"] .lang-select select {
  background-position: left center;
  padding-right: 0;
  padding-left: 18px;
}

select option {
  background: var(--card);
  color: var(--text);
  padding: 8px;
}

main { padding: 16px; display: grid; gap: 16px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 20px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, #10252a, #0d1a1d 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-glow {
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 260px;
  background: radial-gradient(closest-side, rgba(151, 252, 228, 0.28), transparent);
  pointer-events: none;
}

.badge {
  position: relative;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(151, 252, 228, 0.1);
  border: 1px solid rgba(151, 252, 228, 0.3);
}

.hero h1 {
  position: relative;
  margin: 16px 0 10px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero-sub { position: relative; margin: 0 0 20px; color: var(--muted); font-size: 15px; }

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

.hero-stats li {
  padding: 12px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
}

.hero-stats strong { font-size: 20px; color: var(--accent); }
.hero-stats span { font-size: 11px; color: var(--muted); }

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

.card h2 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
}

.card p { margin: 0 0 10px; font-size: 15px; }
.card p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

.tiers { display: grid; gap: 10px; margin-top: 14px; }

.tier {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

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

.tier-top {
  background: linear-gradient(135deg, rgba(151, 252, 228, 0.16), rgba(80, 210, 180, 0.06));
  border-color: rgba(151, 252, 228, 0.5);
}

.tier-tag {
  position: absolute;
  top: -10px;
  inset-inline-start: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
}

.tier-views { display: grid; }
.tier-views span { font-size: 18px; font-weight: 700; }
.tier-views small { color: var(--muted); font-size: 12px; }

.tier-reward { font-size: 26px; font-weight: 800; color: var(--accent); }
.tier-reward small { font-size: 12px; font-weight: 600; color: var(--muted); }

.steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li { display: flex; gap: 12px; align-items: flex-start; }

.step-num {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 14px;
}

.steps strong { display: block; font-size: 15px; }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.rules {
  margin: 8px 0 0;
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: 14px;
  display: grid;
  gap: 8px;
}

.rules li::marker { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(151, 252, 228, 0.25);
}

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

.btn-lg { width: 100%; padding: 16px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.progress {
  display: flex;
  align-items: center;
  margin: 16px 0 6px;
}

.progress .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card-2);
  border: 2px solid var(--line);
  transition: all 0.2s ease;
}

.progress .dot.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(151, 252, 228, 0.15); }
.progress .dot.done { background: var(--accent-2); border-color: var(--accent-2); }
.progress .line { flex: 1; height: 2px; background: var(--line); margin: 0 6px; }

.step-label { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

fieldset { border: none; margin: 0; padding: 0; }
.fstep { display: none; }
.fstep.active { display: grid; gap: 10px; animation: fade 0.25s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

label { font-size: 14px; font-weight: 600; }

input[type="text"], fieldset select {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}

fieldset select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238fa9a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

[dir="rtl"] fieldset select {
  background-position: left 14px center;
  padding-right: 14px;
  padding-left: 40px;
}

input[type="text"]:focus, fieldset select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(151, 252, 228, 0.15); }
input.invalid { border-color: var(--danger); }

.hint { margin: 0; font-size: 12px; color: var(--muted); }

.net-badge {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--accent);
  background: rgba(151, 252, 228, 0.08);
  border: 1px solid rgba(151, 252, 228, 0.3);
  animation: fade 0.2s ease;
}
.net-badge strong { color: var(--text); }
.err { display: none; margin: 0; font-size: 12px; color: var(--danger); }
.err.show { display: block; }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-2); flex: 0 0 auto; }

.fstep .btn-primary, .fstep .btn-row { margin-top: 6px; }

.footer { text-align: center; padding: 8px 4px 24px; }
.footer p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

.modal-card {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  max-width: 400px;
  margin: 0 auto;
  transform: translateY(-50%);
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop { from { opacity: 0; transform: translateY(-50%) scale(0.94); } to { opacity: 1; transform: translateY(-50%) scale(1); } }

.modal-card h3 { margin: 12px 0 8px; font-size: 19px; }
.modal-card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.modal-card .hint { margin-bottom: 16px; }

.follow-icon {
  display: inline-flex;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.follow-contact {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  word-break: break-all;
}
.follow-contact strong { color: var(--accent); }

.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }

.success { text-align: center; margin-bottom: 14px; }
.success h3 { margin: 10px 0 4px; font-size: 19px; }
.success p { margin: 0; font-size: 14px; }

.success-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 196, 87, 0.08);
  border: 1px solid rgba(255, 196, 87, 0.35);
  font-size: 13px;
  margin-bottom: 14px;
}

.notice strong { display: block; color: #ffc457; margin-bottom: 6px; }
.notice ul { margin: 0; padding-inline-start: 18px; color: var(--text); display: grid; gap: 4px; }

.variants { display: grid; gap: 12px; margin-bottom: 14px; }

.variant {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.variant-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.variant-head strong { font-size: 13px; color: var(--accent); }

.variant pre {
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.btn-copy {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-copy.copied {
  background: var(--accent-2);
  color: var(--accent-ink);
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

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

[dir="rtl"] .steps { direction: rtl; }
[dir="rtl"] .tier-reward { text-align: left; }
