/* ═══════════════════════════════════════════════════════════════════════════
   Fortnite Locker — Store theme
   Dark storefront. Layout mirrors the design brief: top nav, popular offer
   cards, compact offer rows, transaction panel.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-0: #0a0d11;
    --bg-1: #10141a;
    --panel: #22262d;
    --panel-2: #1b1f25;
    --panel-3: #2a2f37;
    --line: #313740;
    --text: #ffffff;
    --text-soft: #c8ccd3;
    --text-muted: #8b929c;
    --link: #3f9bff;
    --link-hover: #7bbcff;
    --btn: #1a73e8;
    --btn-hover: #1765c4;
    --danger: #e5484d;
    --ok: #2ecc71;
    --radius: 6px;
    --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient colour wash behind the content */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60vw 50vh at 6% 8%, rgba(122, 63, 160, 0.10), transparent 70%),
        radial-gradient(55vw 45vh at 96% 24%, rgba(78, 139, 51, 0.08), transparent 72%);
    z-index: 0;
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* ── Top nav ─────────────────────────────────────────────────────────────── */

.topbar {
    padding: 14px 0 6px;
}

.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.topbar a {
    color: var(--link);
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.topbar a:hover { color: var(--link-hover); }

.nav-icon { font-size: 14px; line-height: 1; }

.cart-badge {
    display: none;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--btn);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.cart-badge.is-live { display: inline-block; }

/* ── Sections ────────────────────────────────────────────────────────────── */

.section { margin-top: 34px; }
.section:first-of-type { margin-top: 18px; }

.h-section {
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

.sub {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 2px;
}

/* ── Popular offer cards ─────────────────────────────────────────────────── */

.pop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.pop-card {
    position: relative;
    border-radius: var(--radius);
    padding: 26px 24px 22px;
    min-height: 252px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.pop-card .glyph-wrap {
    align-self: center;
    color: #fff;
    margin: 4px 0 18px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

.pop-card h3 {
    color: var(--text);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

.pop-card p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    margin-top: 4px;
}

.pop-card .price {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    margin-top: 12px;
}

.pop-card .btn { margin-top: 8px; }

.g-platinum { background: linear-gradient(135deg, #3d1140 0%, #7c3fa2 55%, #6a2f8f 100%); }
.g-og       { background: linear-gradient(135deg, #1d3a14 0%, #4f8d33 58%, #3c7028 100%); }
.g-midnight { background: linear-gradient(135deg, #10141a 0%, #2b3442 60%, #1b222c 100%); }
.g-crimson  { background: linear-gradient(135deg, #3d1016 0%, #a83a4a 58%, #7a2836 100%); }
.g-ocean    { background: linear-gradient(135deg, #0f2436 0%, #2f7fb5 58%, #1f5f8c 100%); }
.g-gold     { background: linear-gradient(135deg, #3a2c0d 0%, #b99328 58%, #8d711c 100%); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--btn);
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 7px 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.06s ease;
}

.btn:hover { background: var(--btn-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-sm { padding: 5px 13px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-soft);
}
.btn-ghost:hover { background: var(--panel-3); color: #fff; }
.btn-credit { background: #1f8a4c; }
.btn-credit:hover { background: #19743f; }

/* ── Offer rows ──────────────────────────────────────────────────────────── */

.rows {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offer-row {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.offer-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
}

.offer-meta { flex: 1 1 auto; min-width: 0; }
.offer-name { color: var(--text); font-size: 15px; font-weight: 500; }
.offer-desc { color: var(--text-muted); font-size: 13px; margin-top: 1px; }

.offer-price {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 12px;
}

/* ── Transactions panel ──────────────────────────────────────────────────── */

.panel {
    background: var(--panel);
    border-radius: 8px;
    padding: 18px 20px 20px;
    margin-top: 18px;
}

.panel h2 {
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.panel .sub { margin-top: 2px; }

.tx-list {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

.tx-item:first-child { border-top: 0; }

.tx-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    flex: 0 0 8px;
}

.tx-what { color: var(--text); font-weight: 500; }
.tx-who { color: var(--text-muted); font-size: 13px; }
.tx-when { color: var(--text-muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.tx-amt { color: var(--text); font-weight: 700; white-space: nowrap; }

.tx-empty { color: var(--text-muted); font-size: 15px; margin-top: 6px; }

/* ── Modals ──────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 16px;
    background: rgba(4, 6, 9, 0.72);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}

.modal.is-open { display: flex; }

.modal-box {
    width: 100%;
    max-width: 520px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.modal-box h3 {
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-box .sub { margin-bottom: 16px; }

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-box { position: relative; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.field { margin-bottom: 14px; }

.field label {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.field input,
.field select {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 9px 11px;
    outline: none;
}

.field input:focus,
.field select:focus { border-color: var(--btn); }

.hint { color: var(--text-muted); font-size: 12.5px; margin-top: 5px; }

/* ── Cart ────────────────────────────────────────────────────────────────── */

.cart-empty { color: var(--text-muted); font-size: 14px; padding: 18px 0 6px; }

.cart-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-line:last-of-type { border-bottom: 0; }

.cart-line .offer-meta { flex: 1 1 auto; }

.qty {
    width: 64px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 7px;
}

.cart-remove {
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.cart-remove:hover { color: var(--danger); }

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 12px;
    margin-top: 6px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
}

.credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(31, 138, 76, 0.16);
    border: 1px solid rgba(31, 138, 76, 0.45);
    color: #7fe0a5;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--panel-3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--btn);
    color: var(--text);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    animation: toast-in 0.18s ease;
    max-width: 330px;
}

.toast.is-error { border-left-color: var(--danger); }
.toast.is-ok { border-left-color: var(--ok); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ── Receipt ─────────────────────────────────────────────────────────────── */

.receipt {
    background: var(--panel);
    border-radius: 8px;
    padding: 18px 20px;
    margin-top: 18px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.receipt-row:last-child { border-bottom: 0; }
.receipt-row span:first-child { color: var(--text-muted); }
.receipt-row span:last-child { color: var(--text); font-weight: 600; text-align: right; }

.badge-ok {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.14);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #7fe0a5;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Terms ───────────────────────────────────────────────────────────────── */

.doc {
    background: var(--panel);
    border-radius: 8px;
    padding: 22px 24px;
    margin-top: 18px;
    color: var(--text-soft);
}

.doc h2 { color: var(--text); font-size: 17px; margin: 22px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.65; }
.doc ul { margin: 6px 0 6px 20px; }
.doc li { margin-bottom: 4px; }

.footer {
    margin: 44px 0 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Admin ───────────────────────────────────────────────────────────────── */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.admin-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 16px 18px;
}

.admin-card h3 { color: var(--text); font-size: 16px; margin-bottom: 10px; }

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; color: var(--text); font-size: 21px; }
.stat span { color: var(--text-muted); font-size: 12.5px; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-top: 8px;
}

table.data th,
table.data td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

table.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
table.data td { color: var(--text-soft); }
table.data td strong { color: var(--text); }

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.pill-paid { background: rgba(46, 204, 113, 0.16); color: #7fe0a5; }
.pill-pending { background: rgba(255, 193, 7, 0.16); color: #ffd479; }
.pill-off { background: rgba(255, 255, 255, 0.07); color: var(--text-muted); }

.tabs { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tab {
    background: var(--panel);
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: 5px;
    padding: 7px 13px;
    font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
}

.tab.is-active { color: var(--text); border-color: var(--btn); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
    .pop-grid { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
    .offer-row { flex-wrap: wrap; }
    .offer-price { margin-left: 0; }
    .h-section { font-size: 21px; }
}
