/* ============================================
   Navakankari - Nine Men's Morris
   Enhanced CSS Styles with Indian Aesthetic
   ============================================ */

/* CSS Variables */
:root {
    --saffron: #FF9933;
    --saffron-dark: #CC5500;
    --saffron-light: #FFB347;
    --saffron-glow: rgba(255, 153, 51, 0.5);
    --green: #228B22;
    --green-dark: #006400;
    --green-light: #90EE90;
    --green-glow: rgba(34, 139, 34, 0.5);
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --gold-light: #FFEC8B;
    --gold-glow: rgba(255, 215, 0, 0.5);
    --wood-light: #D4A574;
    --wood-medium: #B8860B;
    --wood-dark: #8B4513;
    --cream: #FFF8DC;
    --maroon: #800000;
    --bg-gradient-start: #0f0705;
    --bg-gradient-end: #1f1008;
    --text-light: #FFF8DC;
    --text-dark: #3d2914;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 153, 51, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 139, 34, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Game Container */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    text-align: center;
    padding: 20px 0 30px;
}

.game-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, var(--saffron) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px var(--shadow);
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.game-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--cream);
    opacity: 0.8;
    font-weight: 400;
    letter-spacing: 2px;
}

/* Game Content */
.game-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
    flex: 1;
}

/* Player Panels */
.player-panel {
    background: linear-gradient(145deg, rgba(139, 69, 19, 0.4), rgba(139, 69, 19, 0.2));
    border-radius: 20px;
    padding: 25px;
    width: 200px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px var(--shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.player-info {
    text-align: center;
    margin-bottom: 20px;
}

.player-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow);
}

.player1-avatar {
    background: linear-gradient(135deg, var(--saffron-light), var(--saffron-dark));
}

.player2-avatar {
    background: linear-gradient(135deg, var(--green-light), var(--green-dark));
}

.avatar-inner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent);
}

.player-info h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--cream);
    margin-bottom: 8px;
}

.player-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 2px 4px var(--shadow);
}

.player-color.saffron {
    background: radial-gradient(circle at 30% 30%, var(--saffron-light), var(--saffron-dark));
}

.player-color.green {
    background: radial-gradient(circle at 30% 30%, var(--green-light), var(--green-dark));
}

.player-stats {
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding-top: 15px;
}

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

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 248, 220, 0.7);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
}

.turn-indicator {
    margin-top: 20px;
    padding: 12px;
    text-align: center;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.player1-panel .turn-indicator {
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 153, 51, 0.4);
    animation: pulse 2s infinite;
}

.player2-panel .turn-indicator {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.4);
    animation: pulse 2s infinite;
}

.turn-indicator.inactive {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    animation: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Board Container */
.board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board-frame {
    background: linear-gradient(145deg, #4a3728, #2d1f15);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    border: 3px solid var(--wood-dark);
}

.board-svg {
    width: 500px;
    height: 500px;
    display: block;
}

/* Board Positions */
.position-spot {
    cursor: pointer;
    transition: all 0.2s ease;
}

.position-spot circle.spot-bg {
    fill: #a08060;
    stroke: #5D3A1A;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.position-spot:hover circle.spot-bg {
    fill: #c0a080;
    transform-origin: center;
}

.position-spot.valid-move circle.spot-bg {
    fill: var(--gold);
    stroke: var(--gold-dark);
    animation: validPulse 1s infinite;
}

.position-spot.can-remove circle.spot-bg {
    fill: #ff4444;
    stroke: #cc0000;
    animation: removePulse 0.5s infinite;
}

@keyframes validPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes removePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Game Pieces */
.piece {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
}

.piece:hover {
    filter: drop-shadow(2px 6px 10px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

.piece.selected {
    filter: drop-shadow(0 0 15px var(--gold)) brightness(1.2);
    animation: selectedBounce 0.5s ease;
}

.piece.part-of-mill {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

@keyframes selectedBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Game Status */
.game-status {
    margin-top: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.6), rgba(139, 69, 19, 0.3));
    border-radius: 30px;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px var(--shadow);
}

.status-icon {
    font-size: 1.5rem;
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--cream);
    letter-spacing: 1px;
}

/* AI Controls */
.ai-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-difficulty label {
    font-size: 0.9rem;
    color: var(--cream);
    opacity: 0.9;
}

.ai-difficulty select {
    background: rgba(20, 10, 5, 0.8);
    color: var(--gold);
    border: 1px solid var(--gold-dark);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
}

.ai-options {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--cream);
    user-select: none;
}

.checkbox-label input {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 30px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.6), rgba(139, 69, 19, 0.4));
    color: var(--cream);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(139, 69, 19, 0.6));
    border-color: var(--gold);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1.1rem;
}

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

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #3d2914, #2a1a0d);
    padding: 40px;
    border-radius: 20px;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    border: 3px solid var(--gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--cream);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content h2 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.rules-section {
    margin-bottom: 25px;
}

