/* Games Hub Styles */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    min-height: 400px;
    height: auto;
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: visible;
    margin-bottom: 50px;
}

/* =================================== */
/* General Content Responsiveness (Mobile) */
/* =================================== */
@media (max-width: 767px) {
    /* Ensure main content containers have some padding */
    .box, .content, .dashboard-container, main.container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Make images within content responsive */
    .box img, .content img, .dashboard-card img, .faculty-profile img, .alumni-card img {
        max-width: 100%;
        height: auto;
    }

    /* Adjust specific element padding/margins if needed */
    .welcome-section {
        padding: 20px;
        text-align: center; /* Center welcome text */
    }
     .welcome-section .text-right {
         text-align: center !important; /* Override text-right */
         margin-top: 15px;
     }


    /* Improve table responsiveness */
    .table-responsive { /* Ensure tables are wrapped in this */
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        display: block; /* Needed for overflow to work */
        margin-bottom: 1rem; /* Add some space below tables */
    }
    
    table {
        min-width: 600px; /* Example: Force minimum width to encourage scrolling */
        width: 100%; /* Ensure table tries to fit */
    }
    /* Adjust column behavior for responsive stacking */
    .row > .col-md-8, 
    .row > .col-md-4 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Prevent overflow from fixed widths */
    .content-wrapper,
    .game-container,
    .game-grid {
        max-width: 100%;
        width: auto;
    }

    /* Responsive typography */
    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    h3 { font-size: 1.5em; }
     /* Simplify complex layouts like dashboards */
    .dashboard-card {
         margin-bottom: 15px;
     }

     /* Ensure forms are usable */
     form .form-group, form .form-row > div {
        margin-bottom: 15px; /* Add space between form elements */
     }
     form button {
         width: 100%; /* Make buttons full width for easier tapping */
         margin-top: 10px;
     }
     
     /* Address potential footer issues */
    .site-footer .footer-col {
        text-align: center; /* Center footer columns */
        margin-bottom: 20px;
    }
    .site-footer .text-right, .site-footer .text-left {
        text-align: center !important; /* Override alignment */
    }
    .utility-links {
        display: flex;
        flex-direction: column; /* Stack utility links */
        align-items: center;
    }
     .utility-links a {
        margin-bottom: 5px;
     }
     .utility-links .separator { display: none; } /* Hide separators */
     .visitor-counter { margin-top: 10px; }


    /* --- Specific Fixes for fun-learning-games.html --- */
    .game-grid {
        grid-template-columns: 1fr; /* Stack games vertically */
        gap: 25px;
    }

    .game-container {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .game-container:hover {
        transform: none; /* Disable hover effect on mobile if it causes issues */
    }

    .section-header h1 {
        font-size: 1.8em;
    }
    
    .game-controls button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .floating-icons {
        right: 10px; /* Move closer to edge */
        gap: 10px;
    }
    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    /* Memory Game */
    .memory-board {
        grid-template-columns: repeat(4, 1fr); /* Adjust grid for smaller size */
        gap: 8px;
        padding: 8px;
    }
    .memory-card {
        height: 60px; /* Smaller cards */
    }
    .memory-card .card-face {
        font-size: 24px; /* Adjust icon size */
    }

    /* Word Scramble */
    .word-scramble input[type="text"] {
        font-size: 1em;
        padding: 8px;
    }

    /* Snake Game */
    #snakeCanvas {
        max-width: 100%;
        height: auto; /* Ensure canvas scales */
    }
    
    /* Quiz Game */
    .quiz-options button {
        width: 100%; /* Full width buttons */
        margin-bottom: 10px;
        font-size: 0.9em;
        padding: 10px;
    }
    
    /* Tetris Game */
    #tetrisCanvas {
         max-width: 100%;
         height: auto;
     }
    
    /* Typo Master */
     .typo-master input[type="text"] {
         font-size: 1em;
         padding: 8px;
     }
}


