/* =========================================================================
   The Ohana Chill Game Loot X5 — SCUM survival theme
   Palette: dark metal background, olive-green + orange accents.
   Inspired by WARGM (server cards, online charts) and One Dash (dashboards).
   ========================================================================= */

:root {
    --bg: #1a1a1a;
    --bg-elevated: #2a2a2a;
    --bg-soft: #222;
    --border: #383838;
    --border-soft: #303030;

    --green: #5a7d3c;
    --green-bright: #8bc34a;
    --green-dark: #435c2c;
    --orange: #e67e22;
    --orange-dark: #c96812;
    --red: #c0392b;

    --text: #e0e0e0;
    --text-muted: #8f8f8f;
    --heading: #fff;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
    --font: 'Inter', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    /* subtle brushed-metal texture */
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
        radial-gradient(1200px 500px at 50% -10%, rgba(90,125,60,.14), transparent 70%);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100%;
}

h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }

a { color: var(--green-bright); text-decoration: none; }
a:hover { color: var(--orange); }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
code { background: #111; padding: .1em .4em; border-radius: 4px; color: var(--green-bright); }

.container { width: min(1280px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.income { color: var(--green-bright); }
.expense { color: var(--orange); }
.danger { color: var(--red); }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 4px 0; border-bottom: 1px solid var(--border-soft); }

/* ---------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(20, 20, 20, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.logo { display: flex; flex-direction: column; line-height: 1; }
.logo-mark { font-weight: 800; font-size: 1.35rem; letter-spacing: .12em; color: #fff; }
.logo-sub { font-size: .62rem; letter-spacing: .22em; color: var(--green-bright); }

.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    display: block; padding: 8px 12px; border-radius: var(--radius);
    color: var(--text); font-weight: 500; font-size: .95rem;
}
.main-nav a:hover { background: var(--bg-elevated); color: var(--green-bright); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; }

.header-right { display: flex; align-items: center; gap: 10px; }

.online-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text); font-size: .85rem;
}
.online-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.online-badge.is-online .dot { background: var(--green-bright); box-shadow: 0 0 8px var(--green-bright); }
.online-badge.is-offline .dot { background: var(--red); }
.online-count { font-weight: 700; color: #fff; }
.online-label { color: var(--text-muted); }

.cart-link { position: relative; }
.cart-badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--orange); color: #fff; border-radius: 999px;
    font-size: .7rem; padding: 1px 6px; font-weight: 700;
}

.user-menu { position: relative; }
.user-button {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text); padding: 5px 10px; border-radius: var(--radius); cursor: pointer;
}
.user-button img, .avatar-stub {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
    background: var(--green-dark); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
}
.avatar-stub.lg { width: 44px; height: 44px; font-size: .95rem; }
.avatar-stub.xl { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.dropdown a, .link-button {
    display: block; width: 100%; text-align: left; padding: 8px 10px;
    color: var(--text); border-radius: 6px; background: none; border: 0;
    cursor: pointer; font: inherit;
}
.dropdown a:hover, .link-button:hover { background: var(--bg-soft); color: var(--green-bright); }

/* ---------------------------------------------------------------- layout */
.page { padding: 28px 0 64px; }
.page-head { margin-bottom: 20px; }
.page-head.row, .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.section { margin-top: 40px; }
.section-head { margin-bottom: 16px; }
.breadcrumbs { margin-bottom: 12px; }

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}
.card.empty { text-align: center; padding: 40px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius); border: 1px solid transparent;
    font-weight: 600; font-size: .92rem; cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); color: #fff; }
