:root {
    --bg: #121212;
    --panel: #1e1e1e;
    --text: #eee;
    --accent: #00e676;
    --danger: #ff5252;
    --input-bg: #2c2c2c;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* LAYOUT GENERAL */
#app {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

/* UTILS */
.hidden {
    display: none !important;
}

.view-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* AUTH & MENU */
.auth-view, .menu-view, .config-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.title {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.2);
}

.input-group {
    margin-bottom: 1.5rem;
    width: 300px;
}

input {
    width: 100%;
    padding: 15px;
    background: var(--input-bg);
    border: 1px solid #444;
    color: white;
    font-size: 1.1rem;
    border-radius: 8px;
    outline: none;
    transition: box-shadow 0.3s;
}

input:focus {
    box-shadow: 0 0 0 2px var(--accent);
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
    transition: transform 0.2s;
    text-transform: uppercase;
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.5);
    transform: scale(1.05);
}

.btn-primary:active {
    transform: scale(0.95);
}

/* GAME GRID */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.game-card {
    background: var(--panel);
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    text-align: center;
}

.game-card:hover {
    border-color: var(--accent);
    background: #252525;
}

.game-card h3 {
    font-size: 2rem;
    margin: 0;
}

/* GAME LAYOUT (Existing styles adapted) */
.game-view {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    flex: 1;
    background: var(--panel);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #333;
    overflow-y: auto;
}

.sidebar.right {
    border-left: 1px solid #333;
    border-right: none;
}

.player-card {
    background: #181818;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #333;
    opacity: 0.5;
    transition: all 0.3s;
}

.player-card.active-turn {
    opacity: 1;
    border-color: var(--accent);
    background: #1f1f1f;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.player-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #aaa;
}

.active-turn .player-name {
    color: var(--accent);
}

.big-score {
    font-size: 3rem;
    font-weight: 800;
    margin: 5px 0;
    color: #fff;
}

.darts-history {
    display: flex;
    justify-content: center;
    gap: 5px;
    height: 40px;
}

.dart-slot {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #555;
    font-size: 0.9rem;
}

.dart-slot.filled {
    border-color: var(--accent);
    background: #2a2a2a;
    color: white;
}

/* ZONE CENTRALE (Cible) */
.center-stage {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

/* La Cible SVG */
svg.dartboard {
    max-height: 85vh;
    max-width: 90vw;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

/* Styles des segments */
path {
    stroke: #d1d1d1;
    stroke-width: 1;
    cursor: pointer;
    transition: opacity 0.1s;
}

path:hover {
    opacity: 0.8;
}

path:active,
path.hit {
    fill: var(--accent) !important;
    stroke: white;
    stroke-width: 2;
}

.black { fill: #121212; }
.white { fill: #f0f0f0; }
.red { fill: #e63946; }
.green { fill: #2a9d8f; }

/* ACTIONS */
.actions {
    margin-top: 20px;
    z-index: 10;
    display: flex;
    gap: 20px;
}

.connection-status {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: #666;
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
    .game-view {
        flex-direction: column;
    }

    .sidebar {
        flex: 0;
        padding: 5px;
        flex-direction: row;
        align-items: center;
        height: 70px;
        white-space: nowrap;
        overflow-x: auto;
        order: 1;
        width: 100vw;
    }

    .center-stage {
        flex: 1;
        order: 2;
    }
    
    .player-card {
        min-width: 150px;
        margin: 0 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 5px;
    }
    
    .big-score {
        font-size: 1.5rem;
    }
}
