/* Sudoku Game - Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Ensure footer stays at bottom */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Trusted Device Styles */
.trusted-device-checkbox {
    margin-top: 1rem;
}

.trusted-device-checkbox .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.trusted-device-checkbox .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.trusted-device-info {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.trusted-device-info i {
    color: var(--info-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin-top: -1.5rem;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Sudoku Board Styles */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: #333;
    border: 2px solid #333;
    max-width: 450px;
    margin: 0 auto;
}

.sudoku-cell {
    width: 100%;
    height: 50px;
    border: none;
    background-color: white;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sudoku-cell:hover {
    background-color: #f0f0f0;
}

.sudoku-cell:focus {
    background-color: #e3f2fd;
    outline: none;
    box-shadow: inset 0 0 0 2px #2196f3;
}

.sudoku-cell.original {
    background-color: #e8f5e8;
    color: #2e7d32;
    font-weight: 700;
}

/* Correct Guess Styling */
.sudoku-cell.correct-guess {
    background-color: #c8e6c9;
    color: #2e7d32;
    font-weight: 600;
    cursor: default;
}

.sudoku-cell.correct-guess:hover {
    background-color: #c8e6c9;
}

.sudoku-cell.correct-guess:focus {
    background-color: #c8e6c9;
    box-shadow: none;
}

/* Readonly Cell Styling */
.sudoku-cell[readonly] {
    cursor: default;
    user-select: none;
}

.sudoku-cell[readonly]:hover {
    background-color: inherit;
}

.sudoku-cell[readonly]:focus {
    box-shadow: none;
}

/* Original cells should keep their styling */
.sudoku-cell.original[readonly]:hover {
    background-color: #e8f5e8;
}

.sudoku-cell.correct-guess[readonly]:hover {
    background-color: #c8e6c9;
}

/* Correct Highlight Animation */
.sudoku-cell.correct-highlight {
    background-color: #4caf50 !important;
    color: white !important;
    transform: scale(1.05);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.sudoku-cell.user-input {
    color: #2196f3;
}

.sudoku-cell.error {
    background-color: #ffebee;
    color: #d32f2f;
}

.sudoku-cell.highlight {
    background-color: #e8f5e8;
}

/* 3x3 Box Borders */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid #333;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #333;
}

/* Game Controls */
.game-controls {
    margin-top: 2rem;
    text-align: center;
}

.game-controls .btn {
    margin: 0.5rem;
    min-width: 120px;
}

/* Timer */
.game-timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 1rem 0;
}

/* Difficulty Selector */
.difficulty-selector {
    margin-bottom: 2rem;
}

.difficulty-btn {
    margin: 0.25rem;
    min-width: 100px;
}

.difficulty-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.1rem;
    opacity: 0.9;
}


/* Forms */
.form-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Dashboard */
.dashboard-stats {
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.dashboard-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sudoku-board {
        max-width: 100%;
    }

    .sudoku-cell {
        height: 40px;
        font-size: 16px;
    }

    .game-controls .btn {
        min-width: 100px;
        margin: 0.25rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .sudoku-cell {
        height: 35px;
        font-size: 14px;
    }

    .game-controls .btn {
        min-width: 80px;
        font-size: 0.9rem;
    }

    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Game Completion Animation */
.completion-animation {
    animation: celebration 1s ease-out;
}

@keyframes celebration {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Game ID styling */
#game-id-display {
    font-size: 0.85rem;
    color: #6c757d;
}

#game-id-number {
    font-weight: bold;
    color: #495057;
}

/* --- Sudoku Game Styles from play.php --- */
.sudoku-grid-wrapper {
    background-color: #333;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
    margin: 0 auto;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    max-width: none;
    margin: 0;
}

.sudoku-cell {
    aspect-ratio: 1;
    background-color: white;
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.sudoku-cell::-webkit-outer-spin-button,
.sudoku-cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sudoku-cell:hover {
    background-color: #f8f9fa;
}

.sudoku-cell:focus {
    background-color: #e3f2fd;
    outline: none;
}

.sudoku-cell.original {
    background-color: #f5f5f5;
    color: #333;
}

.sudoku-cell.error {
    background-color: #ffebee;
    color: #d32f2f;
}

.sudoku-cell.current-error {
    background-color: #ffcdd2 !important;
    color: #d32f2f !important;
    border: 2px solid #d32f2f !important;
}

.sudoku-cell.conflict-error {
    background-color: #ffe0b2 !important;
    color: #f57c00 !important;
    border: 2px solid #f57c00 !important;
}

.sudoku-cell.selected {
    background-color: #e3f2fd;
}

.sudoku-cell.hint-row {
    background-color: #2196f3 !important;
}

.sudoku-cell.hint-column {
    background-color: #ffeb3b !important;
}

.sudoku-cell.hint-block {
    background-color: #00bcd4 !important;
}

.sudoku-cell.completed {
    background-color: #d4edda !important;
    border: 2px solid #28a745 !important;
    color: #155724 !important;
    font-weight: bold !important;
    animation: completedPulse 2s ease-in-out;
}

@keyframes completedPulse {
    0% {
        background-color: #d4edda;
        transform: scale(1);
    }

    25% {
        background-color: #c3e6cb;
        transform: scale(1.05);
    }

    50% {
        background-color: #b1dfbb;
        transform: scale(1.1);
    }

    75% {
        background-color: #c3e6cb;
        transform: scale(1.05);
    }

    100% {
        background-color: #d4edda;
        transform: scale(1);
    }
}

.sudoku-cell.show-off-highlight {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border-color: #e0a800 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5) !important;
    animation: showOffPulse 0.1s ease-in-out;
}

@keyframes showOffPulse {
    0% {
        background-color: #ffc107;
        transform: scale(1);
    }

    50% {
        background-color: #ffca2c;
        transform: scale(1.05);
    }

    100% {
        background-color: #ffc107;
        transform: scale(1);
    }
}

.sudoku-cell:nth-child(3n) {
    border-right: 2px solid #333;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #333;
}

.sudoku-cell:nth-child(9n+1) {
    border-left: 2px solid #333;
}

.sudoku-cell:nth-child(-n+9),
.sudoku-cell:nth-child(n+28):nth-child(-n+36),
.sudoku-cell:nth-child(n+55):nth-child(-n+63) {
    border-top: 2px solid #333;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 20px auto;
}

.number-btn {
    aspect-ratio: 1;
    border: 2px solid #007bff;
    background-color: white;
    color: #007bff;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover {
    background-color: #007bff;
    color: white;
}

.number-btn:disabled {
    background-color: #6c757d;
    color: #adb5bd;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.number-btn:disabled:hover {
    background-color: #6c757d;
    color: #adb5bd;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Mobile-first button spacing for better touch targets */
@media (max-width: 767px) {
    .action-buttons {
        gap: 16px;
        /* Increased gap for mobile */
        margin: 16px 0;
    }

    .action-buttons .btn {
        min-height: 44px;
        /* Apple's recommended minimum touch target size */
        padding: 12px 16px;
        /* Increased padding for better touch experience */
        margin-bottom: 12px;
        /* Increased bottom margin between buttons */
        font-size: 1rem;
        /* Ensure readable font size */
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .action-buttons {
        gap: 20px;
        /* Even more spacing for very small screens */
    }

    .action-buttons .btn {
        min-height: 48px;
        /* Slightly larger for very small screens */
        padding: 14px 18px;
        margin-bottom: 16px;
    }
}

/* Mobile improvements for completion popup and modals */
@media (max-width: 767px) {

    /* Information modal buttons (completion popup) */
    .information-footer .btn,
    #information-modal .btn {
        min-height: 44px;
        padding: 12px 16px;
        margin: 8px 4px;
        /* Add margin around buttons */
        font-size: 1rem;
    }

    /* Ensure buttons don't touch on mobile */
    .information-footer .btn+.btn,
    #information-modal .btn+.btn {
        margin-left: 12px;
        /* Increased left margin between buttons */
    }

    /* Modal content spacing */
    .information-content {
        margin: 20px;
        padding: 20px;
    }

    .information-footer {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #dee2e6;
    }
}

/* Extra small mobile devices - modal improvements */
@media (max-width: 480px) {

    .information-footer .btn,
    #information-modal .btn {
        min-height: 48px;
        padding: 14px 18px;
        margin: 10px 6px;
        font-size: 1rem;
    }

    .information-footer .btn+.btn,
    #information-modal .btn+.btn {
        margin-left: 16px;
        /* Even more spacing for very small screens */
    }

    .information-content {
        margin: 15px;
        padding: 15px;
    }
}

/* Bootstrap modal improvements for mobile */
@media (max-width: 767px) {
    .modal .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .modal .modal-footer .btn {
        margin: 4px 8px;
    }

    .modal .modal-footer .btn+.btn {
        margin-left: 12px;
    }

    .modal .d-grid.gap-2 {
        gap: 16px !important;
        /* Override Bootstrap's gap-2 for mobile */
    }

    .modal .d-grid.gap-2 .btn {
        min-height: 48px;
        padding: 14px 18px;
    }

    /* Target completion popup buttons specifically */
    #information-modal .mt-4 .btn {
        min-height: 44px;
        padding: 12px 16px;
        margin: 8px 4px;
        font-size: 1rem;
    }

    #information-modal .mt-4 .btn+.btn {
        margin-left: 16px !important;
        /* Override Bootstrap's me-2 */
    }

    /* Override Bootstrap margin utilities for mobile */
    #information-modal .me-2 {
        margin-right: 16px !important;
    }

    /* Ensure all buttons in completion popup have proper spacing */
    #information-modal .mt-4 {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    #information-modal .mt-4 .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .modal .btn {
        min-height: 48px;
        padding: 14px 18px;
        font-size: 1rem;
    }

    .modal .modal-footer .btn {
        margin: 6px 10px;
    }

    .modal .modal-footer .btn+.btn {
        margin-left: 16px;
    }

    .modal .d-grid.gap-2 {
        gap: 20px !important;
        /* Even more gap for very small screens */
    }

    .modal .d-grid.gap-2 .btn {
        min-height: 52px;
        padding: 16px 20px;
    }

    /* Target completion popup buttons specifically for extra small screens */
    #information-modal .mt-4 .btn {
        min-height: 48px;
        padding: 14px 18px;
        margin: 10px 6px;
        font-size: 1rem;
    }

    #information-modal .mt-4 .btn+.btn {
        margin-left: 20px !important;
        /* Even more spacing for very small screens */
    }

    /* Override Bootstrap margin utilities for extra small screens */
    #information-modal .me-2 {
        margin-right: 20px !important;
    }

    /* Ensure all buttons in completion popup have proper spacing */
    #information-modal .mt-4 {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    #information-modal .mt-4 .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Button group improvements for mobile */