.btn-danger { background: transparent; border-color: var(--red); color: #e8776a; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { background: var(--bg-soft); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-bright); }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { color: var(--green-bright); font-weight: 500; }

/* ---------------------------------------------------------------- hero */
.hero {
    display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px;
    padding: 28px; border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(42,42,42,.96), rgba(30,30,30,.96)),
        repeating-linear-gradient(135deg, rgba(90,125,60,.06) 0 2px, transparent 2px 8px);
}
.hero h1 { font-size: 2.3rem; margin: 10px 0; }
.lead { font-size: 1.05rem; color: #c9c9c9; }
.hero-stats { display: flex; gap: 24px; margin: 20px 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.5rem; color: var(--green-bright); }
.hero-stats span { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.server-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.server-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.status-pill { font-size: .72rem; font-weight: 800; letter-spacing: .1em; padding: 3px 10px; border-radius: 999px; }
.status-pill.on { background: rgba(139,195,74,.15); color: var(--green-bright); border: 1px solid var(--green); }
.status-pill.off { background: rgba(192,57,43,.15); color: #e8776a; border: 1px solid var(--red); }
.server-online-value { font-size: 2rem; font-weight: 800; color: #fff; }
.server-online-value span { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.progress { height: 6px; background: #111; border-radius: 999px; overflow: hidden; margin: 8px 0 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-bright)); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 14px; font-size: .9rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: right; }

.chart-block { margin-bottom: 12px; }
.chart-title { font-size: .8rem; color: var(--text-muted); margin-bottom: 4px; }
.online-chart { width: 100%; height: 80px; display: block; background: #151515; border-radius: 6px; }
.chart-legend { display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------- cards / lists */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
    font-size: .72rem; padding: 2px 8px; border-radius: 999px;
    border: 1px solid var(--green); color: var(--green-bright);
}
.tag-green { border-color: var(--green); color: var(--green-bright); }

.chip {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text); font-size: .87rem; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--green); color: var(--green-bright); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.news-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.news-card-image { display: block; position: relative; aspect-ratio: 16/9; background: #151515; }
.news-card-image img { width: 100%; height: 100%; object-fit: cover; }
.news-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card h3 { font-size: 1rem; margin: 0; }
.news-card-meta { display: flex; justify-content: space-between; margin-top: auto; }
.pin { position: absolute; top: 8px; left: 8px; }
.image-stub {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: #3a3a3a; font-weight: 800; letter-spacing: .3em; font-size: 1.2rem;
    background: repeating-linear-gradient(135deg, #1d1d1d 0 8px, #191919 8px 16px);
}
.image-stub.lg { font-size: 2rem; min-height: 260px; }

.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-image { position: relative; display: block; aspect-ratio: 4/3; background: #151515; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-type {
    position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7);
    color: var(--green-bright); font-size: .7rem; padding: 2px 8px; border-radius: 999px;
}
.product-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { font-size: .98rem; margin: 0; }
.prices { display: flex; gap: 10px; align-items: baseline; }
.prices.lg .price { font-size: 1.5rem; }
.price { font-weight: 800; }
.price-rub { color: var(--orange); }
.price-copper { color: var(--green-bright); }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; gap: 8px; }

.product-detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.product-detail-image img { width: 100%; border-radius: var(--radius); }
.hint { margin-top: 14px; padding: 10px; background: var(--bg-soft); border-radius: var(--radius); border-left: 3px solid var(--green); }

.gallery-card { padding: 0; overflow: hidden; }
.gallery-card figcaption { padding: 10px 12px; display: flex; flex-direction: column; }
.gallery-thumb { display: block; position: relative; aspect-ratio: 16/9; background: #151515; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-badge {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff; text-shadow: 0 2px 12px #000;
}

.list { padding: 0; }
.list-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: 0; }
.list-icon { font-size: 1.4rem; width: 44px; text-align: center; }
.list-icon .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; color: #fff; }
.list-title:hover { color: var(--green-bright); }
.list-stat { text-align: center; min-width: 70px; display: flex; flex-direction: column; }
.list-last { min-width: 190px; }

/* ---------------------------------------------------------------- forum */
.post { display: grid; grid-template-columns: 180px 1fr; gap: 18px; margin-bottom: 14px; }
.post-author { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.post-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.post-actions { display: flex; gap: 12px; margin-top: 10px; }
.quote { border-left: 3px solid var(--green); padding-left: 12px; color: var(--text-muted); margin: 12px 0; }

.badge {
    display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted);
}
.badge-admin { border-color: var(--red); color: #e8776a; }
.badge-moderator { border-color: var(--orange); color: var(--orange); }
.badge-streamer { border-color: #9b59b6; color: #c39bd3; }
.badge-vip { border-color: #f1c40f; color: #f1c40f; }
.badge-player { border-color: var(--border); color: var(--text-muted); }
.badge-ok { border-color: var(--green); color: var(--green-bright); }
.badge-off { border-color: var(--red); color: #e8776a; }
.badge-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 4px; }
.form.narrow { max-width: 520px; margin-inline: auto; }
.form p { margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.form label { font-size: .85rem; color: var(--text-muted); }
.form ul.errorlist { list-style: none; padding: 0; margin: 0 0 8px; color: #e8776a; font-size: .85rem; }
.helptext { font-size: .78rem; color: var(--text-muted); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], input[type=date], select, textarea {
    background: #1c1c1c; border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); padding: 9px 12px; font-family: inherit; font-size: .95rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { resize: vertical; min-height: 96px; }
.qty { width: 76px; }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 200px; }
.search-row select { width: auto; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- misc */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; border-left: 3px solid; }
.alert-success { background: rgba(90,125,60,.13); border-color: var(--green); }
.alert-info { background: rgba(52,152,219,.1); border-color: #3498db; }
.alert-warning { background: rgba(230,126,34,.12); border-color: var(--orange); }
.alert-error, .alert-danger { background: rgba(192,57,43,.12); border-color: var(--red); }
.messages { margin-top: 16px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.stat-value { font-size: 1.7rem; font-weight: 800; color: #fff; }
.stat-value.small { font-size: 1.05rem; }

.wallet-mini { display: flex; gap: 16px; align-items: center; padding: 10px 16px; }

.article { max-width: 900px; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 16px; }
.article-body { color: #cfcfcf; }
.article-meta { margin-bottom: 14px; }

.code-box { background: #111; border: 1px dashed var(--green); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.code-value { font-family: ui-monospace, monospace; font-size: 1.3rem; color: var(--green-bright); letter-spacing: .06em; margin: 6px 0 12px; }

.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; gap: 16px; flex-wrap: wrap; }

.video-wrap { position: relative; padding-top: 56.25%; margin-bottom: 16px; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

.map-canvas { height: 620px; padding: 0; overflow: hidden; }
.leaflet-container { background: #101210; }

.chat-log { max-height: 320px; overflow-y: auto; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }

.panel-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-nav a {
    padding: 7px 14px; border-radius: var(--radius); background: var(--bg-elevated);
    border: 1px solid var(--border); color: var(--text); font-size: .9rem;
}
.panel-nav a:hover { border-color: var(--green); color: var(--green-bright); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; }

.profile-head { display: flex; gap: 20px; align-items: center; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: #141414; padding: 32px 0 20px; margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-title { color: #fff; font-weight: 600; margin-bottom: 8px; }
.site-footer a { display: block; padding: 2px 0; color: var(--text); font-size: .9rem; }
.site-footer a:hover { color: var(--green-bright); }
.footer-bottom { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: .82rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-6 { grid-template-columns: repeat(4, 1fr); }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .hero, .product-detail, .two-col, .footer-inner { grid-template-columns: 1fr; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .post { grid-template-columns: 1fr; }
    .post-author { flex-direction: row; }
    .nav-toggle { display: block; }
    .main-nav ul { display: none; position: absolute; left: 0; right: 0; top: 64px;
        flex-direction: column; background: var(--bg-elevated); border-bottom: 1px solid var(--border); padding: 8px; }
    .main-nav ul.is-open { display: flex; }
    .list-last { display: none; }
}
@media (max-width: 560px) {
    .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr; }
    .online-label { display: none; }
}