/* =================================== */
/* Simplified Header Styles          */
/* =================================== */
.simple-header-container {
    background-color: #ffffff; /* Or match your theme */
    padding: 5px 0; /* Minimal padding */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; /* For potential absolute elements if needed */
    z-index: 1031; /* Above standard navbar if it exists */
}

.simple-header {
    display: flex;
    align-items: center;
    justify-content: center; /* Center logo by default */
    height: 50px; /* Adjust height as needed */
}

.simple-header .simple-logo {
    height: 40px; /* Adjust logo size */
    width: auto;
}

.dark-mode .simple-header-container {
    background-color: #1e1e1e; /* Dark mode background */
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Ensure content below simplified header has appropriate top margin/padding */
.content-below-simple-header {
     padding-top: 20px; /* Add some space below the simple header */
}


/* ============================================= */
/* General Content Responsiveness (Mobile)     */
/* ============================================= */
@media (max-width: 767px) {
    /* --- Simplified Header Responsive --- */
    .simple-header {
        justify-content: flex-start; /* Align logo to the left on mobile */
        padding-left: 15px;
    }
    .simple-header .simple-logo {
        height: 35px;
    }
    .content-below-simple-header {
         padding-top: 15px; /* Adjust padding for mobile */
    }

    /* --- General Content --- */
    .box, .content, .dashboard-container, main.container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .box img, .content img, .dashboard-card img, .faculty-profile img, .alumni-card img {
        max-width: 100%;
        height: auto;
    }

    .welcome-section {
        padding: 20px;
        text-align: center;
    }
     .welcome-section .text-right {
         text-align: center !important;
         margin-top: 15px;
     }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        margin-bottom: 1rem;
    }

    table.table { /* Target Bootstrap tables */
        min-width: 600px;
        width: 100%;
    }

     .row > .col-md-8, .row > .col-md-4 {
         width: 100%;
         flex: 0 0 100%;
         max-width: 100%;
     }

    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    h3 { font-size: 1.5em; }

    .dashboard-card {
         margin-bottom: 15px;
     }

     form .form-group, form .form-row > div {
        margin-bottom: 15px;
     }
     /* Apply width:100% carefully, excluding known buttons */
     form button:not(.navbar-toggle):not(.chatbot-close):not(.close-btn):not(#accessibilityBtn button):not(.accessibility-option button):not(.reset-button):not(.suggestion-button):not(.translate-btn-style) {
         width: 100%;
         margin-top: 10px;
     }
     /* Ensure game control buttons are not full width */
    .game-controls button {
        width: auto !important;
        margin-top: 5px;
    }
     .typo-master button {
         width: auto !important;
     }


    .site-footer .footer-col {
        text-align: center;
        margin-bottom: 20px;
    }
    .site-footer .text-right, .site-footer .text-left {
        text-align: center !important;
    }
    .utility-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
     .utility-links a {
        margin-bottom: 5px;
     }
     .utility-links .separator { display: none; }
     .visitor-counter { margin-top: 10px; }


    /* --- Specific Fixes for fun-learning-games.html --- */
    .game-grid {
        display: grid; /* Ensure grid is used */
        grid-template-columns: 1fr; /* Stack games vertically */
        gap: 25px;
    }

    .game-container {
        padding: 20px;
        margin-bottom: 20px;
        transform: none; /* Disable hover effect */
    }

    .section-header h1 {
        font-size: 1.8em;
    }

    .floating-icons {
        right: 10px;
        gap: 10px;
        display: none; /* Hide floating icons on small screens to avoid overlap */
    }
    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Memory Game */
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 8px;
    }
    .memory-card {
        height: 60px;
    }
    .memory-card .card-face {
        font-size: 24px;
    }

    /* Word Scramble */
    .word-scramble input[type="text"] {
        font-size: 1em;
        padding: 8px;
        width: calc(100% - 20px); /* Ensure input fits */
        margin: 10px 0;
    }
    .word-scramble .game-controls {
        display: flex;
        flex-wrap: wrap; /* Allow buttons to wrap */
        justify-content: center;
        gap: 5px;
    }

    /* Snake Game */
    #snakeCanvas {
        max-width: 100%;
        height: auto;
        width: 100%; /* Explicit width */
    }

    /* Quiz Game */
    .quiz-options button {
        width: 100%;
        margin-bottom: 10px;
        font-size: 0.9em;
        padding: 10px;
    }

    /* Tetris Game */
    #tetrisCanvas {
         max-width: 100%;
         height: auto;
         width: 100%;
     }

    /* Typo Master */
     .typo-master input[type="text"] {
         font-size: 1em;
         padding: 8px;
         width: calc(100% - 20px);
     }
}

