/* ── Reset & Base ─────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Oswald', sans-serif;
    background: #000 url('../img/stock-market-bg.gif') center/cover no-repeat fixed;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ── Access gate ──────────────────────────────────────────────── */
body.access-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: auto;
    padding: 40px 20px;
}
.access-gate { width: 100%; display: flex; justify-content: center; }
.access-card {
    width: 100%; max-width: 420px;
    background: rgba(0,0,0,0.85);
    border: 1px solid rgba(0,255,149,0.5);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: flex; flex-direction: column; gap: 14px;
}
.access-card h1 { font-size: 1.9rem; text-transform: uppercase; letter-spacing: 3px; text-align: center; }
.access-copy { font-size: 0.95rem; color: rgba(255,255,255,0.75); text-align: center; }
.access-error {
    padding: 10px 14px;
    background: rgba(255,99,99,0.18);
    border: 1px solid rgba(255,99,99,0.6);
    border-radius: 8px; color: #ff7575; text-align: center;
}
.access-card label { font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.8); }
.access-card input {
    padding: 12px 14px; border-radius: 8px;
    border: 1px solid rgba(0,255,149,0.5);
    background: rgba(255,255,255,0.05); color: #fff; font-size: 1rem;
}
.access-card input:focus { outline: none; border-color: #00ff95; box-shadow: 0 0 0 3px rgba(0,255,149,0.25); }
.access-card button {
    margin-top: 6px; padding: 12px 18px;
    border-radius: 8px; border: none;
    background: linear-gradient(135deg, #0b3e27, #197149);
    color: #fff; font-size: 1rem; font-weight: 600;
    cursor: pointer; letter-spacing: 1px; text-transform: uppercase;
}
.access-card button:hover { filter: brightness(1.15); }

/* ── Two-board layout ─────────────────────────────────────────── */
.boards-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    min-height: calc(100vh - 50px);
    padding: 10px 6px 60px 6px;
}

.board-panel {
    flex: 1 1 50%;
    min-width: 0;
    padding: 8px 8px 0 8px;
}

.boards-divider {
    width: 3px;
    background: linear-gradient(180deg, #197149, #0b3e27, #197149);
    align-self: stretch;
    border-radius: 2px;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ── Board label (BOARD 1 / BOARD 2) ─────────────────────────── */
.board-label {
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* ── Top bar (Leader + Target) ────────────────────────────────── */
.board-topbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.leader-card, .target-card {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 10px;
    font-weight: 700;
    min-height: 64px;
}

.leader-card {
    background: linear-gradient(90deg, #0b3e27, #197149);
}

.target-card {
    background: url('../img/dollar.jpg') center/180px;
    position: relative;
    overflow: hidden;
}
.target-card::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
}
.target-card .label-sm,
.target-card .value-lg { position: relative; z-index: 1; }

.label-sm {
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2px;
}

.value-lg {
    font-size: 1.1rem;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}

/* ── topTabHolder from ret board (rendered via leaderboard.ajax.php) */
.topTabHolder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.topTabHolder .leader {
    flex: 1 1 50%;
    background: linear-gradient(90deg, #0b3e27, #197149);
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topTabHolder .targetDiv {
    flex: 1 1 50%;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    background: url('../img/dollar.jpg') center/180px;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    position: relative;
    overflow: hidden;
    min-height: 64px;
    display: flex; align-items: center; justify-content: center;
}
.topTabHolder .targetDiv::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
}
.topTabHolder .targetDiv span { position: relative; z-index: 1; }

/* ── Tables ───────────────────────────────────────────────────── */
.board-table, #db-board table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.board-table th, .board-table td,
#db-board table th, #db-board table td {
    padding: 5px 6px;
    border: 1px solid rgba(255,215,0,0.2);
    text-align: center;
}

.board-table thead, #db-board table thead {
    background: linear-gradient(90deg, #0b3e27, #197149);
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.board-table tbody tr, #db-board table tbody tr {
    background: #1a1a1a;
    transition: background 0.2s;
}

.board-table tbody tr:hover, #db-board table tbody tr:hover {
    background: #2a2a2a;
}

/* Leader row highlight */
.leader-row, #db-board table tbody tr.leaderRow,
#db-board table tbody tr:first-child {
    background: linear-gradient(90deg, #0b3e27, #197149) !important;
    color: #fff;
    font-weight: bold;
}

/* Totals row */
.totals, #db-board table tr.totals {
    background: rgba(0,200,80,0.2) !important;
    color: #00ff95;
    font-weight: bold;
    font-size: 0.82rem;
}

/* Cell colours */
.cell-success { background: #1a5c2a !important; color: #fff; font-weight: bold; }
.cell-danger  { background: #7a1a1a !important; color: #fff; font-weight: bold; }

.gold   { background: #b8860b !important; color: #000; font-weight: bold; }
.silver { background: #808080 !important; color: #000; font-weight: bold; }
.bronze { background: #8c4a1e !important; color: #fff; font-weight: bold; }

.bgGreen { background: #1a5c2a !important; color: #fff; }

/* ── Money rain ───────────────────────────────────────────────── */
@keyframes moneyFall {
    0%   { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh)  rotate(360deg); opacity: 0; }
}
.money {
    position: fixed; top: -50px; z-index: 0;
    animation: moneyFall linear forwards;
    pointer-events: none;
}

/* ── Event overlay ────────────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 9999;
}
.hidden { display: none !important; }
.overlay-dark {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease forwards;
}
.overlay-content {
    position: relative; z-index: 2;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.explosion {
    height: 65vh;
    animation: boom 0.6s ease-out forwards;
}
.player-name {
    font-size: 2.5rem; font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 10px #fff, 0 0 20px #ff0;
    margin-top: 16px;
    animation: popIn 0.6s ease forwards;
}

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes boom {
    0%   { transform: scale(0.5) rotate(0deg);  opacity: 0; }
    50%  { transform: scale(1.2) rotate(20deg); opacity: 1; }
    100% { transform: scale(1)   rotate(0deg);  opacity: 1; }
}
@keyframes popIn {
    0%   { transform: scale(0);   opacity: 0; }
    80%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* ── TradingView ticker ───────────────────────────────────────── */
.tradingview-widget-container {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
}
