:root {
    --bg-dark: #0a0b10;
    --card-bg: rgba(255, 255, 255, 0.03);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-radial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #0a0b10 100%);
    z-index: -1;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .accent {
    color: var(--accent);
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.game-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-primary);
}

/* MAIN CONTENT */
.darts-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.player-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.player-card[data-active="true"] {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 40px var(--accent-glow);
    transform: scale(1.02);
}

.match-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-item {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    letter-spacing: 1px;
}

.stat-item span {
    color: var(--accent);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.name-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    width: 60%;
    outline: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s;
}

.name-input:focus {
    border-bottom: 1px solid var(--accent);
}

.turn-indicator {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-card[data-active="true"] .turn-indicator {
    opacity: 1;
}

.score-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 6rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem 0;
    color: var(--text-primary);
}

.checkout-suggestion {
    height: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 2rem;
}

.history {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    min-height: 2rem;
}

.history-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* INPUT AREA */
.input-area {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.input-container {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 3rem;
    border-radius: 100px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.turn-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.turn-info span {
    color: var(--accent);
    font-weight: 800;
}

#score-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 800;
    width: 200px;
    text-align: center;
    outline: none;
}

/* Chrome, Safari, Edge, Opera */
#score-input::-webkit-outer-spin-button,
#score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    opacity: 0.6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #1e1b4b;
    padding: 3rem;
    border-radius: 32px;
    text-align: center;
    border: 1px solid var(--accent);
}

.modal-content h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

/* SETUP OVERLAY */
.setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(20px);
}

.setup-content {
    background: #1e1b4b;
    padding: 4rem;
    border-radius: 40px;
    text-align: center;
    border: 1px solid var(--accent);
    max-width: 500px;
    width: 90%;
}

.setup-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.setup-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.sets-selector {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.set-opt {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.set-opt:hover {
    border-color: var(--accent);
}

.set-opt.active {
    background: var(--accent);
    border-color: var(--accent);
}

.name-setup {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    padding-left: 0.5rem;
}

.input-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .darts-main {
        grid-template-columns: 1fr;
    }
}