:root {
    --bg: #090806;
    --panel: #15120e;
    --panel-2: #1d1811;
    --line: #3b3021;
    --gold: #e3b84b;
    --gold-2: #ffdf83;
    --red: #9f251c;
    --red-2: #d14332;
    --text: #f2eadc;
    --muted: #a99d8b;
    --green: #5bc786;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(159, 37, 28, .22), transparent 32rem),
        radial-gradient(circle at 90% 12%, rgba(227, 184, 75, .10), transparent 26rem),
        var(--bg);
    font: 15px/1.55 Tahoma, Arial, sans-serif;
    min-height: 100vh;
}

a { color: inherit; }
.topbar {
    min-height: 70px;
    padding: 0 4vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(9, 8, 6, .92);
    border-bottom: 1px solid rgba(227, 184, 75, .24);
    backdrop-filter: blur(14px);
}
.brand { text-decoration: none; font-weight: 900; letter-spacing: .11em; font-size: 18px; }
.brand span { color: var(--gold); }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: var(--gold-2); }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 70px; }
.hero-card {
    min-height: calc(100vh - 150px);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 48px;
    align-items: center;
}
.eyebrow { color: var(--gold); letter-spacing: .16em; font-size: 12px; font-weight: 800; margin: 0 0 8px; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; margin-top: 0; }
h1 { font-size: clamp(38px, 6vw, 72px); line-height: 1.02; margin-bottom: 22px; }
h1 span { color: var(--gold-2); }
h2 { font-size: 28px; margin-bottom: 14px; }
h3 { font-size: 25px; margin-bottom: 12px; }
.lead { color: var(--muted); max-width: 680px; font-size: 17px; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.feature-row span { border: 1px solid var(--line); color: #d4c8b6; border-radius: 999px; padding: 8px 13px; }

.auth-grid { display: grid; gap: 18px; }
.panel, .server-card, .balance-card {
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(29, 24, 17, .96), rgba(16, 14, 11, .98));
    box-shadow: 0 22px 60px rgba(0, 0, 0, .32);
}
.panel { padding: 28px; border-radius: 12px; }
.auth-panel { border-top: 3px solid var(--red-2); }
.secondary-panel { border-top-color: var(--gold); }
label { display: block; color: #cfc3b1; font-size: 13px; margin: 12px 0; }
input, select {
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border-radius: 7px;
    border: 1px solid #4a3d2c;
    background: #0c0b09;
    color: #fff;
    outline: none;
    font: inherit;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 184, 75, .1); }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #6b5840;
    border-radius: 7px;
    color: #fff;
    background: #34291c;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: linear-gradient(#c43c2d, #761911); border-color: #d95a4a; }
.button.gold { color: #241a08; background: linear-gradient(#f2d57f, #c8952b); border-color: #ffdf83; }
.button.full { width: 100%; }
.button.small { min-height: 40px; padding: 8px 15px; }
.auth-panel .button { width: 100%; margin-top: 10px; }

.notice { margin-bottom: 20px; border: 1px solid; border-radius: 9px; padding: 13px 16px; }
.notice.success { background: rgba(40, 142, 83, .16); border-color: rgba(91, 199, 134, .45); color: #b9f1cf; }
.notice.error { background: rgba(180, 45, 36, .16); border-color: rgba(209, 67, 50, .5); color: #ffc4bc; }
.notice.info { background: rgba(66, 123, 178, .15); border-color: rgba(96, 162, 224, .45); color: #c8e4ff; }

.account-head { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 24px 0 42px; }
.account-head h1 { font-size: clamp(34px, 5vw, 58px); margin-bottom: 10px; }
.account-head p { color: var(--muted); }
.balance-card { min-width: 280px; padding: 25px; border-radius: 12px; }
.balance-card span { display: block; color: var(--muted); font-size: 13px; }
.balance-card strong { display: block; color: var(--gold-2); font: 700 35px Georgia, serif; margin-top: 6px; }
.balance-card small { font: 700 15px Tahoma, sans-serif; }

.section-block { padding: 34px 0; border-top: 1px solid rgba(227, 184, 75, .14); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.section-title h2 { margin-bottom: 0; font-size: 34px; }
.section-title > p { color: var(--muted); }
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.server-card { border-radius: 12px; padding: 26px; overflow: hidden; position: relative; }
.server-card::after { content: ''; position: absolute; width: 150px; height: 150px; right: -70px; top: -70px; border: 1px solid rgba(227,184,75,.16); transform: rotate(45deg); }
.server-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.server-number { width: 44px; height: 44px; display: grid; place-items: center; background: var(--red); border: 1px solid #e66a5d; border-radius: 6px; font-weight: 900; }
.online-dot { color: var(--green); font-size: 13px; }
.online-dot::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 7px; box-shadow: 0 0 10px var(--green); }
.character-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 18px 0 22px; padding: 15px 0; }
.character-stats div { padding: 0 12px; border-right: 1px solid var(--line); min-width: 0; }
.character-stats div:first-child { padding-left: 0; }
.character-stats div:last-child { border-right: 0; }
.character-stats dt { color: var(--muted); font-size: 12px; }
.character-stats dd { margin: 4px 0 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-character { min-height: 74px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 17px; }

.wallet-grid, .history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wallet-grid > .panel, .history-grid > .panel { height: 100%; }
.wallet-grid p { color: var(--muted); }
.stack-form { margin-top: 22px; }
.rate-note { font-size: 13px; }
.setup-box { border: 1px dashed #6b5840; border-radius: 8px; padding: 18px; color: var(--gold-2); margin-top: 20px; background: rgba(227,184,75,.05); }
.exchange-list { margin-top: 22px; display: grid; gap: 12px; }
.exchange-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.exchange-row strong, .exchange-row span { display: block; }
.exchange-row span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.exchange-row input { margin: 0; padding: 10px; }

.table-panel h2 { font-size: 23px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 450px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 8px; font-size: 13px; }
th { color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.status { display: inline-block; padding: 4px 8px; border: 1px solid #594a37; border-radius: 999px; white-space: nowrap; }
.status-paid, .status-completed { color: #9ce1b8; border-color: #34794f; }
.status-failed, .status-refunded { color: #ffb4aa; border-color: #80382f; }
.status-pending, .status-creating, .status-manual_review { color: #ffe29a; border-color: #846c31; }
footer { text-align: center; color: #756b5e; border-top: 1px solid #231e17; padding: 30px 15px; }

@media (max-width: 850px) {
    .hero-card, .wallet-grid, .history-grid { grid-template-columns: 1fr; }
    .hero-card { padding: 30px 0; }
    .server-grid { grid-template-columns: 1fr; }
    .account-head { align-items: stretch; flex-direction: column; }
    .balance-card { min-width: 0; }
}

@media (max-width: 560px) {
    .topbar { padding: 0 16px; }
    .topbar nav a:not(:last-child) { display: none; }
    .page-shell { width: min(100% - 22px, 1180px); padding-top: 25px; }
    .panel, .server-card { padding: 20px; }
    h1 { font-size: 39px; }
    .feature-row { display: grid; }
    .section-title { align-items: start; flex-direction: column; }
    .character-stats { grid-template-columns: 1fr; gap: 9px; }
    .character-stats div { border-right: 0; padding: 0; display: flex; justify-content: space-between; }
    .exchange-row { grid-template-columns: 1fr 1fr; }
    .exchange-row > div { grid-column: 1 / -1; }
}
