@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg:       #070707;
    --accent:   #E6FF66;
    --yes:      #39FF14;
    --no:       #FF003C;
    --text:     #ffffff;
    --muted:    #555555;
    --border:   #1a1a1a;
    --font:     'JetBrains Mono', 'Courier New', Courier, monospace;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.topbar-logo {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--accent);
}

.topbar-bal {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
}

.topbar-bal span {
    color: var(--accent);
}

/* ══════════════════════════════════════════
   TACTICAL GRID — 3-COLUMN DESKTOP LAYOUT
══════════════════════════════════════════ */
.tactical-grid {
    display: grid;
    grid-template-columns: 20vw 60vw 20vw;
    height: 100vh;
    overflow: hidden;
    padding-top: 45px; /* topbar height */
}

/* ── SHARED PANEL BASE ── */
.panel {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* ── PANEL HEADER ── */
.panel-header {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── LEFT PANEL ── */
.panel-left {
    border-right: 1px solid var(--border);
}

/* ── KILL FEED ── */
.kill-feed {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kill-feed::-webkit-scrollbar {
    display: none;
}

.kf-entry {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
    word-break: break-all;
}

.kf-liquidated { color: var(--no); }
.kf-profit     { color: var(--yes); }
.kf-bet        { color: var(--muted); }

/* ── CENTER PANEL ── */
.panel-center {
    border-right: 1px solid var(--border);
    overflow: hidden;
}

/* ── SNAP SCROLL CONTAINER ── */
.feed {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.feed::-webkit-scrollbar {
    display: none;
}

/* ── MARKET CARD ── */
.card {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 0 32px;
    position: relative;
    overflow: hidden;
}

/* ── MODE BADGE ── */
.card-mode {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── CARD BODY ── */
.card-body {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── QUESTION ── */
.card-question {
    font-size: clamp(22px, 6vw, 34px);
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 1px;
}

/* ── POOLS ROW ── */
.pools {
    display: flex;
    gap: 32px;
}

.pool {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pool-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
}

.pool-value {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.pool-value.yes { color: var(--yes); }
.pool-value.no  { color: var(--no);  }

/* ── BATTLE BAR ── */
.battle-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.battle-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.battle-bar-labels .lbl-yes { color: var(--yes); }
.battle-bar-labels .lbl-no  { color: var(--no);  }

.battle-bar-track {
    width: 100%;
    height: 4px;
    background: var(--no);
    position: relative;
    overflow: hidden;
}

.battle-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--yes);
    transition: width 0.5s ease;
}

/* ── STAKE ROW ── */
.stake-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stake-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
    flex-shrink: 0;
}

.stake-chips {
    display: flex;
    gap: 6px;
}

.chip {
    background: transparent;
    border: 1px solid var(--muted);
    color: var(--muted);
    font-family: var(--font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 10px;
    cursor: pointer;
    transition: border-color 0.1s, color 0.1s;
}

.chip.active,
.chip:active {
    border-color: var(--accent);
    color: var(--accent);
}

.stake-amount {
    margin-left: auto;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    letter-spacing: 1px;
}

/* ── ACTION BUTTONS ── */
.actions {
    display: flex;
    gap: 10px;
}

.btn-yes,
.btn-no {
    flex: 1;
    background: transparent;
    border: 1px solid;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    padding: 20px 0;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.btn-yes {
    border-color: var(--yes);
    color: var(--yes);
}

.btn-yes:active,
.btn-yes.flash {
    background: var(--yes);
    color: var(--bg);
}

.btn-no {
    border-color: var(--no);
    color: var(--no);
}

.btn-no:active,
.btn-no.flash {
    background: var(--no);
    color: var(--bg);
}

.btn-yes:disabled,
.btn-no:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ── COUNTDOWN ── */
.card-countdown {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: var(--accent);
}

.card-countdown.danger {
    color: var(--no);
    animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
    50% { opacity: 0.15; }
}

/* ── CLOSED BANNER ── */
.closed-banner {
    display: none;
    text-align: center;
    padding: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: var(--accent);
    color: var(--bg);
    margin-bottom: 20px;
}

.card.closed .closed-banner { display: block; }
.card.closed .btn-yes,
.card.closed .btn-no { opacity: 0.2; pointer-events: none; }
.card.closed .chip   { opacity: 0.2; pointer-events: none; }

/* ── SCROLL HINT ── */
.scroll-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
    animation: fadeUpDown 2s ease-in-out infinite;
}

@keyframes fadeUpDown {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
    50%       { opacity: 0.8; transform: translateX(-50%) translateY(-4px); }
}

/* ── GLITCH EFFECT ── */
.glitch {
    position: relative;
    display: inline-block;
    color: var(--no);
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: glitch-main 2.5s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.glitch::before {
    color: var(--yes);
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
    animation: glitch-top 2.5s infinite;
}

.glitch::after {
    color: var(--accent);
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    animation: glitch-bot 2.5s infinite;
}

@keyframes glitch-main {
    0%, 90%, 100% { transform: translate(0); }
    92%           { transform: translate(-2px, 1px); }
    94%           { transform: translate(2px, -1px); }
    96%           { transform: translate(-1px, 2px); }
    98%           { transform: translate(1px, -2px); }
}

@keyframes glitch-top {
    0%, 90%, 100% { transform: translate(0); opacity: 0; }
    92%           { transform: translate(3px, 0); opacity: 0.8; }
    94%           { transform: translate(-3px, 0); opacity: 0.8; }
    96%           { transform: translate(0); opacity: 0; }
}

@keyframes glitch-bot {
    0%, 90%, 100% { transform: translate(0); opacity: 0; }
    93%           { transform: translate(-3px, 0); opacity: 0.8; }
    95%           { transform: translate(3px, 0); opacity: 0.8; }
    97%           { transform: translate(0); opacity: 0; }
}

/* ── CARD ACCENT LINE (top) ── */
.card-accent-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.card-accent-line.standard { background: var(--accent); }
.card-accent-line.survival { background: var(--no); }
.card-accent-line.sniper   { background: var(--yes); }

/* ── TOAST ── */
.toast {
    position: fixed;
    bottom: 28px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-width: 1px;
    border-style: solid;
    background: var(--bg);
    pointer-events: none;
    white-space: nowrap;
}

.toast.success { color: var(--yes); border-color: var(--yes); }
.toast.error   { color: var(--no);  border-color: var(--no);  }

/* ══════════════════════════════════════════
   RIGHT PANEL — CARTEL DASHBOARD
══════════════════════════════════════════ */
.panel-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Top stats section */
.right-top {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.stat-block {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-value {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.stat-value.accent  { color: var(--accent); }
.stat-value.yes-col { color: var(--yes); }
.stat-value.no-col  { color: var(--no); }

/* Utility color classes for trollbox handles */
.accent  { color: var(--accent); }
.yes-col { color: var(--yes); }
.no-col  { color: var(--no); }
.muted   { color: var(--muted); }

/* Rank badge */
.rank-badge {
    display: inline-block;
    border: 1px solid var(--yes);
    color: var(--yes);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    padding: 4px 10px;
    width: fit-content;
}

/* Bottom comm-link section */
.right-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Trollbox stream */
.trollbox {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trollbox::-webkit-scrollbar {
    display: none;
}

.troll-line {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.5px;
    padding: 5px 16px;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
    word-break: break-word;
}

.troll-handle {
    font-weight: 700;
    letter-spacing: 1px;
    margin-right: 6px;
}

.troll-msg {
    color: #888888;
}

/* Comm-link input row */
.comm-input-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    gap: 6px;
    flex-shrink: 0;
}

.comm-prompt {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.comm-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
    caret-color: transparent;
    min-width: 0;
}

.comm-input::placeholder {
    color: transparent;
}

/* Blinking cursor */
.comm-cursor {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    animation: cursor-blink 1s steps(2, start) infinite;
    flex-shrink: 0;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 1024px)
   Hide side panels, center takes full width
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .topbar {
        border-bottom: none;
    }

    .tactical-grid {
        grid-template-columns: 1fr;
        padding-top: 45px;
    }

    #panel-left,
    #panel-right {
        display: none;
    }

    .panel-center {
        width: 100vw;
        border-right: none;
    }

    .feed {
        height: 100%;
    }

    .card {
        height: 100vh;
    }

    /* Restore original mobile card-mode / countdown positions */
    .card-mode {
        top: 72px;
    }

    .card-countdown {
        top: 72px;
    }
}
