:root {
    --bg: #07111f;
    --bg-soft: #102038;
    --panel: rgba(10, 20, 39, 0.85);
    --panel-strong: rgba(14, 28, 52, 0.96);
    --line: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --muted: #94a3b8;
    --brand: #ff8c2f;
    --brand-2: #22d3ee;
    --success: #22c55e;
    --danger: #f97316;
    --warning: #facc15;
    --shadow: 0 24px 60px rgba(2, 8, 23, 0.45);
    --radius: 22px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.14), transparent 26%),
        linear-gradient(180deg, #07111f 0%, #081424 48%, #050b16 100%);
    min-height: 100vh;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    z-index: -1;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.28;
}

body::before {
    width: 280px;
    height: 280px;
    top: 10vh;
    right: -80px;
    background: #22d3ee;
}

body::after {
    width: 320px;
    height: 320px;
    bottom: 8vh;
    left: -100px;
    background: #f97316;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(4, 10, 20, 0.72);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand strong {
    display: block;
    font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

.brand small {
    color: var(--muted);
    display: block;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #ff4d4d);
    box-shadow: var(--shadow);
    font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
    font-weight: 700;
}

.main-nav,
.nav-actions,
.admin-tabs,
.pill-row,
.action-row,
.meta-row,
.pack-top,
.footer-grid,
.hero-panel,
.order-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav a,
.admin-tabs a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: 180ms ease;
}

.main-nav a:hover,
.admin-tabs a:hover,
.main-nav a.active,
.admin-tabs a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.user-chip small,
.muted {
    color: var(--muted);
}

.admin-bar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(6, 14, 26, 0.7);
}

.admin-tabs {
    padding: 10px 0;
}

.page-content {
    padding: 40px 0 56px;
    flex: 1;
}

.hero,
.detail-hero,
.auth-shell,
.split-layout,
.game-grid,
.card-grid,
.stats-grid,
.footer-grid,
.form-grid,
.order-grid,
.detail-list {
    display: grid;
    gap: 20px;
}

.hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    align-items: stretch;
    padding: 28px;
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(7, 17, 31, 0.95), rgba(13, 24, 45, 0.78)),
        linear-gradient(135deg, rgba(255, 140, 47, 0.14), rgba(34, 211, 238, 0.08));
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.hero-copy h1,
.detail-copy h1,
.auth-copy h1,
.section-heading h1,
.section-heading h2,
.empty-state h3,
.panel h2,
.panel h3 {
    margin: 0;
    font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
    letter-spacing: 0.01em;
}

.hero-copy h1,
.detail-copy h1,
.auth-copy h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1;
    margin-top: 8px;
}

.hero-copy p,
.detail-copy p,
.auth-copy p,
.empty-state p,
.panel p {
    color: #dbe4f0;
    line-height: 1.7;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
}

.hero-panel {
    align-items: stretch;
    justify-content: stretch;
}

.stat-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.stat-card strong {
    display: block;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
}

.stat-card span {
    color: var(--muted);
}

.search-bar,
.filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.filter-form input,
.search-bar input,
.filter-form select {
    flex: 1 1 260px;
}

.panel,
.game-card,
.empty-state,
.alert,
.detail-hero {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.game-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.game-card {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        rgba(8, 17, 33, 0.96);
}

.game-cover {
    height: 220px;
    background:
        linear-gradient(180deg, transparent 0%, rgba(6, 10, 18, 0.76) 100%),
        linear-gradient(135deg, var(--accent), transparent),
        center/cover no-repeat;
}

.game-content,
.panel,
.empty-state {
    padding: 24px;
}

.game-content h3,
.pack-card h3,
.order-card h3 {
    font-size: 1.35rem;
    margin-top: 4px;
    margin-bottom: 8px;
}

.meta-row {
    justify-content: space-between;
    margin-top: 20px;
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--brand), #ff5f6d);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.secondary,
.button.ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line);
    color: var(--text);
}

.button.danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

.button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.wide {
    width: 100%;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 36px 0 20px;
}

.section-heading.compact {
    margin-top: 28px;
}

