/* Global Reset & Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
}

/* Backgrounds - Classes to be applied to body by specific games if needed, 
   or games can override/set their own background in their specific CSS */
.bg-candy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-snake {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.bg-menu {
    background-color: #000000;
}

.bg-flappy {
    background: linear-gradient(180deg, #70c5ce 0%, #87ceeb 100%);
}

.bg-sudoku {
    background: linear-gradient(135deg, #a8c0ff 0%, #3f2b96 100%);
}

.bg-backgammon {
    background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
}

/* Game Container */
.game-container {
    text-align: center;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 64px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
}

/* Score Board */
.score-board {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 15px 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    display: inline-flex;
    justify-content: space-around;
    gap: 40px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 20px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.score-value {
    font-size: 36px;
    font-weight: bold;
}

/* Controls Footer */
.controls {
    margin-top: 20px;
    color: white;
    font-size: 20px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Canvas / Board Generic Styles */
.game-board-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: inline-block;
}

canvas {
    border-radius: 10px;
    background: #000;
    display: block;
}

/* Modals (Game Over, etc.) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 60px 100px;
    border-radius: 30px;
    border: 8px solid #FFD700;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal h2 {
    color: white;
    font-size: 72px;
    margin-bottom: 30px;
    text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
}

.modal p {
    color: white;
    font-size: 40px;
    margin: 20px 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

/* Buttons */
button {
    background: #4CAF50;
    color: white;
    border: 4px solid white;
    padding: 25px 70px;
    font-size: 38px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

button:focus,
button:hover {
    outline: none;
    border-color: #FFD700;
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

/* New Record Animation */
.new-record {
    color: #FFD700;
    display: none;
    animation: pulse 1s infinite;
}

.new-record.show {
    display: block;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}