/* START OF FILE style.css (With Animation Enhancements) */

body {
    font-family: sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background-image: url('./img/background/photoforgames.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #f0f0f0;
}

#settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    background-color: rgba(248, 249, 250, 0.95);
    border-left: 1px solid #dee2e6;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 1000;
    box-sizing: border-box;
}

#settings-sidebar h3 {
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
#settings-sidebar .setting-group {
    margin-bottom: 20px;
}
#settings-sidebar h4 {
    margin-bottom: 10px;
    color: #333;
}
#settings-sidebar label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}


#app-container {
    background-color: rgba(255, 255, 255, 0.92); /* Slightly more opaque */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 350px;
    max-width: 90%;
    margin: 20px auto;
    margin-right: 250px; /* Make space for sidebar */
    position: relative;
}

/* Mute button */
.settings-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 1em;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
}
.settings-button:hover { background-color: #e9ecef; }

/* Screen visibility */
.screen { display: none; }
.screen.active { display: block; }

/* --- Multiplayer UI Styles --- */
.network-options button {
    font-size: 1.2em;
    padding: 12px 24px;
    margin: 15px;
}

#join-code-display {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 5px;
    background-color: #eee;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin: 20px auto;
    width: fit-content;
}

#player-list-container {
    margin-top: 20px;
}
#player-list {
    list-style: none;
    padding: 0;
    margin: 10px auto;
    width: 80%;
    max-width: 400px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}
#player-list li {
    padding: 8px;
    border-bottom: 1px solid #eee;
}
#player-list li:last-child {
    border-bottom: none;
}

#join-code-input {
    font-size: 1.5em;
    padding: 10px;
    text-align: center;
    letter-spacing: 3px;
    width: 200px;
    margin: 10px;
}
.error-text {
    color: #d9534f;
    font-weight: bold;
    margin-top: 10px;
}

/* Global Score Board in Lobby */
#global-score-board {
    background-color: rgba(230, 230, 250, 0.7); /* Light lavender tint */
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 15px auto 25px auto; /* Center and add spacing */
    width: fit-content; /* Shrink to content */
    max-width: 90%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#global-score-board h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
    color: #333;
}
#scores-list p {
    margin: 5px 0;
    font-size: 1em;
    font-weight: bold;
}

/* Buttons */
button {
    padding: 10px 15px;
    margin: 5px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #e7e7e7;
}
button:hover { background-color: #ddd; }
button:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
}

#game-list-bot button.game-select-btn,
#game-list-single button.game-select-btn,
#game-list-multi button.game-select-btn {
    display: block;
    width: 80%;
    margin: 10px auto;
}

/* Game Header */
#game-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
#game-quit-btn {
    float: right;
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
#game-quit-btn:hover { background-color: #f5c6cb; }

/* Game Board Area */
#game-board-area { margin-top: 20px; }

/* Game Setup Screen */
#game-setup-screen div { margin: 20px 0; }
#game-setup-screen label { margin-right: 10px; }