@media (max-width: 767px) {
    .btn-group .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .btn-group .btn+.btn {
        margin-left: 8px;
        /* Ensure buttons don't touch */
    }

    .btn-group-vertical .btn {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .btn-group .btn {
        min-height: 48px;
        padding: 14px 18px;
        font-size: 1rem;
    }

    .btn-group .btn+.btn {
        margin-left: 12px;
    }

    .btn-group-vertical .btn {
        margin-bottom: 12px;
    }
}

.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-align: center;
    margin: 20px 0;
}

.error-count {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffc107;
    display: flex;
    align-items: center;
}

.difficulty-badge {
    font-size: 0.9rem;
}

.game-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 100%;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .game-container {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 40px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .game-main {
        flex: 0 0 auto;
        max-width: 450px;
    }

    .game-sidebar {
        flex: 0 0 350px;
        align-items: flex-start;
        max-width: 350px;
        min-width: 300px;
    }

    .number-pad {
        margin: 0;
        max-width: 300px;
        width: 100%;
    }

    .action-buttons {
        justify-content: flex-start;
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .game-container {
        max-width: 600px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .number-pad {
        max-width: 400px;
        width: 100%;
    }

    .action-buttons {
        max-width: 400px;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .game-container {
        padding: 0 10px;
    }

    .sudoku-grid {
        max-width: 100%;
        width: 100%;
    }

    .number-pad {
        max-width: 100%;
        width: 100%;
    }

    .action-buttons {
        width: 100%;
        max-width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 0 5px;
    }

    .action-buttons .btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .number-btn {
        font-size: 1.2rem;
    }

    .sudoku-cell {
        font-size: 1rem;
    }

    .error-count {
        font-size: 1rem;
    }

    .timer {
        font-size: 1.3rem;
    }
}

.btn {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.solution-display {
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background-color: #333;
    padding: 2px;
    border-radius: 4px;
    max-width: 200px;
    margin: 0 auto;
}

.solution-cell {
    aspect-ratio: 1;
    background-color: white;
    border: none;
    text-align: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: #6c757d;
    cursor: default;
    user-select: none;
}

.solution-cell:nth-child(3n) {
    border-right: 1px solid #333;
}

.solution-cell:nth-child(n+19):nth-child(-n+27),
.solution-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 1px solid #333;
}

body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure dropdown containers don't have overflow issues */
.navbar .container {
    overflow: visible;
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
}

.completion-notification {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.completion-notification.fade-out {
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#delete-btn {
    border-color: #dc3545;
    color: #dc3545;
}

#delete-btn:hover {
    background-color: #dc3545;
    color: white;
}

.sudoku-cell.completed-game {
    background-color: #d4edda !important;
    color: #155724 !important;
    font-weight: bold;
}

.completed-game .sudoku-cell {
    color: #155724 !important;
    font-weight: bold;
}

.information-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.information-modal.show {
    opacity: 1;
    visibility: visible;
}

.information-content {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.information-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.information-title {
    margin: 0;
    color: #333;
}

.information-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.information-body {
    padding: 20px;
    text-align: center;
    color: #555;
}

.information-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.hint-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.hint-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    z-index: 10002;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10004;
    pointer-events: all;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 18px;
    margin-top: 20px;
    text-align: center;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.number-pad-single-row {
    display: flex;
    justify-content: center;
    width: 103%;
    margin-top: 1rem;
}

.number-pad {
    display: contents;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    /* Match the max-width of .sudoku-board */
    margin: 0 auto;
    gap: 8px;
}

.number-btn {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 2px;
    height: 50px;
    font-size: 1.5rem;
}

.number-btn:hover {
    background-color: #007bff;
    color: white;
}

.number-btn:disabled {
    background-color: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.number-btn:disabled:hover {
    background-color: #6c757d;
    color: #adb5bd;
}

.number-pad-single-row .number-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* --- End Sudoku Game Styles from play.php --- */

/* --- Dropdown Debugging and Fixes --- */
.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1000 !important;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #1e2125;
    background-color: #e9ecef;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

/* Fix dropdown positioning to avoid overflow issues */
.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    overflow: visible !important;
    max-height: none !important;
    z-index: 1050 !important;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.navbar .dropdown-menu.show {
    display: block !important;
}

/* Ensure navbar dropdown container doesn't clip */
.navbar .dropdown {
    position: relative !important;
    overflow: visible !important;
}

/* Override any overflow constraints on parent containers for dropdown */
body .dropdown-menu,
.container .dropdown-menu,
.game-container .dropdown-menu {
    overflow: visible !important;
    max-height: none !important;
    z-index: 1050 !important;
}

/* Ensure dropdown items don't scroll */
.dropdown-menu {
    overflow: visible !important;
    max-height: none !important;
    scroll-behavior: auto !important;
    z-index: 1050 !important;
}

.dropdown-item {
    overflow: visible !important;
    scroll-behavior: auto !important;
    position: relative !important;
}

/* Debug styles - add outline to see dropdown elements */
.dropdown-toggle {
    outline: 1px solid rgba(255, 0, 0, 0.3) !important;
}

.dropdown-menu {
    outline: 1px solid rgba(0, 255, 0, 0.3) !important;
}

/* --- End Dropdown Debugging and Fixes --- */

/* Dashboard Game Cards */
.dashboard-game-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Dashboard Game Card Styling with Very Light Gradients */
.dashboard-game-card.completed {
    background: linear-gradient(45deg, #f0f8f0 0%, #e8f5e8 50%, #e0f2e0 100%) !important;
    border-color: #d4edda !important;
}

.dashboard-game-card.completed .card-body {
    background: linear-gradient(45deg, #f0f8f0 0%, #e8f5e8 50%, #e0f2e0 100%);
}

.dashboard-game-card.completed:hover {
    background: linear-gradient(45deg, #e8f5e8 0%, #e0f2e0 50%, #d8efd8 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.dashboard-game-card.active {
    background: linear-gradient(45deg, #fefef8 0%, #fefdf0 50%, #fefce8 100%) !important;
    border-color: #fff3cd !important;
}

.dashboard-game-card.active .card-body {
    background: linear-gradient(45deg, #fefef8 0%, #fefdf0 50%, #fefce8 100%);
}

.dashboard-game-card.active:hover {
    background: linear-gradient(45deg, #fefdf0 0%, #fefce8 50%, #fefbe0 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

/* Enhanced gradient effects for badges and buttons */
.dashboard-game-card.completed .badge.bg-success {
    background: linear-gradient(135deg, #155724 0%, #0f4c1a 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(21, 87, 36, 0.3);
}

.dashboard-game-card.active .badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

/* Styling for the new metrics badges */
.dashboard-game-card .badge.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
    color: white;
}

.dashboard-game-card .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    color: #212529;
}

.dashboard-game-card .badge.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    color: white;
}

/* Hover effects for badges */
.dashboard-game-card .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Ensure proper spacing between badges */
.dashboard-game-card .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

/* Badge container styling */
.dashboard-game-card .d-flex.flex-wrap.gap-1 {
    gap: 0.25rem !important;
}

/* Individual badge styling with better spacing */
.dashboard-game-card .badge:last-child {
    margin-right: 0;
}

/* Make badges more compact on smaller screens */
@media (max-width: 768px) {
    .dashboard-game-card .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.375rem;
        margin-right: 0.125rem;
        margin-bottom: 0.125rem;
    }

    .dashboard-game-card .badge i {
        margin-right: 0.25rem !important;
    }

    .dashboard-game-card .d-flex.flex-wrap.gap-1 {
        gap: 0.125rem !important;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .dashboard-game-card .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
    }

    .dashboard-game-card .badge i {
        margin-right: 0.2rem !important;
    }
}

/* Gradient buttons for completed games */
.dashboard-game-card.completed .btn-outline-primary {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #155724;
    color: #155724;
    transition: all 0.3s ease;
}

.dashboard-game-card.completed .btn-outline-primary:hover {
    background: linear-gradient(135deg, #155724 0%, #0f4c1a 100%);
    border-color: #155724;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 87, 36, 0.3);
}

/* Gradient buttons for active games */
.dashboard-game-card.active .btn-outline-primary {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #856404;
    color: #856404;
    transition: all 0.3s ease;
}

.dashboard-game-card.active .btn-outline-primary:hover {
    background: linear-gradient(135deg, #856404 0%, #6c5200 100%);
    border-color: #856404;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(133, 100, 4, 0.3);
}

/* Enhanced delete button styling */
.dashboard-game-card .btn-outline-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #721c24;
    color: #721c24;
    transition: all 0.3s ease;
}

.dashboard-game-card .btn-outline-danger:hover {
    background: linear-gradient(135deg, #721c24 0%, #491217 100%);
    border-color: #721c24;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(114, 28, 36, 0.3);
}

/* Add subtle inner shadow for depth */
.dashboard-game-card .card-body {
    position: relative;
}

.dashboard-game-card .card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    border-radius: 0.375rem;
}