/* --- BASE STYLES --- */
body {
    margin: 0; padding: 0; width: 100vw; height: 100vh; overflow: hidden;
    display: flex; justify-content: center; align-items: center;
    background-color: #2c3e50; /* New Dark Slate Blue theme */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #E0E0E0; /* Soft off-white text to prevent eye strain */
}

.screen { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hidden { display: none !important; }

/* --- HOME SCREEN & MODAL --- */
.game-title { 
    font-size: 3.5rem; 
    margin-bottom: 40px; 
    color: #FFFFFF; 
    font-weight: 800; 
    letter-spacing: 3px; 
    text-transform: uppercase;
    text-align: center; 
}

.menu-buttons { display: flex; flex-direction: column; gap: 15px; width: 300px; max-width: 90vw; }

.menu-btn, .play-btn { 
    padding: 16px 20px; 
    font-size: 1.1rem; 
    background-color: #1a252f; /* Deep blue-gray for contrast */
    color: #E0E0E0; 
    border: 1px solid #34495e; /* Subtle lighter blue border */
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 500; 
    letter-spacing: 1px;
    transition: all 0.2s ease; 
}

.menu-btn:hover, .play-btn:hover { 
    background-color: #34495e; 
    color: #FFFFFF; 
    border-color: #465c71;
    transform: translateY(-2px); 
}

/* --- MODAL (POPUP) --- */
.modal { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(15, 23, 30, 0.85); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-content { position: relative; background-color: #1a252f; padding: 40px; border-radius: 12px; text-align: center; border: 1px solid #34495e; color: #E0E0E0; width: 90%; max-width: 400px; box-sizing: border-box; }
.modal-content h2 { font-weight: 500; letter-spacing: 1px; margin-bottom: 25px; color: #FFFFFF;}
.modal-content input { display: block; width: 100%; padding: 14px; margin: 15px 0; border-radius: 8px; border: 1px solid #34495e; background-color: #2c3e50; color: #FFFFFF; font-size: 1rem; box-sizing: border-box; outline: none; transition: all 0.2s ease; }
.modal-content input:focus { border-color: #5dade2; /* Nice bright blue accent on focus */ }
.play-btn { background-color: #34495e; color: #FFFFFF; margin-top: 20px;}
.play-btn:hover { background-color: #465c71; }

.close-btn { position: absolute; top: 15px; right: 20px; font-size: 2rem; color: #7f8c8d; cursor: pointer; line-height: 1; transition: color 0.2s ease; }
.close-btn:hover { color: #FFFFFF; }

/* --- GAME CONTROLS (TOP RIGHT) --- */
.game-controls { position: absolute; top: 20px; right: 30px; display: flex; gap: 15px; z-index: 50; }
.icon-btn { background-color: #1a252f; border: 1px solid #34495e; color: #E0E0E0; border-radius: 50%; width: 50px; height: 50px; font-size: 1.2rem; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s ease; }
.icon-btn:hover { transform: scale(1.05); border-color: #5dade2; background-color: #34495e; }

/* --- GAME LAYOUT --- */
.game-layout { display: flex; flex-direction: row; justify-content: center; align-items: center; width: 100%; max-width: 1400px; gap: 30px; padding: 10px; box-sizing: border-box; }

/* --- PROFILE BOXES --- */
.profile-box { background-color: #1a252f; border-radius: 12px; padding: 20px 15px; width: 150px; text-align: center; border: 1px solid #34495e; transition: all 0.3s ease; opacity: 0.5; box-sizing: border-box; }
.profile-icon { font-size: 2.2rem; margin-bottom: 10px; filter: grayscale(100%); opacity: 0.8; } 
.profile-box h3 { margin: 0; color: #95a5a6; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; } 
.profile-box h2 { margin: 8px 0 0 0; color: #FFFFFF; font-size: 1.1rem; font-weight: 500; word-wrap: break-word;} 
.active-turn { transform: scale(1.05); opacity: 1; border-color: #5dade2; background-color: #233140; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

/* --- COIN UI STYLES --- */
.coin-container { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 15px; min-height: 50px; }

.coin {
    width: 6.5%; 
    aspect-ratio: 1 / 1; 
    border-radius: 50%;
    position: absolute; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(14px, 2.5vw, 22px); 
    user-select: none; 
    box-shadow: none; 
    transform: translate(-50%, -50%); 
    pointer-events: none; 
    border: none;
    transition: all 0.3s ease-in-out;
}

/* Kept your original coin colors as they contrast well with the blue */
.goat-coin { 
    background: radial-gradient(circle at 30% 30%, #444444 0%, #2A2A2A 100%); 
    color: #CCCCCC;
}
.tiger-coin { 
    background: radial-gradient(circle at 30% 30%, #8D4004 0%, #4A2000 100%); 
    color: #E0E0E0;
}

.mini-coin { width: 22px; height: 22px; font-size: 10px; position: relative; transform: none; pointer-events: auto; box-shadow: none;}

/* --- THE BOARD --- */
.board-wrapper { flex: 3; display: flex; justify-content: center; align-items: center; max-width: 900px; }
svg { width: 100%; height: auto; display: block; }
.edge { stroke: #bdc3c7; stroke-width: 3; stroke-linecap: round; } /* Slightly lighter lines for better visibility against blue */

.node { 
    fill: #2c3e50; /* Matches the new background perfectly */
    stroke: #34495e; 
    cursor: pointer; 
    transition: r 0.3s ease, fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease; 
}


/* --- APEX (HEAD) COIN --- */
.apex-coin {
    width: 11.5% !important; 
    font-size: clamp(24px, 4vw, 36px) !important; 
}

/* --- CAPTURE ANIMATION --- */
.fade-out {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0) !important;
}

/* --- WIN MODAL BUTTONS --- */
.win-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}
.win-buttons button {
    width: 120px;
    margin-top: 0; /* Overrides the play-btn margin */
}

/* --- MOBILE SCREEN ADJUSTMENTS --- */
@media (max-width: 900px) {
    .game-controls { top: 15px; right: 15px; gap: 10px; }
    .icon-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .game-layout { flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding-top: 70px; gap: 0; }
    #profile-left { order: 1; }
    #profile-right { order: 2; }
    .board-wrapper { order: 3; width: 100%; flex: none; max-width: 100%; margin-top: 25px; }
    .profile-box { width: 48%; padding: 15px 10px; display: flex; flex-direction: column; align-items: center; border-radius: 12px;}
    .profile-icon { font-size: 1.6rem; margin-bottom: 5px; }
    .profile-box h3 { font-size: 0.65rem; }
    .profile-box h2 { font-size: 0.95rem; margin: 0; }
    .active-turn { transform: scale(1.02); }
    .mini-coin { width: 16px; height: 16px; font-size: 8px; }
    .coin-container { gap: 4px; margin-top: 10px; min-height: 35px; }
    .game-title { font-size: 2.2rem; margin-bottom: 30px; letter-spacing: 4px;}
}