/* Memory Game */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 80px); 
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    perspective: 1000px;
}
.memory-card {
    width: 80px;
    height: 100px;
    border: 1px solid #999;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    user-select: none;
    background-color: #007bff;
}
.memory-card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.memory-card.revealed .card-face,
.memory-card.matched .card-face {
    transform: rotateY(180deg);
    background-color: #f8f9fa;
}
.memory-card.hidden .card-face img { visibility: hidden; }
.memory-card.revealed { background-color: #f8f9fa; transform: rotateY(180deg); }
.memory-card.matched { background-color: #d4edda; border-color: #c3e6cb; cursor: default; opacity: 0.8; transform: rotateY(180deg); }
.memory-card.revealed .card-face img,
.memory-card.matched .card-face img { visibility: visible; }
#memory-scores { margin-top: 15px; font-weight: bold; }
#memory-scores span { margin: 0 10px; padding: 5px; border-radius: 4px; }
#memory-scores span.active-player { background-color: #ffc107; color: #333; }

/* Tic Tac Toe */
.tic-tac-toe-board { display: grid; grid-template-columns: repeat(3, 80px); grid-template-rows: repeat(3, 80px); gap: 5px; justify-content: center; margin: 20px auto; width: calc(80px * 3 + 5px * 2); }
.tic-tac-toe-cell { display: flex; justify-content: center; align-items: center; font-size: 2.5em; font-weight: bold; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; user-select: none; }
.tic-tac-toe-cell:hover { background-color: #ddd; }
.tic-tac-toe-cell.played { cursor: not-allowed; background-color: #e0e0e0; }
.tic-tac-toe-cell.playerBlue { color: blue; }
.tic-tac-toe-cell.playerRed { color: red; }

/* Connect Four */
.connect-four-board { display: inline-block; background-color: #337ab7; padding: 10px; border-radius: 10px; margin-top: 15px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.connect-four-col { display: inline-block; margin: 0 2px; cursor: pointer; }
.connect-four-cell { width: 50px; height: 50px; background-color: #ffffff; border-radius: 50%; margin: 4px 0; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3); display: flex; justify-content: center; align-items: center; }
.connect-four-cell.playerBlue { background-color: #4488FF; }
.connect-four-cell.playerRed { background-color: #FF4136; }
.connect-four-col:hover .connect-four-cell:not(.playerBlue):not(.playerRed) { background-color: #e0e0e0; }

/* Checkers */
.checker-scoreboard { 
    display: flex; 
    justify-content: space-around; 
    width: 410px; 
    margin: 0 auto 10px auto; 
    padding: 8px; 
    background-color: #e0e0e0; 
    border: 1px solid #bdbdbd; 
    border-radius: 5px; 
    font-weight: bold; 
    box-sizing: border-box; 
}
.checker-scoreboard .score-red { color: #b71c1c; }
.checker-scoreboard .score-blue { color: #0d47a1; }
.checker-board { 
    display: grid; 
    grid-template-columns: repeat(8, 50px); 
    grid-template-rows: repeat(8, 50px); 
    border: 5px solid #654321; 
    width: fit-content; 
    margin: 0 auto; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative; /* Enable relative positioning for animated pieces */
}
.checker-square { 
    width: 50px; 
    height: 50px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
}
.checker-square.light { background-color: #f0d9b5; }
.checker-square.dark { background-color: #b58863; }
.checker-piece { 
    width: 85%; 
    height: 85%; 
    border-radius: 50%; 
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.4), 0 2px 3px rgba(0,0,0,0.3); 
    pointer-events: none; 
    position: relative;
}

/* NEW: Enhanced animated piece styles */
.checker-piece-animated {
    box-shadow: 
        inset 0 -3px 5px rgba(0,0,0,0.4), 
        0 4px 8px rgba(0,0,0,0.4),
        0 0 15px rgba(255,255,255,0.3); /* Add a subtle glow during animation */
    transform-origin: center center;
    /* The transition is set in JavaScript for more control */
}

.checker-piece.playerRed { 
    background-color: #e53935; 
    border: 2px solid #b71c1c; 
}
.checker-piece.playerBlue { 
    background-color: #1e88e5; 
    border: 2px solid #0d47a1; 
}
.checker-piece.king::after { 
    content: '👑'; 
    font-size: 24px; 
    color: gold; 
    text-shadow: 0 0 2px black, 0 0 2px black; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 100%; 
    height: 100%; 
    position: absolute;
    top: 0;
    left: 0;
}

/* NEW: Enhanced animation effects for selected and valid move squares */
.checker-square.selected { 
    outline: 3px solid #ffd700; 
    outline-offset: -3px; 
    z-index: 10; 
    animation: pulse-selection 1.5s ease-in-out infinite;
}

.checker-square.valid-move { 
    background-color: rgba(144, 238, 144, 0.8) !important; 
    animation: pulse-valid-move 2s ease-in-out infinite;
}

/* START OF FILE style.css (With Animation Enhancements) */

body {
    font-family: sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background-image: url('./img/background/photoforgames.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #f0f0f0;
}

#settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    background-color: rgba(248, 249, 250, 0.95);
    border-left: 1px solid #dee2e6;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 1000;
    box-sizing: border-box;
}

#settings-sidebar h3 {
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
#settings-sidebar .setting-group {
    margin-bottom: 20px;
}
#settings-sidebar h4 {
    margin-bottom: 10px;
    color: #333;
}
#settings-sidebar label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}


#app-container {
    background-color: rgba(255, 255, 255, 0.92); /* Slightly more opaque */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 350px;
    max-width: 90%;
    margin: 20px auto;
    margin-right: 250px; /* Make space for sidebar */
    position: relative;
}

/* Mute button */
.settings-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 1em;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
}
.settings-button:hover { background-color: #e9ecef; }

/* Screen visibility */
.screen { display: none; }
.screen.active { display: block; }

/* --- Multiplayer UI Styles --- */
.network-options button {
    font-size: 1.2em;
    padding: 12px 24px;
    margin: 15px;
}

#join-code-display {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 5px;
    background-color: #eee;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin: 20px auto;
    width: fit-content;
}

#player-list-container {
    margin-top: 20px;
}
#player-list {
    list-style: none;
    padding: 0;
    margin: 10px auto;
    width: 80%;
    max-width: 400px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}
#player-list li {
    padding: 8px;
    border-bottom: 1px solid #eee;
}
#player-list li:last-child {
    border-bottom: none;
}

#join-code-input {
    font-size: 1.5em;
    padding: 10px;
    text-align: center;
    letter-spacing: 3px;
    width: 200px;
    margin: 10px;
}
.error-text {
    color: #d9534f;
    font-weight: bold;
    margin-top: 10px;
}

/* Global Score Board in Lobby */
#global-score-board {
    background-color: rgba(230, 230, 250, 0.7); /* Light lavender tint */
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 15px;
    margin: 15px auto 25px auto; /* Center and add spacing */
    width: fit-content; /* Shrink to content */
    max-width: 90%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#global-score-board h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
    color: #333;
}
#scores-list p {
    margin: 5px 0;
    font-size: 1em;
    font-weight: bold;
}

/* Buttons */
button {
    padding: 10px 15px;
    margin: 5px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #e7e7e7;
}
button:hover { background-color: #ddd; }
button:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #ddd;
}

#game-list-single button.game-select-btn,
#game-list-multi button.game-select-btn {
    display: block;
    width: 80%;
    margin: 10px auto;
}