.game-container:not(:last-child) {
    margin-bottom: 30px;
}

.game-container h3 {
    margin-bottom: 20px;
    color: #333;
}

.game-container .game-category {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.game-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.game-section {
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 12px;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #2193b0, #6dd5ed);
    color: white;
    border-radius: 8px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px;
}

/* Tic Tac Toe Styles */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px auto;
    max-width: 400px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.cell {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
}

.cell:hover {
    background: #f0f0f0;
    transform: scale(0.98);
}

.cell.x {
    color: #e74c3c;
}

.cell.o {
    color: #3498db;
}

.cell.winner {
    background: #2ecc71;
    color: white;
    animation: pulse 1s infinite;
}

.cell-animation {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

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

#currentPlayer.x {
    color: #e74c3c;
}

#currentPlayer.o {
    color: #3498db;
}

/* Dark mode styles for Tic Tac Toe */
.dark-mode .game-board {
    background: #2d3436;
}

.dark-mode .cell {
    background: #34495e;
    border-color: #4b6cb7;
    color: white;
}

.dark-mode .cell:hover {
    background: #2c3e50;
}

/* Memory Game */
.memory-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 7px;
    padding: 2px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.memory-card {
    aspect-ratio: 1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    width: 100%;
    height: 100%;
    min-height: 100px;
    margin: 0 auto;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-front {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    transform: rotateY(180deg);
}

.card-back {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.game-controls button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.score, .hints {
    font-size: 1.2em;
    margin: 0 10px;
}

/* Word Scramble */
.word-scramble {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
}

.scrambled-word {
    font-size: 2.5em;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
    color: #2193b0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#wordGuess {
    padding: 12px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 15px auto;
    width: 80%;
    max-width: 300px;
    display: block;
}

.word-scramble .game-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px auto;
    max-width: 400px;
    padding: 10px;
}

.word-scramble .score,
.word-scramble .hints {
    grid-column: 1 / -1;
    font-size: 1.2em;
    margin: 10px 0;
    padding: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.word-scramble button {
    padding: 12px 20px;
    font-size: 1em;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.word-scramble button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Dark mode styles for Word Scramble */
.dark-mode .scrambled-word {
    color: #6dd5ed;
}

.dark-mode #wordGuess {
    background: #2d3436;
    border-color: #4b6cb7;
    color: white;
}

.dark-mode .word-scramble .score,
.dark-mode .word-scramble .hints {
    background: rgba(255,255,255,0.05);
    color: white;
}

@media (max-width: 480px) {
    .word-scramble .game-controls {
        grid-template-columns: 1fr;
    }
    
    .word-scramble button {
        padding: 10px 15px;
    }
}

/* Snake Game */
.snake-game {
    border: 2px solid #333;
    border-radius: 8px;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #1a1a1a;
    color: #fff;
}

.dark-mode .game-container {
    background: rgba(45, 52, 54, 0.95);
    color: white;
    border: 1px solid #4b6cb7;
}

.dark-mode .game-container:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.dark-mode .game-container h2,
.dark-mode .game-container h3,
.dark-mode .game-container p {
    color: #fff;
}

.dark-mode .section-header {
    background: linear-gradient(45deg, #4b6cb7, #182848);
}

.dark-mode .game-controls {
    background: #34495e;
    color: #fff;
}

.dark-mode .game-controls button {
    background: #4b6cb7;
}

.dark-mode .game-controls button:hover {
    background: #3a5795;
}

.dark-mode .score,
.dark-mode .hints {
    color: #fff;
}

/* Updated Breakout game dark mode styles */
.dark-mode #breakoutCanvas {
    background: #2d3436;
    border-color: #4b6cb7;
}

.dark-mode .paddle {
    background: #6dd5ed !important;
}

.dark-mode input,
.dark-mode select {
    background: #2d3436;
    color: #fff;
    border: 1px solid #4b6cb7;
}

.dark-mode input::placeholder {
    color: #888;
}

.dark-mode input[type="text"] {
    background: #34495e;
    color: white;
    border: 1px solid #4b6cb7;
}

.dark-mode input[type="text"]::placeholder {
    color: #95a5a6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .memory-board {
        grid-template-columns: repeat(3, 1fr);
        max-width: 300px;
    }

    .game-container {
        margin: 10px;
        padding: 15px;
    }

    .game-board {
        max-width: 350px;
        gap: 8px;
        padding: 10px;
    }

    .cell {
        font-size: 2.5em;
        min-height: 80px;
    }

    .game-controls {
        flex-direction: column;
    }
    
    .game-controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-board {
        max-width: 300px;
        gap: 6px;
        padding: 8px;
    }

    .cell {
        font-size: 2em;
        min-height: 70px;
    }

    .game-controls {
        flex-direction: column;
    }
    
    .game-controls button {
        width: 100%;
    }
}

/* Breakout Game Styles */
.breakout-container {
    width: 100%;
    max-width: 480px;
    height: 320px;
    margin: 0 auto;
    position: relative;
    background: #2d3436;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#breakoutCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #2d3436;
}

/* Dark mode styles for Breakout */
.dark-mode .breakout-container {
    background: #1a1a1a;
}

.dark-mode #breakoutCanvas {
    background: #1a1a1a;
}

