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

html, body { height: 100%; }

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

/* ── Access gate ──────────────────────────────────────────────── */
body.access-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; 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); }

/* ── Sound unlock button ──────────────────────────────────────── */
#soundUnlockBtn {
    position: fixed; top: 14px; right: 16px; z-index: 200;
    padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(255,215,0,0.6);
    background: rgba(0,0,0,0.75); color: #FFD700; font-family: 'Oswald', sans-serif;
    font-size: 0.85rem; letter-spacing: 0.5px; cursor: pointer;
    box-shadow: 0 0 16px rgba(255,215,0,0.25);
    animation: soundBtnPulse 1.8s ease-in-out infinite;
}
#soundUnlockBtn:hover { background: rgba(0,0,0,0.9); filter: brightness(1.15); }
@keyframes soundBtnPulse {
    0%,100% { box-shadow: 0 0 10px rgba(255,215,0,0.2); }
    50%     { box-shadow: 0 0 22px rgba(255,215,0,0.5); }
}

/* ── BOSS BAR ─────────────────────────────────────────────────── */
.boss-bar {
    flex-shrink: 0;
    display: flex; justify-content: center; align-items: center;
    padding: 18px 20px 12px;
}

.boss-card {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    gap: 28px; padding: 20px 60px;
    border-radius: 16px;
    background: linear-gradient(105deg, #061f13 0%, #0f5233 40%, #197149 60%, #061f13 100%);
    border: 2px solid #FFD700;
    box-shadow: 0 0 0 1px rgba(255,215,0,0.15), 0 0 30px rgba(255,215,0,0.25), 0 8px 40px rgba(0,0,0,0.7);
    overflow: hidden; min-width: 520px;
}
.boss-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,215,0,0.07) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.boss-crown {
    font-size: 2.2rem; line-height: 1;
    filter: drop-shadow(0 0 8px rgba(255,215,0,0.8));
    animation: crownPulse 2s ease-in-out infinite;
}
@keyframes crownPulse {
    0%,100% { transform: scale(1);    filter: drop-shadow(0 0 8px rgba(255,215,0,0.8)); }
    50%      { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(255,215,0,1)); }
}
.boss-info { display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; z-index: 1; }
.boss-title { font-size: 0.7rem; letter-spacing: 5px; text-transform: uppercase; color: rgba(255,215,0,0.7); }
.boss-name  { font-size: 2.4rem; font-weight: 700; color: #fff; letter-spacing: 3px; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0,0,0,0.6); line-height: 1.1; }
.boss-amount{ font-size: 2rem; font-weight: 700; color: #FFD700; letter-spacing: 2px; text-shadow: 0 0 12px rgba(255,215,0,0.6), 0 2px 4px rgba(0,0,0,0.6); }

/* ── BOARDS LAYOUT ────────────────────────────────────────────── */
.boards-wrapper {
    flex: 1;
    display: flex; flex-direction: row;
    align-items: flex-end;
    width: 100%;
    padding: 20px 6px 58px 6px;
}

.board-panel { flex: 1 1 50%; min-width: 0; padding: 6px; transition: opacity 0.25s ease; }
.board-panel.board-fading { opacity: 0; }

.boards-divider {
    width: 2px; align-self: stretch;
    background: linear-gradient(180deg, transparent 0%, #197149 20%, #FFD700 50%, #197149 80%, transparent 100%);
    opacity: 0.5; flex-shrink: 0;
}

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

/* ── Leader + Target ──────────────────────────────────────────── */
.board-topbar { display: flex; gap: 6px; margin-bottom: 6px; }

.leader-card, .target-card {
    flex: 1 1 50%; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 8px 6px; border-radius: 8px; font-weight: 700; min-height: 56px;
}
.leader-card { background: linear-gradient(90deg, #0b3e27, #197149); border: 1px solid rgba(0,255,149,0.2); }
.target-card { background: url('../img/dollar.jpg') center/180px; position: relative; overflow: hidden; border: 1px solid rgba(255,215,0,0.2); }
.target-card::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.58); }
.target-card .label-sm, .target-card .value-lg { position: relative; z-index: 1; }

.label-sm { font-size: 0.6rem; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.65); margin-bottom: 2px; }
.value-lg { font-size: 1rem; color: #FFD700; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }

/* ── ret topTabHolder ─────────────────────────────────────────── */
.topTabHolder { display: flex; gap: 6px; margin-bottom: 6px; }
.topTabHolder .leader {
    flex: 1 1 50%; background: linear-gradient(90deg, #0b3e27, #197149);
    border: 1px solid rgba(0,255,149,0.2);
    padding: 8px 6px; border-radius: 8px; font-size: 1rem; font-weight: bold;
    text-align: center; min-height: 56px; display: flex; align-items: center; justify-content: center;
}
.topTabHolder .targetDiv {
    flex: 1 1 50%; padding: 8px 6px; border-radius: 8px; font-size: 1rem; font-weight: bold;
    text-align: center; background: url('../img/dollar.jpg') center/180px;
    color: #FFD700; border: 1px solid rgba(255,215,0,0.2);
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
    position: relative; overflow: hidden; min-height: 56px;
    display: flex; align-items: center; justify-content: center;
}
.topTabHolder .targetDiv::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.58); }
.topTabHolder .targetDiv span { position: relative; z-index: 1; }

/* ── Tables ───────────────────────────────────────────────────── */
.board-table, .db-board table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: clamp(0.65rem, 1vw, 1.1rem); }
.board-table th, .board-table td,
.db-board table th, .db-board table td {
    padding: clamp(3px, 0.55vw, 11px) clamp(3px, 0.5vw, 10px);
    border: 1px solid rgba(255,215,0,0.15); text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Fiksne sirine kolona, identicne za sva 3 boarda: # | Agent | Daily | Monthly | FTD | Withdraw | Player Value | Success */
.board-table th:nth-child(1), .board-table td:nth-child(1),
.db-board table th:nth-child(1), .db-board table td:nth-child(1) { width: 6%; }
.board-table th:nth-child(2), .board-table td:nth-child(2),
.db-board table th:nth-child(2), .db-board table td:nth-child(2) { width: 18%; text-align: left; }
.board-table th:nth-child(3), .board-table td:nth-child(3),
.db-board table th:nth-child(3), .db-board table td:nth-child(3) { width: 12%; }
.board-table th:nth-child(4), .board-table td:nth-child(4),
.db-board table th:nth-child(4), .db-board table td:nth-child(4) { width: 12%; }
.board-table th:nth-child(5), .board-table td:nth-child(5),
.db-board table th:nth-child(5), .db-board table td:nth-child(5) { width: 10%; }
.board-table th:nth-child(6), .board-table td:nth-child(6),
.db-board table th:nth-child(6), .db-board table td:nth-child(6) { width: 12%; }
.board-table th:nth-child(7), .board-table td:nth-child(7),
.db-board table th:nth-child(7), .db-board table td:nth-child(7) { width: 15%; }
.board-table th:nth-child(8), .board-table td:nth-child(8),
.db-board table th:nth-child(8), .db-board table td:nth-child(8) { width: 15%; }
.board-table thead, .db-board table thead {
    background: linear-gradient(90deg, #0b3e27, #197149);
    color: #fff; font-size: clamp(0.6rem, 0.85vw, 1rem); letter-spacing: 0.5px; text-transform: uppercase;
}
.board-table tbody tr, .db-board table tbody tr { background: rgba(20,20,20,0.85); transition: background 0.15s; }
.board-table tbody tr:nth-child(even), .db-board table tbody tr:nth-child(even) { background: rgba(30,30,30,0.85); }
.board-table tbody tr:hover, .db-board table tbody tr:hover { background: rgba(44,44,44,0.9); }

.leader-row, .db-board table tbody tr.leaderRow {
    background: linear-gradient(90deg, #0b3e27, #197149) !important; font-weight: bold;
}
.db-board table tbody tr.silverRow {
    background: linear-gradient(90deg, #3a3a3a, #666) !important; font-weight: bold;
}
.db-board table tbody tr.bronzeRow {
    background: linear-gradient(90deg, #3d1f0a, #6b3515) !important; font-weight: bold;
}
.totals, .db-board table tr.totals {
    background: rgba(0,180,70,0.15) !important; color: #00ff95;
    font-weight: bold; border-top: 1px solid rgba(0,255,149,0.3);
}

.cell-success { background: #1a5c2a !important; color: #fff; font-weight: bold; }
.cell-danger  { background: #7a1a1a !important; color: #fff; font-weight: bold; }
.gold   { background: linear-gradient(90deg,#7a5800,#b8860b) !important; color: #fff; font-weight: bold; }
.silver { background: linear-gradient(90deg,#555,#888) !important; color: #fff; font-weight: bold; }
.bronze { background: linear-gradient(90deg,#5a2e0e,#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; }

/* ── 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.72); 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.8rem; font-weight: bold; color: #FFD700; text-shadow: 0 0 12px #fff, 0 0 24px #ff0; margin-top: 16px; animation: popIn 0.6s ease forwards; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes boom { 0% { transform: scale(0.4) rotate(0deg); opacity:0; } 55% { transform: scale(1.2) rotate(15deg); 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 ──────────────────────────────────────────────── */
.tradingview-widget-container { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; height: 46px; background: rgba(0,0,0,0.6); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */

/* 1920px+ — ultra wide */
@media (min-width: 1920px) {
    .boss-name { font-size: 3.4rem; }
    .boss-amount { font-size: 2.8rem; }
    .boss-card { padding: 28px 100px; gap: 40px; }
    .boss-crown { font-size: 3.2rem; }
}

/* 1600–1919px — veliki ekran */
@media (min-width: 1600px) and (max-width: 1919px) {
    .boss-name { font-size: 3rem; }
    .boss-amount { font-size: 2.5rem; }
    .boss-card { padding: 24px 80px; gap: 36px; min-width: 640px; }
    .boss-crown { font-size: 2.8rem; }
}

/* 1024–1599px — default, clamp() radi sve */

/* 768–1023px — manji laptop */
@media (max-width: 1023px) {
    .boss-name { font-size: 1.8rem; }
    .boss-amount { font-size: 1.5rem; }
    .boss-card { padding: 16px 36px; gap: 18px; min-width: 0; }
    .boss-crown { font-size: 1.7rem; }
}

/* do 767px — tablet, stack vertikalno */
@media (max-width: 767px) {
    .boards-wrapper { flex-direction: column; align-items: stretch; padding-bottom: 50px; }
    .board-panel { flex: 0 0 auto; width: 100%; }
    .boards-divider { width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #FFD700, transparent); margin: 6px 0; }
    .boss-card { flex-direction: column; gap: 4px; padding: 14px 20px; min-width: 0; width: 100%; max-width: 500px; }
    .boss-name { font-size: 1.5rem; }
    .boss-amount { font-size: 1.3rem; }
    .boss-crown { font-size: 1.5rem; }
}

/* do 480px — mobilni */
@media (max-width: 480px) {
    .boss-name { font-size: 1.2rem; }
    .boss-amount { font-size: 1.1rem; }
}
