/* ===================== ROCKET LEAGUE CODES PAGE ===================== */

/* Page banner */
.page-banner { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.page-banner::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(720px 320px at 84% -34%, rgba(43,224,138,.15), transparent 62%),
    linear-gradient(165deg, #121A1C 0%, #0A0F10 66%);
}
.page-banner::after {
  content:""; position:absolute; inset:0; opacity:.5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(700px 320px at 78% 130%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(700px 320px at 78% 130%, #000, transparent 72%);
}
.banner-inner { position: relative; z-index:1; padding: 22px 0 30px; color: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-family: var(--font-display); font-weight: 500; color: rgba(255,255,255,.7); margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumb a { color: rgba(255,255,255,.7); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .cur { color: #fff; }

.banner-head { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.game-badge {
  width: 180px; min-height: 110px; align-self: stretch; border-radius: 20px; flex-shrink: 0; overflow: hidden;
  background: #0F1314; border: 1px solid var(--border-2);
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.6);
}
.game-badge image-slot { width: 100%; height: 100%; display: block; }
.banner-head .htext { flex: 1; min-width: 260px; }
.banner-head h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.025em; font-size: clamp(28px, 4.4vw, 46px); line-height: 1.04; color: #fff; }
.banner-sub { color: rgba(255,255,255,.82); font-size: 16px; margin-top: 8px; max-width: 60ch; }
.banner-stats { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.bstat {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 11px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px);
  color: #fff; font-size: 13.5px; font-weight: 500;
}
.bstat b { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.bstat .dot { color: #2BE08A; }
.verified-line { display: inline-flex; align-items: center; gap: 8px; }

/* Layout: TOC | content | ad rail */
.codes-layout {
  display: grid; grid-template-columns: 232px minmax(0,1fr) 300px; gap: 36px;
  align-items: start; padding-top: 36px;
}

/* TOC */
.toc { position: sticky; top: calc(var(--header-h) + 20px); }
.toc h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; padding-left: 14px; }
.toc ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1px; border-left: 2px solid var(--border); }
.toc a {
  display: block; padding: 8px 14px; font-size: 13.5px; color: var(--text-muted); font-weight: 500;
  border-left: 2px solid transparent; margin-left: -2px; transition: color .15s, border-color .15s;
  line-height: 1.35;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--primary-bright); border-left-color: var(--primary); font-weight: 600; }
[data-theme="light"] .toc a.active { color: var(--primary); }
.toc .toc-cta { margin-top: 18px; }
.toc .toc-cta .btn { width: 100%; font-size: 13px; padding: 10px; color: var(--on-primary); }
.toc .toc-cta .btn:hover { color: var(--on-primary); }

/* Content column */
.content { min-width: 0; max-width: 760px; }
.content h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px,2.6vw,30px); letter-spacing: -.02em; margin: 0 0 14px; scroll-margin-top: calc(var(--header-h) + 18px); }
.content h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 26px 0 10px; }
.content p { color: var(--text-muted); font-size: 16.5px; line-height: 1.72; margin-bottom: 16px; }
.content p a, .prose-link { color: var(--primary-bright); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: 3px; }
[data-theme="light"] .content p a, [data-theme="light"] .prose-link { color: var(--primary); }
.content p a:hover { text-decoration-color: var(--primary); }
.content section { margin-bottom: 48px; }
.content strong { color: var(--text); font-weight: 700; }

/* Intro lead */
.lead { font-size: 18px !important; color: var(--text-muted); }
.byline { display: flex; align-items: center; gap: 12px; margin: 0 0 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.byline .av { width: 38px; height: 38px; border-radius: 9px; background: var(--grad-primary); display: grid; place-items: center; color: var(--on-primary); font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.byline .bmeta { font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.byline .bmeta b { color: var(--text); font-family: var(--font-display); font-weight: 600; display: block; font-size: 14px; }

/* TL;DR box */
.tldr {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-2); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 8px;
  position: relative; overflow: hidden;
}
.tldr::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--grad-primary); }
.tldr h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--primary-bright); display:flex;align-items:center;gap:8px; font-family: var(--font-display); }
[data-theme="light"] .tldr h3 { color: var(--primary); }
.tldr ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.tldr li { display: flex; align-items: flex-start; gap: 11px; font-size: 15.5px; color: var(--text); line-height: 1.5; }
.tldr li svg { flex-shrink: 0; margin-top: 3px; color: var(--active); }
.tldr li b { font-family: var(--font-display); }

