:root {
    --bg-dark: #0f111a;
    --sidebar-bg: #1a1d2d;
    --border-color: #2a2e45;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --corkboard-color: #b08d6a;
    --corkboard-texture: repeating-radial-gradient(ellipse at center, #9e7b56 0%, #87623a 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-dark);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebars */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.right-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0,0,0,0.3);
}

.sidebar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Typography elements */
h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

p.desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Inputs and Buttons */
input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    margin-bottom: 1rem;
}

.btn.primary { background-color: var(--accent-primary); color: white; }
.btn.primary:hover { background-color: var(--accent-hover); }
.btn.secondary { background-color: transparent; border: 1px solid var(--accent-primary); color: var(--accent-primary); }
.btn.secondary:hover { background-color: rgba(59, 130, 246, 0.1); }
.btn.call-to-action { background-color: var(--accent-success); color: white; font-size: 1.1rem; padding: 1rem; }
.btn.call-to-action:hover { filter: brightness(1.1); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); text-transform: uppercase; letter-spacing: 1px; }
.btn.warning { background-color: var(--accent-warning); color: #fff; }

.config-group { margin-bottom: 1.5rem; }
.config-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem;}
.config-group input[type="range"] { width: calc(100% - 40px); display: inline-block; vertical-align: middle;}
.config-group span { display: inline-block; width: 35px; text-align: right; font-size: 0.8rem; color: var(--text-secondary); }

/* Main Area */
.main-board {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    position: relative;
}

.header {
    background-color: rgba(26, 29, 45, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.economics-display {
    text-align: right;
}

.economics-display h3 { margin: 0; font-size: 0.8rem; text-transform: uppercase; }
.economics-display .revenue-val { font-size: 1.8rem; font-weight: 800; color: var(--accent-success); }
.economics-display .volume-val { font-size: 0.9rem; color: var(--text-secondary); }

/* The Board */
.board-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
    background: radial-gradient(circle, #2a2e45 0%, #0f111a 100%);
}

.corkboard {
    background: var(--corkboard-texture);
    background-color: var(--corkboard-color);
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
    border: 10px solid #4a3424;
    border-radius: 10px;
    position: relative;
    width: 90%;
    height: 90%;
    cursor: crosshair;
    overflow: hidden; /* If scatter mode bounds it */
    perspective: 1000px;
}

/* Cards */
.card {
    position: absolute;
    width: 60px;
    height: 85px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    backface-visibility: hidden;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.card.face-down {
    background: repeating-linear-gradient(45deg, #b91c1c, #b91c1c 10px, #fff 10px, #fff 20px);
    color: transparent;
}

.card.suit-hearts, .card.suit-diamonds { color: #dc2626; }
.card.suit-spades, .card.suit-clubs { color: #1e293b; }

.card-top-left { position: absolute; top: 3px; left: 5px; font-size: 0.8rem; line-height: 1; }
.card-bottom-right { position: absolute; bottom: 3px; right: 5px; font-size: 0.8rem; line-height: 1; transform: rotate(180deg); }
.card-center { font-size: 2rem; }
.card-joker { color: #9333ea; font-size: 1rem; text-align: center; }

.card.hit {
    opacity: 0.8;
}
.card.death-card .card-center::after {
    content: 'X';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(220, 38, 38, 0.9);
    z-index: 10;
}

/* Darts */
.dart {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f1f5f9;
    border-radius: 50%;
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.5), 0 0 10px rgba(255,255,255,0.8);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}
.dart::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background-color: #3b82f6;
    border-radius: 50%;
}

/* Leaderboard */
#leaderboard-list {
    list-style: none;
}
#leaderboard-list li {
    background-color: rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-primary);
}
#leaderboard-list li:nth-child(1) { border-left-color: #fbbf24; }
#leaderboard-list li:nth-child(2) { border-left-color: #94a3b8; }
#leaderboard-list li:nth-child(3) { border-left-color: #b45309; }

.lb-name { font-weight: bold; }
.lb-hand { font-size: 0.8rem; color: var(--text-secondary); text-align:right;}

/* Player controls */
.player-controls { display: flex; gap: 0.5rem; }
.current-player-stats {
    background-color: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}
.hand-display {
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: var(--accent-primary);
}

.card.small-card {
    width: 40px;
    height: 55px;
    font-size: 0.8rem;
}
.card.small-card .card-center { font-size: 1.2rem; }
.card.small-card .card-top-left { font-size: 0.6rem; }
.card.small-card .card-bottom-right { font-size: 0.6rem; }

.bonus-target {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #fcd34d 0%, #f59e0b 100%);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #78350f;
    font-size: 0.75rem;
    user-select: none;
    z-index: 5;
    border: 2px solid #fff;
    transition: transform 0.2s;
}
.bonus-target:hover { transform: scale(1.1); }
.bonus-target.hit {
    opacity: 0.5;
    background: #9ca3af;
}