.rules-section h3 {
    color: var(--saffron);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.rules-section p, .rules-section li {
    color: var(--cream);
    line-height: 1.6;
    font-size: 1rem;
}

.rules-section ul {
    list-style: none;
    padding-left: 20px;
}

.rules-section li::before {
    content: "• ";
    color: var(--gold);
}

.phase {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--gold);
}

.phase h4 {
    color: var(--gold);
    margin-bottom: 5px;
}

.modal-content .btn {
    margin: 20px auto 0;
    display: block;
}

/* Win Modal */
.win-content {
    text-align: center;
}

.win-celebration {
    font-size: 4rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.win-content h2 {
    font-size: 2.5rem;
    margin: 20px 0;
}

.win-content p {
    color: var(--cream);
    opacity: 0.8;
    margin-bottom: 20px;
}

.win-actions {
    margin-top: 30px;
}

/* Mill Animation */
.mill-formed {
    animation: millGlow 0.5s ease 3;
}

@keyframes millGlow {
    0%, 100% { filter: drop-shadow(0 0 5px var(--gold)); }
    50% { filter: drop-shadow(0 0 20px var(--gold)); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-content {
        gap: 20px;
    }
    
    .player-panel {
        width: 180px;
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .game-content {
        flex-direction: column;
        align-items: center;
    }
    
    .player-panel {
        width: 100%;
        max-width: 400px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    
    .player-info {
        margin-bottom: 0;
        flex: 1;
    }
    
    .player-stats {
        flex: 2;
        display: flex;
        gap: 20px;
        border-top: none;
        padding-top: 0;
        border-left: 1px solid rgba(255, 215, 0, 0.2);
        padding-left: 20px;
    }
    
    .stat {
        flex-direction: column;
        border-bottom: none;
        text-align: center;
    }
    
    .turn-indicator {
        margin-top: 0;
        margin-left: auto;
    }
    
    .board-svg {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 500px) {
    .game-header h1 {
        font-size: 2.5rem;
    }
    
    .game-header h2 {
        font-size: 1.3rem;
    }
    
    .board-svg {
        width: 320px;
        height: 320px;
    }
    
    .board-frame {
        padding: 10px;
    }
    
    .player-panel {
        padding: 15px;
    }
    
    .player-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-content {
        padding: 25px;
        margin: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Selection Color */
::selection {
    background: var(--gold);
    color: var(--text-dark);
}

/* ============================================
   Enhanced Features Styles
   ============================================ */

/* Header Controls */
.game-header {
    position: relative;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.title-section {
    text-align: center;
}

.header-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(139, 69, 19, 0.4);
    color: var(--cream);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
    transform: scale(1.1);
}

/* Game Mode Bar */
.game-mode-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-selector {
    display: flex;
    background: rgba(139, 69, 19, 0.3);
    border-radius: 30px;
    padding: 4px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.mode-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--cream);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.mode-icon {
    font-size: 1.2rem;
}

.ai-difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cream);
}

.ai-difficulty select {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: rgba(139, 69, 19, 0.4);
    color: var(--cream);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    cursor: pointer;
}

.ai-difficulty select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Enhanced Player Panel */
.player-avatar {
    position: relative;
}

.avatar-icon {
    font-size: 2rem;
}

.avatar-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.player1-panel:not(.player-panel .turn-indicator.inactive ~ .player-avatar) .avatar-ring,
.player1-panel .turn-indicator:not(.inactive) ~ .player-info .avatar-ring {
    border-color: var(--saffron);
    box-shadow: 0 0 15px var(--saffron-glow);
}

.player2-panel .turn-indicator:not(.inactive) ~ .player-info .avatar-ring {
    border-color: var(--green);
    box-shadow: 0 0 15px var(--green-glow);
}

.stat-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.turn-indicator {
    position: relative;
    overflow: hidden;
}

.turn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.turn-indicator.inactive .turn-glow {
    display: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Captured Pieces Display */
.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 15px;
    min-height: 30px;
}

.captured-piece {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    opacity: 0.7;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.captured-piece.saffron {
    background: radial-gradient(circle at 30% 30%, var(--saffron-light), var(--saffron-dark));
}

.captured-piece.green {
    background: radial-gradient(circle at 30% 30%, var(--green-light), var(--green-dark));
}

/* Phase Indicator */
.phase-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 25px;
}

.phase-step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 248, 220, 0.5);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.phase-step.active {
    color: var(--gold);
}

.phase-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 248, 220, 0.3);
    transition: all 0.3s ease;
}

.phase-step.active .phase-dot {
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
    animation: phasePulse 1.5s infinite;
}

@keyframes phasePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px var(--gold-glow); }
    50% { transform: scale(1.2); box-shadow: 0 0 20px var(--gold-glow); }
}