/* Codes toolbar */
.codes-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.codes-toolbar .count-lbl { font-size: 14px; color: var(--text-dim); }
.codes-toolbar .count-lbl b { color: var(--active); font-family: var(--font-display); font-weight: 700; }
.sort-group { display: flex; align-items: center; gap: 8px; }
.sort-group .lbl { font-size: 13px; color: var(--text-dim); font-family: var(--font-display); }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-muted);
  padding: 6px 13px; border-radius: 7px; transition: all .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
[data-theme="light"] .segmented button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Code cards (app-like, semantic list) */
.code-list { display: flex; flex-direction: column; gap: 10px; }
.code-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; transition: border-color .15s, transform .15s, box-shadow .15s; position: relative;
}
.code-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.code-card .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.code-badge {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--active-bg); border: 1px solid var(--active-bd); color: var(--active);
}
.code-main { min-width: 0; }
.code-main .code-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.code-val { font-family: var(--font-mono); font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: .01em; }
.code-reward { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.code-reward .ico { color: var(--primary); }
.code-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }
.code-meta .sepd { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); opacity: .6; }
.code-card .copy-btn { padding: 11px 18px; font-size: 14px; }
.code-card .copy-btn svg { width: 15px; height: 15px; }
.card-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.pill.verified { color: var(--active); background: var(--active-bg); border-color: var(--active-bd); }
.verify-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--active-bd);
  background: var(--active-bg); color: var(--active);
  transition: filter .15s;
}
.verify-btn:hover:not(:disabled) { filter: brightness(1.15); }
.verify-btn.done, .verify-btn:disabled { cursor: default; opacity: .85; }

/* Expired section */
.expired-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; user-select: none; }
.expired-head .toggle-ic { transition: transform .25s; color: var(--text-dim); }
.expired-head.collapsed .toggle-ic { transform: rotate(-90deg); }
.expired-wrap { overflow: hidden; transition: max-height .3s ease, opacity .25s; }
.expired-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.expired-table th { text-align: left; font-family: var(--font-display); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); font-weight: 600; padding: 0 14px 10px; }
.expired-table td { padding: 13px 14px; border-top: 1px solid var(--border); font-size: 14.5px; color: var(--text-muted); }
.expired-table .ec { font-family: var(--font-mono); font-weight: 700; color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--expired); }
.expired-table tr:hover td { background: var(--surface); }
.expired-table .ec-empty { text-align: center; color: var(--text-dim); font-style: italic; padding: 22px 14px; }
.expired-table tr:hover .ec-empty { background: none; }

/* Redeem steps */
.steps { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
}
.step .sn { width: 36px; height: 36px; border-radius: 9px; background: var(--grad-primary); color: var(--on-primary); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; flex-shrink: 0; }
.step h3 { margin: 4px 0 6px; font-size: 17px; }
.step p { margin: 0; font-size: 15px; }
.step code { font-family: var(--font-mono); background: var(--surface-2); border: 1px solid var(--border-2); padding: 1px 7px; border-radius: 6px; font-size: 13px; color: var(--primary-bright); font-weight: 700; }
[data-theme="light"] .step code { color: var(--primary); }

