/* ==========================================================================
   Redeem Code Free Fire — design system
   Dark-first. No external dependencies. Mobile-first.
   ========================================================================== */

:root {
  --bg: #0a0f1e;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #1b2547 0%, #0a0f1e 60%);
  --surface: #121a30;
  --surface-2: #18223d;
  --surface-3: #1f2b4a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #e9edf8;
  --muted: #97a3c2;
  --faint: #6b779a;

  --accent: #ff7a1a;
  --accent-hi: #ff9a4d;
  --accent-2: #ffc341;
  --accent-soft: rgba(255, 122, 26, 0.12);

  --success: #2ed47a;
  --success-soft: rgba(46, 212, 122, 0.13);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.13);
  --info: #4aa3ff;
  --info-soft: rgba(74, 163, 255, 0.13);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);

  --wrap: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo,
    Consolas, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.85rem, 5.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.6vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2.4vw, 1.35rem); }

p { margin: 0 0 1.1em; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 18px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #16110a;
  padding: 10px 16px;
  z-index: 200;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid;
  place-items: center;
  color: #17120a;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255, 122, 26, 0.35);
}

.brand-text small {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 10px 18px 18px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent-hi); background: var(--accent-soft); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav,
  .site-nav.is-open {
    display: block;
    position: static;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .site-nav ul { flex-direction: row; gap: 4px; align-items: center; }
  .site-nav a { padding: 8px 12px; font-size: 0.9rem; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 40px 0 26px;
  text-align: center;
  position: relative;
}

.hero h1 { margin-bottom: 14px; }

.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 660px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.2vw, 1.1rem);
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 20px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(46, 212, 122, 0.6);
  animation: pulse 2.2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(46, 212, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 212, 122, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.97rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  text-align: center;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #17120a;
  box-shadow: 0 6px 22px rgba(255, 122, 26, 0.33);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 122, 26, 0.45); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Sections ---------- */

.section { padding: 40px 0; }
.section-head { margin-bottom: 24px; }
.section-head.center { text-align: center; }
.section-head p { color: var(--muted); max-width: 680px; }
/* Only centre the sub-text when the whole head is centred, so it stays
   flush with left-aligned headings. */
.section-head.center p { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 8px;
}

/* ---------- Code cards ---------- */

.codes-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .codes-grid { grid-template-columns: repeat(2, 1fr); }
}

.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.code-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.code-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.code-card.is-expired::before { background: linear-gradient(90deg, #4a5578, #6b779a); }
.code-card.is-expired { opacity: 0.72; }

.code-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-region { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--muted); }

.code-value {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}

.code-value code {
  font-family: var(--mono);
  font-size: clamp(1rem, 3.6vw, 1.22rem);
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--accent-2);
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-all;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.14s ease;
  padding: 0;
}
.copy-btn:hover { background: var(--accent); color: #17120a; border-color: var(--accent); }
.copy-btn svg { width: 17px; height: 17px; }
.copy-btn .icon-done { display: none; }
.copy-btn.copied { background: var(--success); border-color: var(--success); color: #062814; }
.copy-btn.copied .icon-copy { display: none; }
.copy-btn.copied .icon-done { display: block; }

.code-reward {
  font-size: 0.93rem;
  color: var(--muted);
  margin: 0;
}
.code-reward strong { color: var(--text); font-weight: 700; }

.code-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: auto;
  padding-top: 3px;
}

/* ---------- Empty state ---------- */

.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
}

.empty-state .icon-wrap {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.empty-state .icon-wrap svg { width: 28px; height: 28px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); max-width: 520px; margin-inline: auto; }

/* ---------- Notice / callouts ---------- */

.notice {
  display: flex;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  margin: 22px 0;
}
.notice svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.notice p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.notice p + p { margin-top: 8px; }
.notice strong { color: var(--text); }
.notice-warn { border-left-color: var(--danger); }
.notice-warn svg { color: var(--danger); }
.notice-info { border-left-color: var(--info); }
.notice-info svg { color: var(--info); }

/* ---------- Steps ---------- */

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

@media (min-width: 780px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 20px 62px;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 19px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17120a;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.steps h3 { font-size: 1.02rem; margin-bottom: 5px; }
.steps p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- Feature / info grid ---------- */

.grid-3 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 7px; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.card p + p { margin-top: 9px; }

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 13px;
}
.card-icon svg { width: 20px; height: 20px; }

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td code { font-family: var(--mono); color: var(--accent-2); font-size: 0.88em; }

/* ---------- FAQ ---------- */

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

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq details[open] { border-color: var(--border-strong); }

.faq summary {
  padding: 16px 46px 16px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.faq .faq-body { padding: 0 18px 17px; color: var(--muted); font-size: 0.94rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Prose (article pages) ---------- */

.prose { max-width: 780px; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { color: var(--muted); padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.55em; }
.prose li::marker { color: var(--accent); }
.prose > p { color: var(--muted); }
.prose strong { color: var(--text); }
.prose code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
  color: var(--accent-2);
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 1.5em;
}

/* Freshness stamp on guide pages — mirrors the Article dateModified. */
.updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--faint);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 0 0 1.6em;
}
.updated::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- Breadcrumbs ---------- */

.crumbs {
  font-size: 0.84rem;
  color: var(--faint);
  padding-top: 22px;
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.crumbs li::after { content: "/"; margin-left: 7px; color: var(--faint); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin: 40px 0;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 20px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(6, 10, 22, 0.7);
  margin-top: 50px;
  padding: 38px 0 26px;
}

.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  margin-bottom: 28px;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; }
}

.footer-col h4 {
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 13px;
  font-weight: 800;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { color: var(--muted); font-size: 0.91rem; }
.footer-col a:hover { color: var(--accent-hi); }
.footer-about p { color: var(--faint); font-size: 0.89rem; margin: 12px 0 0; max-width: 380px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--faint);
}
@media (min-width: 760px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

.disclaimer-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.83rem;
  color: var(--faint);
  line-height: 1.6;
  margin-bottom: 24px;
}
.disclaimer-strip strong { color: var(--muted); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 130%);
  background: var(--success);
  color: #062814;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Utility ---------- */

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

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