/* Game Header */
#game-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
#game-quit-btn {
    float: right;
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
#game-quit-btn:hover { background-color: #f5c6cb; }

/* Game Board Area */
#game-board-area { margin-top: 20px; }

/* Game Setup Screen */
#game-setup-screen div { margin: 20px 0; }
#game-setup-screen label { margin-right: 10px; }

/* Memory Game */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 80px); 
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    perspective: 1000px;
}
.memory-card {
    width: 80px;
    height: 100px;
    border: 1px solid #999;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    user-select: none;
    background-color: #007bff;
}
.memory-card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.memory-card.revealed .card-face,
.memory-card.matched .card-face {
    transform: rotateY(180deg);
    background-color: #f8f9fa;
}
.memory-card.hidden .card-face img { visibility: hidden; }
.memory-card.revealed { background-color: #f8f9fa; transform: rotateY(180deg); }
.memory-card.matched { background-color: #d4edda; border-color: #c3e6cb; cursor: default; opacity: 0.8; transform: rotateY(180deg); }
.memory-card.revealed .card-face img,
.memory-card.matched .card-face img { visibility: visible; }
#memory-scores { margin-top: 15px; font-weight: bold; }
#memory-scores span { margin: 0 10px; padding: 5px; border-radius: 4px; }
#memory-scores span.active-player { background-color: #ffc107; color: #333; }

/* Tic Tac Toe */
.tic-tac-toe-board { display: grid; grid-template-columns: repeat(3, 80px); grid-template-rows: repeat(3, 80px); gap: 5px; justify-content: center; margin: 20px auto; width: calc(80px * 3 + 5px * 2); }
.tic-tac-toe-cell { display: flex; justify-content: center; align-items: center; font-size: 2.5em; font-weight: bold; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; user-select: none; }
.tic-tac-toe-cell:hover { background-color: #ddd; }
.tic-tac-toe-cell.played { cursor: not-allowed; background-color: #e0e0e0; }
.tic-tac-toe-cell.playerBlue { color: blue; }
.tic-tac-toe-cell.playerRed { color: red; }

/* Connect Four */
.connect-four-board { display: inline-block; background-color: #337ab7; padding: 10px; border-radius: 10px; margin-top: 15px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.connect-four-col { display: inline-block; margin: 0 2px; cursor: pointer; }
.connect-four-cell { width: 50px; height: 50px; background-color: #ffffff; border-radius: 50%; margin: 4px 0; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3); display: flex; justify-content: center; align-items: center; }
.connect-four-cell.playerBlue { background-color: #4488FF; }
.connect-four-cell.playerRed { background-color: #FF4136; }
.connect-four-col:hover .connect-four-cell:not(.playerBlue):not(.playerRed) { background-color: #e0e0e0; }

/* Checkers */
.checker-scoreboard { 
    display: flex; 
    justify-content: space-around; 
    width: 410px; 
    margin: 0 auto 10px auto; 
    padding: 8px; 
    background-color: #e0e0e0; 
    border: 1px solid #bdbdbd; 
    border-radius: 5px; 
    font-weight: bold; 
    box-sizing: border-box; 
}
.checker-scoreboard .score-red { color: #b71c1c; }
.checker-scoreboard .score-blue { color: #0d47a1; }
.checker-board { 
    display: grid; 
    grid-template-columns: repeat(8, 50px); 
    grid-template-rows: repeat(8, 50px); 
    border: 5px solid #654321; 
    width: fit-content; 
    margin: 0 auto; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative; /* Enable relative positioning for animated pieces */
}
.checker-square { 
    width: 50px; 
    height: 50px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
}
.checker-square.light { background-color: #f0d9b5; }
.checker-square.dark { background-color: #b58863; }
.checker-piece { 
    width: 85%; 
    height: 85%; 
    border-radius: 50%; 
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.4), 0 2px 3px rgba(0,0,0,0.3); 
    pointer-events: none; 
    position: relative;
}

/* NEW: Enhanced animated piece styles */
.checker-piece-animated {
    box-shadow: 
        inset 0 -3px 5px rgba(0,0,0,0.4), 
        0 4px 8px rgba(0,0,0,0.4),
        0 0 15px rgba(255,255,255,0.3); /* Add a subtle glow during animation */
    transform-origin: center center;
    /* The transition is set in JavaScript for more control */
}

.checker-piece.playerRed { 
    background-color: #e53935; 
    border: 2px solid #b71c1c; 
}
.checker-piece.playerBlue { 
    background-color: #1e88e5; 
    border: 2px solid #0d47a1; 
}
.checker-piece.king::after { 
    content: '👑'; 
    font-size: 24px; 
    color: gold; 
    text-shadow: 0 0 2px black, 0 0 2px black; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 100%; 
    height: 100%; 
    position: absolute;
    top: 0;
    left: 0;
}

/* NEW: Enhanced animation effects for selected and valid move squares */
.checker-square.selected { 
    outline: 3px solid #ffd700; 
    outline-offset: -3px; 
    z-index: 10; 
    animation: pulse-selection 1.5s ease-in-out infinite;
}

.checker-square.valid-move { 
    background-color: rgba(144, 238, 144, 0.8) !important; 
    animation: pulse-valid-move 2s ease-in-out infinite;
}

/* NEW: Punishment piece highlighting */
.checker-square.piece-to-remove {
    outline: 4px solid #ff4444 !important;
    outline-offset: -4px;
    z-index: 15;
    animation: pulse-piece-removal 1s ease-in-out infinite;
    background-color: rgba(255, 68, 68, 0.3) !important;
}

.checker-square.piece-to-remove .checker-piece {
    opacity: 0.7;
    animation: shake-piece 0.5s ease-in-out infinite alternate;
}

/* NEW: Bot thinking indicator */
.checker-square.bot-thinking {
    outline: 3px solid #9c27b0 !important;
    outline-offset: -3px;
    z-index: 12;
    animation: pulse-bot-thinking 1s ease-in-out infinite;
    background-color: rgba(156, 39, 176, 0.2) !important;
}

/* NEW: Keyframe animations for enhanced visual feedback */
@keyframes pulse-selection {
    0%, 100% { 
        outline-color: #ffd700; 
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% { 
        outline-color: #ffed4e; 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

@keyframes pulse-valid-move {
    0%, 100% { 
        background-color: rgba(144, 238, 144, 0.7) !important; 
    }
    50% { 
        background-color: rgba(144, 238, 144, 0.9) !important; 
    }
}

@keyframes pulse-piece-removal {
    0%, 100% { 
        outline-color: #ff4444;
        background-color: rgba(255, 68, 68, 0.3) !important;
        box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
    }
    50% { 
        outline-color: #ff6666;
        background-color: rgba(255, 68, 68, 0.5) !important;
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.9);
    }
}

@keyframes pulse-bot-thinking {
    0%, 100% { 
        outline-color: #9c27b0;
        background-color: rgba(156, 39, 176, 0.2) !important;
        box-shadow: 0 0 5px rgba(156, 39, 176, 0.5);
    }
    50% { 
        outline-color: #ba68c8;
        background-color: rgba(156, 39, 176, 0.4) !important;
        box-shadow: 0 0 15px rgba(156, 39, 176, 0.8);
    }
}

@keyframes shake-piece {
    0% { 
        transform: translateX(-1px) translateY(-1px);
    }
    100% { 
        transform: translateX(1px) translateY(1px);
    }
}

/* Tanks */

#tanks-canvas { 
    border: 2px solid #333; 
    background-color: #e0f2f7; 
    display: block; 
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}



/* Game Controls Area */
#game-controls span { margin: 0 10px; font-style: italic; color: #555; }
.setup-group { display: none; }
.setup-group.active { display: block; }
#difficulty-select label { display: block; margin: 5px 0; text-align: left; margin-left: 35%;}

button.danger-btn {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

button.danger-btn:hover {
    background-color: #f5c6cb;
}

/* NEW: Keyframe animations for enhanced visual feedback */
@keyframes pulse-selection {
    0%, 100% { 
        outline-color: #ffd700; 
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% { 
        outline-color: #ffed4e; 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

@keyframes pulse-valid-move {
    0%, 100% { 
        background-color: rgba(144, 238, 144, 0.7) !important; 
    }
    50% { 
        background-color: rgba(144, 238, 144, 0.9) !important; 
    }
}

@keyframes pulse-piece-removal {
    0%, 100% { 
        outline-color: #ff4444;
        background-color: rgba(255, 68, 68, 0.3) !important;
        box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
    }
    50% { 
        outline-color: #ff6666;
        background-color: rgba(255, 68, 68, 0.5) !important;
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.9);
    }
}

@keyframes shake-piece {
    0% { 
        transform: translateX(-1px) translateY(-1px);
    }
    100% { 
        transform: translateX(1px) translateY(1px);
    }
}



/* Game Controls Area */
#game-controls span { margin: 0 10px; font-style: italic; color: #555; }
.setup-group { display: none; }
.setup-group.active { display: block; }
#difficulty-select label { display: block; margin: 5px 0; text-align: left; margin-left: 35%;}

button.danger-btn {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

button.danger-btn:hover {
    background-color: #f5c6cb;
}

/* NEW: Bot thinking indicator for tic-tac-toe */
.tic-tac-toe-cell.bot-thinking {
    outline: 2px solid #9c27b0 !important;
    outline-offset: -2px;
    animation: pulse-bot-thinking-ttt 1s ease-in-out infinite;
    background-color: rgba(156, 39, 176, 0.15) !important;
}

@keyframes pulse-bot-thinking-ttt {
    0%, 100% { 
        outline-color: #9c27b0;
        background-color: rgba(156, 39, 176, 0.15) !important;
        box-shadow: 0 0 3px rgba(156, 39, 176, 0.4);
    }
    50% { 
        outline-color: #ba68c8;
        background-color: rgba(156, 39, 176, 0.25) !important;
        box-shadow: 0 0 8px rgba(156, 39, 176, 0.6);
    }
}

/* NEW: Bot thinking indicator for connect-four */
.connect-four-cell.bot-thinking {
    outline: 2px solid #9c27b0 !important;
    outline-offset: -2px;
    animation: pulse-bot-thinking-cf 1.2s ease-in-out infinite;
    background-color: rgba(156, 39, 176, 0.1) !important;
}

@keyframes pulse-bot-thinking-cf {
    0%, 100% { 
        outline-color: #9c27b0;
        background-color: rgba(156, 39, 176, 0.1) !important;
        box-shadow: 0 0 4px rgba(156, 39, 176, 0.4);
    }
    50% { 
        outline-color: #ba68c8;
        background-color: rgba(156, 39, 176, 0.2) !important;
        box-shadow: 0 0 12px rgba(156, 39, 176, 0.6);
    }
}

/* Enhanced dropping piece animation */
.connect-four-cell.dropping-piece {
    box-shadow: 
        inset 2px 2px 5px rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.4),
        0 0 15px rgba(255,255,255,0.3); /* Add a subtle glow during animation */
}

/* NEW: Bot thinking indicator for memory cards */
.memory-card.bot-thinking {
    outline: 2px solid #9c27b0 !important;
    outline-offset: -2px;
    animation: pulse-bot-thinking-memory 1.3s ease-in-out infinite;
    background-color: rgba(156, 39, 176, 0.1) !important;
}

@keyframes pulse-bot-thinking-memory {
    0%, 100% { 
        outline-color: #9c27b0;
        background-color: rgba(156, 39, 176, 0.1) !important;
        box-shadow: 0 0 5px rgba(156, 39, 176, 0.4);
        transform: scale(1);
    }
    50% { 
        outline-color: #ba68c8;
        background-color: rgba(156, 39, 176, 0.2) !important;
        box-shadow: 0 0 15px rgba(156, 39, 176, 0.6);
        transform: scale(1.02);
    }
}

/* Enhanced card flip animations */
.memory-card.revealed {
    animation: card-flip-reveal 0.3s ease-out;
}

.memory-card.matched {
    animation: card-match 0.5s ease-out;
}

@keyframes card-flip-reveal {
    0% {
        transform: rotateY(180deg) scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: rotateY(180deg) scale(1);
        opacity: 1;
    }
}

@keyframes card-match {
    0% {
        transform: rotateY(180deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) scale(1.1);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
    100% {
        transform: rotateY(180deg) scale(1);
        box-shadow: none;
    }
}

/* Tsoro ye Matatu */
.tsoro-board {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    user-select: none;
}

.tsoro-board svg {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tsoro-board circle {
    transition: all 0.2s ease;
}

.tsoro-board circle:hover {
    transform: scale(1.01);
    filter: brightness(1.05);
}

/* Bot thinking animation for Tsoro */
.tsoro-board circle[stroke-dasharray] {
    animation: tsoro-bot-thinking 1.5s ease-in-out infinite;
}

@keyframes tsoro-bot-thinking {
    0%, 100% { 
        stroke-opacity: 0.6;
        stroke-dashoffset: 0;
    }
    50% { 
        stroke-opacity: 1;
        stroke-dashoffset: 10;
    }
}

.tanks-canvas {
    position: relative;
}

@keyframes tanks-bot-thinking {
    0%, 100% { 
        stroke-opacity: 0.6;
    }
    50% { 
        stroke-opacity: 1;
    }
}


/* Enhanced mute button styling */
.settings-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 12px;
    font-size: 0.9em;
    font-weight: bold;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-button:hover { 
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* Muted state styling */
.settings-button[data-muted="true"] {
    background-color: #ffcccb;
    border-color: #ff6b6b;
    color: #721c24;
}

.settings-button[data-muted="true"]:hover {
    background-color: #ffb3b3;
    border-color: #ff5252;
}

/* Active/pressed state */
.settings-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

