:root {
    --ink: #151715;
    --muted: #6b6258;
    --paper: #f6f1e6;
    --panel: #fffdf7;
    --line: #d9c9ad;
    --jade: #1f7358;
    --jade-dark: #15503f;
    --red: #9d272b;
    --red-dark: #71191d;
    --gold: #c79843;
    --blue: #264f73;
    --shadow: 0 18px 46px rgba(32, 24, 17, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(16px, 4vw, 54px);
    background: rgba(16, 18, 18, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(14px);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff8ea;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.wordmark:hover {
    text-decoration: none;
}

.wordmark img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(245, 199, 111, 0.55);
    background: #fff8ea;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
}

.site-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(255, 248, 234, 0.86);
    font-size: 14px;
    font-weight: 700;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    text-decoration: none;
}

.home-hero {
    position: relative;
    min-height: min(720px, 76svh);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: clamp(24px, 4vw, 64px);
    padding: clamp(46px, 8vw, 112px) clamp(18px, 5vw, 72px) clamp(42px, 7vw, 82px);
    overflow: hidden;
    color: #fff9ee;
    background:
        linear-gradient(90deg, rgba(9, 11, 13, 0.88) 0%, rgba(21, 23, 21, 0.62) 45%, rgba(9, 11, 13, 0.25) 100%),
        url("/assets/ban-long-kich-hero.png") center / cover no-repeat;
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(246, 241, 230, 0), var(--paper));
    pointer-events: none;
}