@media (max-width: 768px) {
    .breakout-container {
        max-width: 100%;
        height: 280px;
    }
}

@media (max-width: 480px) {
    .breakout-container {
        height: 240px;
    }
}

/* Color Match Game */
.color-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.color-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #fff; /* White border */
    border-radius: 50%; /* Circular buttons */
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

#color-display {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px; /* Ensure it's visible even when empty */
    margin: 20px 0;
}

.color-square {
    width: 250px;
    height: 250px;
    margin: 5px;
    border: 2px solid #fff;
}

.color-btn[data-color="red"] {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    border: 3px solid #ee5253;
}

.color-btn[data-color="blue"] {
    background: linear-gradient(135deg, #4ecdc4, #2193b0);
    border: 3px solid #2193b0;
}

.color-btn[data-color="green"] {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: 3px solid #27ae60;
}

.color-btn[data-color="yellow"] {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border: 3px solid #f39c12;
}

.dark-mode .color-btn {
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode #color-display {
    border-color: rgba(255, 255, 255, 0.2);
    background: #2d3436;
}

.color-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.color-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.color-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    font-size: 20px;
}

.dark-mode .dark-mode-toggle {
    background: #2d3436;
    color: #fff;
    box-shadow: 0 2px 5px rgba(255,255,255,0.1);
}

/* Checkers Game */
.checkers {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: #8B4513;
    padding: 10px;
    border-radius: 8px;
    max-width: 400px;
    margin: 20px auto;
}

.checkers-cell {
    aspect-ratio: 1;
    background: #DEB887;
    border-radius: 4px;
    position: relative;
}

.checkers-cell.dark {
    background: #8B4513;
}

