/* =========================================================
   KbMuShopping — Design tokens
   Direção: HUD de inventário de MMORPG. Painéis com "cantos"
   de interface de jogo, dourado antigo para a loja de Gold,
   cristal/azul para a loja de Cash.
   ========================================================= */
:root {
    --bg:          #0b0a10;
    --surface:     #16131d;
    --surface-2:   #1d1926;
    --border:      #2a2433;
    --border-soft: #221d2b;

    --text:        #ece7f5;
    --text-muted:  #a89bbf;
    --text-faint:  #6f6480;

    --gold:        #c9a13b;
    --gold-bright: #e8c874;
    --cash:        #5aa9e6;
    --cash-bright: #8fd0ff;

    --success: #6fcf7a;
    --danger:  #e0645a;

    --radius: 3px;
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Contexto de moeda: troca o accent em blocos marcados com .ctx-gold / .ctx-cash */
.ctx-gold { --accent: var(--gold); --accent-bright: var(--gold-bright); }
.ctx-cash { --accent: var(--cash); --accent-bright: var(--cash-bright); }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

body {
    background-image:
        radial-gradient(ellipse at top, rgba(201,161,59,0.06), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(90,169,230,0.05), transparent 55%);
    min-height: 100vh;
}

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

h1, h2, h3, .display {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    font-weight: 600;
    margin: 0 0 0.5em;
}

.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------
   Painel com cantos de HUD — elemento assinatura da interface
   --------------------------------------------------------- */
.panel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.panel::before, .panel::after,
.panel .corner-tl, .panel .corner-br {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent, var(--gold));
    opacity: 0.55;
    transition: opacity .2s ease;
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.panel::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.panel:hover::before, .panel:hover::after { opacity: 1; }

/* ---------------------------------------------------------
   Topbar
   --------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(13, 11, 18, 0.85);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.08em;
    color: var(--gold-bright);
    text-transform: uppercase;
}
.brand span { color: var(--cash-bright); }

.nav { display: flex; gap: 6px; }
.nav a {
    padding: 8px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius);
}
.nav a:hover { color: var(--text); }
.nav a.active {
    color: var(--gold-bright);
    border-color: var(--border);
    background: var(--surface-2);
}
.nav a.active.cash { color: var(--cash-bright); }

.account-box {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
}
.balance-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--font-mono);
    background: var(--surface-2);
}
.balance-pill.gold { color: var(--gold-bright); }
.balance-pill.cash { color: var(--cash-bright); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */
.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}
.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
}
.sidebar { position: sticky; top: 84px; }
.sidebar h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 12px;
}
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li a {
    display: block;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.cat-list li a:hover { color: var(--text); background: var(--surface); }
.cat-list li a.active {
    color: var(--accent-bright, var(--gold-bright));
    border-left-color: var(--accent, var(--gold));
    background: var(--surface);
}

/* ---------------------------------------------------------
   Grade de itens
   --------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .15s ease, border-color .15s ease;
}
.item-card:hover {
    border-color: var(--accent, var(--gold));
    transform: translateY(-2px);
}
.item-thumb {
    aspect-ratio: 1;
    background:
        linear-gradient(160deg, var(--surface-2), var(--bg));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--accent, var(--gold));
    opacity: 0.85;
}
.item-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.item-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}
.item-price {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 13px;
}
.price-highlight {
    color: var(--accent-bright, var(--gold-bright));
    font-weight: 700;
    font-size: 15px;
}
.sold-highlight {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.sold-highlight strong {
    color: var(--success);
    font-weight: 700;
}

/* ---------------------------------------------------------
   Botões / formulários
   --------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: all .15s ease;
}
.btn:hover { border-color: var(--accent, var(--gold)); color: var(--accent-bright, var(--gold-bright)); }
.btn-primary {
    background: var(--accent, var(--gold));
    border-color: var(--accent, var(--gold));
    color: #17140d;
}
.btn-primary:hover { background: var(--accent-bright, var(--gold-bright)); color: #17140d; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
input[type=text], input[type=password], input[type=number], select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent, var(--gold));
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent, var(--gold)); }
.range-value { font-family: var(--font-mono); min-width: 28px; text-align: right; color: var(--accent-bright, var(--gold-bright)); }

/* ---------------------------------------------------------
   Página de produto
   --------------------------------------------------------- */
.product-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
}
.product-preview .item-thumb { font-size: 48px; margin-bottom: 16px; }
.stat-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border-soft); }
.stat-row span:last-child { color: var(--text-muted); font-family: var(--font-mono); }

.price-summary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.price-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 22px;
    color: var(--accent-bright, var(--gold-bright));
    margin-bottom: 14px;
}
.price-total small { font-size: 12px; color: var(--text-faint); font-family: var(--font-body); }

/* ---------------------------------------------------------
   Auth / mensagens
   --------------------------------------------------------- */
.center-screen {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gold-coin-icon {
    position: relative;
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #f7d878;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fff0a6 0 8%, #e8b83f 35%, #9b6815 78%);
    box-shadow: 0 0 0 3px #7c5010, inset 0 0 0 3px rgba(92, 55, 5, 0.45), 0 7px 16px rgba(0, 0, 0, 0.35);
    color: #5b3707;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 244, 175, 0.7);
}
.gold-coin-icon::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(104, 61, 5, 0.55);
    border-radius: 50%;
}
.auth-card { width: 360px; }
.auth-card h1 { font-size: 22px; text-align: center; color: var(--gold-bright); }
.auth-sub { text-align: center; color: var(--text-faint); font-size: 13px; margin-bottom: 24px; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-error { background: rgba(224,90,90,0.08); border-color: rgba(224,90,90,0.4); color: #f2a9a3; }
.alert-success { background: rgba(111,207,122,0.08); border-color: rgba(111,207,122,0.4); color: #b7e6bd; }

/* ---------------------------------------------------------
   Histórico
   --------------------------------------------------------- */
.order-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-table th {
    text-align: left;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.order-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-completed { background: rgba(111,207,122,0.12); color: var(--success); }
.badge-recovered { background: rgba(90,169,230,0.12); color: var(--cash-bright); }
.badge-failed { background: rgba(224,90,90,0.12); color: var(--danger); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
}
.empty-state .display { color: var(--text-muted); font-size: 20px; }

footer {
    text-align: center;
    padding: 24px;
    color: var(--text-faint);
    font-size: 12px;
}

@media (max-width: 800px) {
    .shop-layout, .product-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .topbar { flex-direction: column; gap: 12px; padding: 14px; }
    .nav { flex-wrap: wrap; justify-content: center; }
}