.phase-connector {
    width: 30px;
    height: 2px;
    background: rgba(255, 248, 220, 0.2);
}

/* Move History Panel */
.move-history-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    background: rgba(45, 24, 16, 0.95);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px var(--shadow-strong);
    z-index: 100;
    overflow: hidden;
    transition: all 0.3s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(139, 69, 19, 0.4);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.history-header h4 {
    color: var(--gold);
    font-size: 1rem;
    margin: 0;
}

.toggle-history {
    background: none;
    border: none;
    color: var(--cream);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.history-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.history-content.collapsed {
    max-height: 0;
}

.history-list {
    padding: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.history-player {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.history-player.p1 {
    background: var(--saffron);
}

.history-player.p2 {
    background: var(--green);
}

.history-action {
    flex: 1;
    color: var(--cream);
}

.history-action.mill {
    color: var(--gold);
}

/* Particle Canvas */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Board Frame Enhancement */
.board-frame {
    position: relative;
}

/* Enhanced Piece Styles */
.piece {
    cursor: pointer;
    transition: filter 0.2s ease;
}

.piece.selected {
    filter: drop-shadow(0 0 20px var(--gold)) brightness(1.2);
}

.piece.hint {
    animation: hintPulse 1s infinite;
}

@keyframes hintPulse {
    0%, 100% { filter: drop-shadow(0 0 10px var(--gold)); }
    50% { filter: drop-shadow(0 0 25px var(--gold)); }
}

/* Valid Move Animation Enhancement */
.position-spot.valid-move circle.spot-bg {
    fill: var(--gold);
    stroke: var(--gold-dark);
    animation: validMovePulse 1s infinite;
}

@keyframes validMovePulse {
    0%, 100% { 
        opacity: 1; 
        r: 15;
    }
    50% { 
        opacity: 0.7; 
        r: 18;
    }
}

.position-spot.can-remove circle.spot-bg {
    fill: #ff4444;
    stroke: #cc0000;
    animation: removePulse 0.5s infinite;
}

/* Win Modal Enhancement */
.win-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.win-stat {
    text-align: center;
}

.win-stat-label {
    display: block;
    color: rgba(255, 248, 220, 0.7);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.win-stat-value {
    display: block;
    color: var(--gold);
    font-size: 2rem;
    font-weight: 700;
}

.win-celebration {
    font-size: 5rem;
    animation: bounce 1s infinite, rotate 2s infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* AI Thinking Indicator */
.ai-thinking {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cream);
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: thinkingBounce 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinkingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Hint Button Active State */
.btn.hint-active {
    background: linear-gradient(135deg, var(--gold), var(--saffron));
    animation: hintButtonPulse 1s infinite;
}

@keyframes hintButtonPulse {
    0%, 100% { box-shadow: 0 0 10px var(--gold-glow); }
    50% { box-shadow: 0 0 25px var(--gold-glow); }
}

/* Mill Line Highlight */
.mill-line {
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    opacity: 0;
    animation: millLineGlow 1s ease-out forwards;
}

@keyframes millLineGlow {
    0% { opacity: 0; stroke-width: 2; }
    50% { opacity: 1; stroke-width: 8; }
    100% { opacity: 0.6; stroke-width: 6; }
}

/* Responsive Adjustments for New Elements */
@media (max-width: 900px) {
    .header-controls {
        position: static;
        transform: none;
        margin-top: 15px;
        justify-content: center;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .move-history-panel {
        position: static;
        width: 100%;
        max-width: 400px;
        margin: 20px auto 0;
    }
    
    .game-mode-bar {
        flex-direction: column;
    }
}

@media (max-width: 500px) {
    .phase-indicator {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .phase-connector {
        width: 15px;
    }
    
    .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
}

/* Animation Classes for GSAP */
.piece-enter {
    opacity: 0;
    transform: scale(0) translateY(-20px);
}

.piece-moving {
    transition: none !important;
}

/* Tooltip Styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8rem;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Danger/Warning Indicators */
.stat-value.critical {
    color: #FF4444 !important;
    animation: pulse-danger 1s ease-in-out infinite;
}

.stat-value.warning {
    color: #FFA500 !important;
}

@keyframes pulse-danger {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
    }
    50% { 
        transform: scale(1.1);
        text-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
    }
}

/* Flying phase indicator */
.stat-value.flying {
    color: #00BFFF !important;
    animation: pulse-flying 1.5s ease-in-out infinite;
}

@keyframes pulse-flying {
    0%, 100% { 
        text-shadow: 0 0 5px rgba(0, 191, 255, 0.5);
    }
    50% { 
        text-shadow: 0 0 15px rgba(0, 191, 255, 0.8);
    }
}