.hero-copy,
.server-strip {
    position: relative;
    z-index: 1;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 8px;
    color: inherit;
    opacity: 0.74;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.home-hero h1 {
    margin: 0;
    color: #fff8e8;
    font-size: clamp(48px, 9vw, 112px);
    line-height: 0.94;
    font-weight: 900;
    text-shadow: 0 9px 28px rgba(0, 0, 0, 0.38);
}

.hero-lead {
    max-width: 660px;
    margin: 22px 0 0;
    color: rgba(255, 249, 238, 0.9);
    font-size: clamp(17px, 2vw, 22px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.button,
button,
.link-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover,
button:hover,
.link-button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.button.primary,
button {
    background: linear-gradient(180deg, #bd3438, var(--red-dark));
    color: #fff;
    box-shadow: 0 14px 30px rgba(113, 25, 29, 0.25);
}

.button.ghost {
    border-color: rgba(250, 216, 147, 0.58);
    background: rgba(255, 248, 234, 0.12);
    color: #fff8ea;
}

.button.quiet {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(255, 248, 234, 0.9);
}

button.secondary {
    background: var(--blue);
}

.server-strip {
    width: min(470px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    border: 1px solid rgba(255, 224, 154, 0.28);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(6, 8, 8, 0.46);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
}

.server-strip div {
    min-height: 86px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.065);
}

.server-strip dt {
    margin: 0;
    color: rgba(255, 248, 234, 0.62);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.server-strip dd {
    margin: 7px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff8ea;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #a94747;
    box-shadow: 0 0 0 4px rgba(169, 71, 71, 0.18);
}

.dot.on {
    background: #4ad18e;
    box-shadow: 0 0 0 4px rgba(74, 209, 142, 0.18);
}

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

.page-band {
    padding: clamp(42px, 7vw, 84px) 0;
}

.account-band {
    background: var(--paper);
}

.rewards-band {
    background:
        linear-gradient(180deg, rgba(31, 115, 88, 0.08), rgba(38, 79, 115, 0.07)),
        #f8f5ee;
}

.payment-band {
    background: #efe7d8;
}

.download-band {
    background: #18201f;
    color: #fff8ea;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.02;
}

.section-heading p:not(.eyebrow) {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
}

.download-band .section-heading p:not(.eyebrow),
.download-band .section-heading .eyebrow {
    color: rgba(255, 248, 234, 0.72);
}

.grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

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

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

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.panel,
.event-card,
.cta-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--shadow);
}

.panel {
    margin-top: 18px;
    padding: 24px;
}

.grid .panel {
    margin-top: 0;
}

.accent-panel {
    border-top: 4px solid var(--gold);
}

.event-card {
    min-height: 210px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-card h3,
.panel h3,
.cta-panel h3 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.18;
}

.event-card p,
.cta-panel p {
    margin: 0;
    color: var(--muted);
}

.card-kicker {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border: 1px solid rgba(199, 152, 67, 0.55);
    border-radius: 8px;
    color: var(--red);
    background: rgba(199, 152, 67, 0.11);
    font-weight: 900;
}

.cta-panel {
    padding: 26px;
}

.history-panel {
    margin-top: 18px;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}

.ops-list {
    display: grid;
    gap: 10px;
}

.ops-list a {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 248, 234, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff8ea;
}

.ops-list a:hover {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.ops-list span {
    color: rgba(255, 248, 234, 0.68);
    text-align: right;
}

h2 {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.2;
}

h3 {
    color: var(--ink);
}

form {
    display: grid;
    gap: 10px;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cdbb9f;
    border-radius: 8px;
    background: #fffaf1;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(31, 115, 88, 0.25);
    border-color: var(--jade);
}

textarea {
    resize: vertical;
    font-family: Consolas, Monaco, monospace;
    line-height: 1.45;
}

.note {
    margin: 14px 0 0;
    color: var(--muted);
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(32, 24, 17, 0.08);
}

.alert.success {
    border-color: rgba(31, 115, 88, 0.35);
    color: var(--jade-dark);
}

.alert.error {
    border-color: rgba(157, 39, 43, 0.35);
    color: var(--red);
}

.account-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.account-card .link-button {
    border-color: var(--line);
    background: #f3e7d4;
    color: var(--red);
}

.metric {
    margin-top: 24px;
    padding: 18px;
    border-left: 4px solid var(--gold);
    background: #f4ead7;
    border-radius: 8px;
}

.metric span,
.metric strong {
    display: block;
}

.metric strong {
    margin-top: 2px;
    font-size: 36px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.table {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr 0.7fr;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: #fffaf1;
}

.row:first-child {
    border-top: 0;
}

.row.head {
    background: #eadcc5;
    color: var(--muted);
    font-weight: 800;
}

.row small {
    color: var(--muted);
}

.cards .row {
    grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr 1.1fr;
}

.process-table .row {
    grid-template-columns: 0.9fr 0.5fr 0.5fr 0.7fr 2fr;
}

.account-table .row {
    grid-template-columns: 0.35fr 1.25fr 0.75fr 0.55fr 0.55fr 0.75fr 0.75fr 1fr;
}

.payment-table .row {
    grid-template-columns: 1fr 1fr 0.8fr 0.8fr 0.8fr 1fr;
}

.legacy-table .row {
    grid-template-columns: 0.4fr 1.3fr 0.8fr 0.8fr 1fr 1fr;
}

.audit-table .row {
    grid-template-columns: 1fr 0.9fr 1fr 1fr 0.8fr 1.5fr;
}

.badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.badge.ok {
    background: rgba(31, 115, 88, 0.13);
    color: var(--jade-dark);
}

.badge.warn {
    background: rgba(199, 152, 67, 0.18);
    color: #7b5419;
}

.badge.bad {
    background: rgba(157, 39, 43, 0.13);
    color: var(--red);
}

.mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px clamp(16px, 4vw, 54px);
    border-top: 1px solid #dfd2bc;
    color: var(--muted);
    background: #f8f4ec;
}

/* Admin and shared operation pages */
.hero {
    min-height: 190px;
    padding: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid rgba(255, 224, 154, 0.26);
    background:
        linear-gradient(90deg, rgba(12, 15, 16, 0.88), rgba(36, 31, 25, 0.62)),
        url("/assets/ban-long-kich-hero.png") center / cover no-repeat;
    color: #fff8ea;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero.compact {
    min-height: 140px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    background: #fff8ea;
    border: 1px solid rgba(245, 199, 111, 0.55);
    border-radius: 8px;
}

.brand h1 {
    margin: 0;
    color: #fff8ea;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.status span,
.status a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid rgba(255, 248, 234, 0.42);
    border-radius: 8px;
    background: rgba(255, 248, 234, 0.12);
    color: #fff8ea;
    font-size: 14px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.92);
    color: var(--ink);
    font-weight: 800;
}

.tabs a.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.metric-card {
    min-height: 118px;
    margin-top: 0;
}

.metric-card span {
    color: var(--muted);
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.status-list {
    display: grid;
    gap: 10px;
}

.status-list span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.form-grid label {
    display: grid;
    gap: 6px;
}

.checkline {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
    min-height: 42px;
}

.checkline input,
.check-row input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.inline-form {
    display: inline-grid;
    margin: 0 4px 4px 0;
}

.inline-form button {
    min-height: 34px;
    margin-top: 0;
    padding: 6px 10px;
    font-size: 14px;
}

.inline-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}

.inline-search input {
    width: auto;
}

.checklist {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.check-row {
    display: grid;
    grid-template-columns: 28px minmax(180px, 1fr) minmax(220px, 0.8fr);
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf1;
}

.check-row span {
    color: var(--ink);
}

.narrow {
    max-width: 520px;
}

@media (max-width: 980px) {
    .home-hero {
        align-items: flex-start;
        flex-direction: column;
        justify-content: flex-end;
    }

    .server-strip,
    .feature-grid,
    .split-layout,
    .two,
    .account-grid,
    .stats,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .server-strip {
        max-width: 680px;
    }
}

@media (max-width: 720px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
        width: 100vw;
        max-width: 100vw;
        overflow: hidden;
        padding: 10px;
    }

    .site-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow-x: visible;
        white-space: normal;
        gap: 6px;
        padding-bottom: 2px;
    }

    .site-nav a {
        width: 100%;
        min-height: 34px;
        justify-content: center;
        padding: 6px 10px;
    }

    .home-hero {
        min-height: auto;
        padding: 44px 16px 46px;
    }

    .home-hero h1 {
        font-size: 48px;
    }

    .hero-actions,
    .site-footer,
    .account-head,
    .brand,
    .status,
    .hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .button,
    .hero-actions .button {
        width: 100%;
    }

    .shell {
        width: min(100% - 20px, 1160px);
    }

    .panel,
    .event-card,
    .cta-panel {
        padding: 18px;
    }

    .brand img {
        width: 82px;
        height: 82px;
    }

    .ops-list a {
        align-items: flex-start;
        flex-direction: column;
    }

    .ops-list span {
        text-align: left;
    }

    .row,
    .cards .row,
    .process-table .row,
    .account-table .row,
    .payment-table .row,
    .legacy-table .row,
    .audit-table .row,
    .check-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
