:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    
    /* Dartboard Colors */
    --board-black: #111111;
    --board-white: #fefee2;
    --board-red: #e6192b;
    --board-green: #009c5a;
    --board-wire: #cccccc;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.game-settings {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
}

.game-settings button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-settings button.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.divider {
    width: 1px;
    height: 16px;
    align-self: center;
    background: var(--panel-border);
    margin: 0 4px;
}

#btn-reset {
    color: var(--danger);
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.player {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0.6;
    transform: scale(0.98);
}

.player.active-player {
    opacity: 1;
    transform: scale(1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.player h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    outline: none;
    border-bottom: 1px dashed transparent;
    display: inline-block;
}

.player h2:focus {
    border-bottom: 1px dashed var(--primary);
}

.score {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.throws {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.throw-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.throw-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.history-list {
    list-style: none;
    margin-top: 16px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--panel-border);
    padding-top: 12px;
}

.history-list li {
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list li span:last-child {
    font-weight: 700;
    color: var(--text-main);
}

/* Scrollbar voor history */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Throw Info */
.throw-info {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    min-height: 1.5em;
}

/* Dartboard */
.dartboard-container {
    width: 100%;
    max-width: 380px;
    margin: 0 auto 30px auto;
    position: relative;
    aspect-ratio: 1/1;
}

#dartboard {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

#dartboard path, #dartboard circle {
    cursor: pointer;
    transition: opacity 0.1s;
    stroke: var(--board-wire);
    stroke-width: 1px;
}

#dartboard path:active, #dartboard circle:active {
    opacity: 0.7;
}

/* Labels on dartboard */
.board-label {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 18px;
    fill: #ffffff;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
    padding-bottom: 20px;
}

.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
}

.btn-action:active {
    transform: translateY(2px);
}

.btn-secondary {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--primary);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

.modal-content h2 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .score { font-size: 2.8rem; }
    .controls { padding-bottom: 10px; }
}