.checker {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    position: absolute;
    top: 10%;
    left: 10%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.checker.red {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
}

.checker.black {
    background: linear-gradient(135deg, #2d3436, #636e72);
}

.checker.king::after {
    content: '👑';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
}

/* 15 Puzzle */
.puzzle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    background: #2d3436;
    padding: 10px;
    border-radius: 8px;
    max-width: 400px;
    margin: 20px auto;
}

.puzzle-tile {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.puzzle-tile:hover {
    transform: scale(0.95);
}

.puzzle-tile.empty {
    background: transparent;
    cursor: default;
}

/* Hangman Game */
#hangman-game {
    text-align: center;
    padding: 20px;
}

#hangman-drawing {
    width: 200px;
    height: 250px;
    margin: 0 auto;
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
}

#word-display {
    font-size: 2em;
    letter-spacing: 5px;
    margin: 20px 0;
    font-family: monospace;
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-width: 400px;
    margin: 20px auto;
}

.letter-btn {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.letter-btn:hover {
    transform: scale(0.95);
}

.letter-btn.used {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Bubble Pop Game */
#bubbleCanvas {
    background: linear-gradient(180deg, #2d3436, #636e72);
    border-radius: 8px;
    margin: 20px auto;
    display: block;
}

/* Dark Mode Styles */
.dark-mode .checkers {
    background: #2d3436;
}

.dark-mode .checkers-cell {
    background: #636e72;
}

.dark-mode .checkers-cell.dark {
    background: #2d3436;
}

.dark-mode .puzzle {
    background: #636e72;
}

.dark-mode .puzzle-tile {
    background: linear-gradient(135deg, #4b6cb7, #182848);
}

.dark-mode #hangman-drawing {
    border-color: #636e72;
}

.dark-mode .letter-btn {
    background: linear-gradient(135deg, #4b6cb7, #182848);
}

.dark-mode .letter-btn.used {
    background: #2d3436;
}

/* Responsive Design */
@media (max-width: 768px) {
    .checkers, .puzzle {
        max-width: 320px;
    }
    
    .letter-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    #bubbleCanvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .checkers, .puzzle {
        max-width: 280px;
    }
    
    .letter-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 768px) {
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        max-width: 500px;
    }
}

@media (max-width: 480px) {
    .memory-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
}

/* Bubble Pop Game */
.bubble-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bubble-container .game-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.bubble-container .game-controls button {
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bubble-container .game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
} 
/* Premium UI Enhancements - Merged */
/* Variables */
:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    --secondary-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --dark-glass-bg: rgba(30, 30, 30, 0.7);
    --dark-glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --dark-text-primary: #dfe6e9;
    --dark-text-secondary: #b2bec3;
}
/* Global Polish */
body {
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    color: var(--text-primary);
}
/* Enhanced Game Container (Glassmorphism) */
.game-container {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: 20px !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27), box-shadow 0.4s ease !important;
    overflow: hidden;
}
.game-container:hover {
    transform: translateY(-10px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
}
/* Premium Buttons */
button {
    border: none;
    background-size: 200% auto;
    transition: 0.5s;
    font-weight: 600;
    letter-spacing: 0.5px;
}
button:hover {
    background-position: right center;
    transform: translateY(-2px);
}
/* Custom Modal Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.custom-modal {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.7);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.dark-mode .custom-modal {
    background: #2d3436;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.custom-modal-overlay.active .custom-modal {
    transform: scale(1);
}
.modal-icon {
    font-size: 50px;
    margin-bottom: 20px;
    display: block;
    animation: bounce 1s infinite;
}
.modal-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.modal-message {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.dark-mode .modal-message {
    color: var(--dark-text-secondary);
}
.modal-btn {
    padding: 12px 30px;
    border-radius: 50px;
    background: var(--primary-gradient);
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    outline: none;
}
.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #b2bec3;
    transition: color 0.3s;
}
.modal-close:hover {
    color: #ff7675;
}
@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
/* Dark Mode Overrides */
.dark-mode .game-container {
    background: var(--dark-glass-bg) !important;
    border: 1px solid var(--dark-glass-border) !important;
}
/* Floating Icons Enhancement */
.floating-icons {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.floating-icon {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
    color: #333;
}
.floating-icon:hover {
    background: var(--primary-gradient);
    color: white;
}