/* Annotated screenshot placeholder */
.shot {
  margin: 18px 0 6px; border: 1px solid var(--border-2); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); position: relative; aspect-ratio: 16/8.4; display: grid; place-items: center;
}
.shot .ph { text-align: center; color: var(--text-dim); padding: 24px; }
.shot .ph svg { margin-bottom: 10px; opacity: .6; }
.shot .ph .t { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); }
.shot .ph .s { font-size: 12.5px; margin-top: 4px; }
.shot.has-img { aspect-ratio: auto; display: block; }
.shot-img { width: 100%; height: auto; display: block; }
.shot .annot {
  position: absolute; padding: 6px 11px; border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--primary);
  border: 1px solid var(--active-bd); backdrop-filter: blur(4px);
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
}
.shot .annot::after { content:""; position:absolute; width:0;height:0; }
.shot-cap { font-size: 13px; color: var(--text-dim); font-style: italic; margin-top: 8px; }

/* Callout */
.callout {
  display: flex; gap: 14px; align-items: flex-start; background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0;
}
.callout .ci { color: var(--primary-bright); flex-shrink: 0; margin-top: 2px; }
[data-theme="light"] .callout .ci { color: var(--primary); }
.callout p { margin: 0; font-size: 14.5px; }
.callout b { color: var(--text); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; text-align: left; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text); }
.faq-q .pl { flex-shrink: 0; width: 22px; height: 22px; position: relative; }
.faq-q .pl::before, .faq-q .pl::after { content:""; position:absolute; background: var(--primary-bright); border-radius: 2px; transition: transform .25s; }
[data-theme="light"] .faq-q .pl::before, [data-theme="light"] .faq-q .pl::after { background: var(--primary); }
.faq-q .pl::before { left: 0; right: 0; top: 10px; height: 2px; }
.faq-q .pl::after { top: 0; bottom: 0; left: 10px; width: 2px; }
.faq-item.open .faq-q .pl::after { transform: scaleY(0); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 20px 18px; color: var(--text-muted); font-size: 15.5px; line-height: 1.7; }
.faq-item.open .faq-q { color: var(--primary-bright); }
[data-theme="light"] .faq-item.open .faq-q { color: var(--primary); }

/* Closer CTA */
.closer {
  background: linear-gradient(160deg, #121A1C 0%, #0A0F10 70%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 38px 40px; color: var(--text);
  position: relative; overflow: hidden; margin-top: 8px;
}
.closer::after { content:""; position:absolute; inset:0; background: radial-gradient(420px 220px at 90% -20%, rgba(43,224,138,.16), transparent 68%); }
.closer h2 { color: var(--text); margin: 0 0 8px; position: relative; }
.closer p { color: var(--text-muted); font-size: 16px; margin: 0 0 20px; position: relative; max-width: 52ch; }
.closer .btn { position: relative; background: var(--primary); color: var(--on-primary); }
.closer .btn:hover { transform: translateY(-1px); background: var(--primary-bright); }

/* Right ad rail */
.code-rail { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 18px; }
.rail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.rail-card h4 { font-family: var(--font-display); font-size: 14px; margin-bottom: 12px; display:flex;align-items:center;gap:8px; }
.rail-links { display: flex; flex-direction: column; gap: 2px; }
.rail-links a { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 9px; font-size: 14px; color: var(--text-muted); font-weight: 500; transition: background .15s, color .15s; }
.rail-links a:hover { background: var(--surface-2); color: var(--text); }
.rail-links .gi { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 11px; color: var(--text-muted); background: var(--surface-3); border: 1px solid var(--border-2); flex-shrink: 0; }
.rail-links . rc { margin-left: auto; }
.rail-links .rc { margin-left: auto; font-size: 12px; color: var(--active); font-family: var(--font-display); font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) {
  .codes-layout { grid-template-columns: 200px minmax(0,1fr); }
  .code-rail { display: none; }
}
@media (max-width: 860px) {
  .codes-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .content { max-width: none; }
}
@media (max-width: 560px) {
  .code-card { grid-template-columns: 1fr; gap: 14px; }
  .code-card .copy-btn, .code-card .verify-btn { width: 100%; }
  .banner-head { gap: 16px; }
  .game-badge { width: 72px; min-height: 72px; font-size: 26px; border-radius: 14px; }
}
