:root {
  --bg: #0b0b0d;
  --shell: #111114;
  --panel: #16161a;
  --input-bg: #1a1a1f;
  --pill-bg: #1d1d23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f6;
  --muted: #8e8e98;
  --subtle: #666670;
  --accent: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-border: rgba(129, 140, 248, 0.35);
  --cyan: #38bdf8;
  --live: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.11);
  --ok-border: rgba(52, 211, 153, 0.35);
  --ok-text: #86efac;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.38);
  --warn-text: #fde68a;
  --err-bg: rgba(244, 63, 94, 0.12);
  --err-border: rgba(244, 63, 94, 0.38);
  --err-text: #fda4af;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(640px 280px at 50% -40px, rgba(99, 102, 241, 0.11), transparent 70%),
    radial-gradient(420px 220px at 78% 12%, rgba(56, 189, 248, 0.06), transparent 72%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 1.75rem 1.1rem 2rem;
}

/* Header */
.hero {
  text-align: center;
  margin-bottom: 1.15rem;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  background: var(--shell);
  border: 1px solid var(--border-strong);
  color: #c7d2fe;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.7rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  flex-shrink: 0;
}

.live-dot-sm {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.18);
}

h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.42rem, 3.6vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.subtitle {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  font-size: 0.9rem;
}

.subtitle strong {
  color: #e4e4ea;
  font-weight: 500;
}

/* Compact 2-Stat Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  background: var(--shell);
  border: 1px solid var(--border);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Polar-style Double-Bezel Shell & Inner Panel */
.shell {
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.55rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem 0.65rem;
}

.shell-header h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #d4d4dc;
  letter-spacing: -0.01em;
}

.shell-tag {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 1.05rem;
}

/* Form */
.input-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.32rem;
  padding-left: 0.15rem;
}

.field input {
  width: 100%;
  padding: 0.66rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field input::placeholder {
  color: var(--subtle);
}

.field input:focus {
  border-color: var(--accent-border);
  background: #1d1d24;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.turnstile-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
}

.turnstile-row:has(iframe[style*="height"]) {
  margin-bottom: 0.75rem;
}

/* Polar Signature White Pill CTA */
.btn-pill-primary {
  width: 100%;
  padding: 0.72rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #09090b;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.btn-pill-primary:hover:not(:disabled) {
  background: #e9ebff;
  transform: translateY(-1px);
}

.btn-pill-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-pill-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Feedback Banner */
.feedback {
  margin-top: 0.8rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.feedback.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-text);
}

.feedback.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}

.feedback.err {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  color: var(--err-text);
}

/* Active Gift Codes Grid */
.codes-panel {
  padding: 0.9rem 1rem 1rem;
}

.codes-note {
  margin: 0 0 0.72rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.codes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.code-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.52rem 0.72rem;
  border-radius: 11px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.1s ease;
}

.code-chip:hover {
  border-color: var(--accent-border);
  background: #21212b;
  transform: translateY(-1px);
}

.code-chip.copied {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.code-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-copy-hint {
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.code-chip.copied .code-copy-hint {
  color: var(--ok-text);
}

.codes-empty {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 0.35rem 0;
}

/* Support Bar & Footer */
.footer {
  margin-top: 0.85rem;
}

.support-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  background: var(--shell);
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
}

.support-copy {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.btn-pill-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-pill-secondary:hover {
  background: #252530;
  border-color: var(--accent-border);
}

.icon-coffee {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.disclaimer {
  margin: 0;
  text-align: center;
  color: var(--subtle);
  font-size: 0.74rem;
}

@media (max-width: 560px) {
  .page {
    padding: 1.25rem 0.9rem 1.75rem;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .codes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-bar {
    flex-direction: column;
    text-align: center;
    padding: 0.9rem;
  }
}