.detail-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    overflow: hidden;
}

.detail-copy {
    padding: 28px;
}

.detail-visual {
    min-height: 260px;
    background:
        linear-gradient(135deg, rgba(6, 182, 212, 0.2), transparent),
        linear-gradient(180deg, transparent 0%, rgba(7, 17, 31, 0.9) 100%),
        center/cover no-repeat;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.pack-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.badge,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.07);
}

.badge-success,
.pill-success,
.pill-paid,
.pill-processing,
.pill-active,
.pill-user {
    background: rgba(34, 197, 94, 0.14);
    color: #7ef5a7;
}

.pill-failed,
.pill-error,
.pill-cancelled,
.pill-hidden,
.pill-admin {
    background: rgba(249, 115, 22, 0.14);
    color: #ffb47a;
}

.pill-pending-payment,
.pill-pending,
.pill-created {
    background: rgba(250, 204, 21, 0.14);
    color: #fde68a;
}

.pill-completed {
    background: rgba(34, 211, 238, 0.14);
    color: #a5f3fc;
}

.price {
    font-size: 2rem;
    font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
}

.auth-shell,
.split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
    align-items: start;
}

.admin-tools-split {
    margin-top: 24px;
}

.auth-copy,
.form-card {
    padding: 28px;
}

.form-card,
.wide-form {
    background: var(--panel-strong);
}

.no-shadow {
    box-shadow: none;
    padding: 0;
    background: transparent;
    border: none;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 16px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

textarea {
    resize: vertical;
}

.summary-card {
    background:
        radial-gradient(circle at top right, rgba(255, 140, 47, 0.12), transparent 38%),
        var(--panel-strong);
}

.summary-row,
.detail-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.summary-row:last-child,
.detail-list > div:last-child {
    border-bottom: none;
}

.summary-row span,
.detail-list strong,
.order-grid strong {
    color: var(--muted);
}

.summary-row.total strong {
    font-size: 1.6rem;
    color: var(--text);
}

.stack-list {
    display: grid;
    gap: 18px;
}

.order-card,
.admin-order-card {
    display: grid;
    gap: 18px;
}

.order-top {
    justify-content: space-between;
}

.order-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.order-grid > div {
    display: grid;
    gap: 6px;
}

.inline-form,
.wide-form,
.stack-actions,
.wide-form .button,
.admin-order-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-order-form {
    align-items: end;
}

.admin-order-form label {
    flex: 1 1 220px;
    margin-bottom: 0;
}

.note-box {
    padding: 18px;
    margin-top: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(8, 17, 33, 0.86);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.data-table th {
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

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

.full-width {
    grid-column: 1 / -1;
}

.alert {
    padding: 14px 18px;
    margin-bottom: 18px;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.11);
}

.alert-error {
    border-color: rgba(249, 115, 22, 0.24);
    background: rgba(249, 115, 22, 0.11);
}

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(4, 10, 20, 0.78);
    padding: 28px 0 40px;
}

code {
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-family: Consolas, "Courier New", monospace;
}

.footer-grid {
    justify-content: space-between;
}

.footer-grid > div {
    flex: 1 1 240px;
}

@media (max-width: 960px) {
    .nav-wrap,
    .main-nav,
    .nav-actions,
    .section-heading,
    .admin-tabs {
        align-items: stretch;
    }

    .nav-wrap,
    .hero,
    .detail-hero,
    .auth-shell,
    .split-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .main-nav,
    .nav-actions,
    .section-heading,
    .admin-tabs,
    .action-row,
    .pack-top,
    .hero-panel {
        justify-content: flex-start;
    }

    .button,
    .button.secondary,
    .button.ghost {
        width: auto;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 100%);
    }

    .page-content {
        padding-top: 26px;
    }

    .hero,
    .detail-copy,
    .auth-copy,
    .form-card,
    .panel,
    .empty-state {
        padding: 20px;
    }

    .hero-copy h1,
    .detail-copy h1,
    .auth-copy h1 {
        font-size: 2rem;
    }

    .order-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }
}
