/* Body styles */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding-top: 10px;
    background-color: var(--bg, #F2F2F2);
    font-family: var(--font, 'Inter', system-ui, sans-serif);
}

/* Game container for canvas and timer */
#gameContainer {
    position: relative;
    text-align: center;
}

@media (max-width: 768px) {
    #game-container,
    .game-container {
        margin-top: 64px;
    }
}

/* Timer display styling */
#timerDisplay {
    position: absolute;
    top: -30px; /* Position above the canvas */
    right: 0;
    left: 0;
    font-size: 1.5em;
    color: black;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

/* Canvas styling */
#gameCanvas {
    max-width: 90vw;
    max-height: 90vh;
    background-size: 20% 20%; /* 5x5 grid */
    border: 1px solid #ccc;
}

/* General overlay styles */
.overlay {
    font-size: 2em;
    margin: 10px;
}

/* Feedback overlay styling */
#feedbackOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%; /* Larger box width */
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: var(--radius, 10px);
    display: none; /* Hidden by default */
    text-align: center;
    z-index: 10;
    transition: opacity 0.2s ease;
}

#feedbackOverlay.correct {
    color: var(--success, #10B981);
}

#feedbackOverlay.incorrect {
    color: var(--danger, #EF4444);
}

/* Intro display styling */
#introDisplay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border-radius: var(--radius, 10px);
    display: none; /* Hidden by default */
    text-align: center;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.intro-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.intro-continue {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary, #2563EB);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.intro-continue:hover {
    background-color: var(--primary-hover, #1D4ED8);
}

#introDisplay h2 {
    font-size: 36px;
}

#introDisplay p {
    font-size: 48px; /* Larger font for countdown */
}

.end-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.end-card {
    background: var(--surface, #FFFFFF);
    padding: 20px;
    border-radius: var(--radius, 10px);
    border: 1px solid var(--border, #E5E7EB);
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.08));
    text-align: center;
}

.end-score {
    font-size: 1.5em;
    margin: 10px 0;
}

.end-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.end-actions button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: var(--primary, #2563EB);
    color: #fff;
    transition: background-color 0.15s ease;
}

.end-actions button:hover {
    background: var(--primary-hover, #1D4ED8);
}

.current-user {
    background-color: rgba(255, 255, 0, 0.15);
    font-weight: bold;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #feedbackOverlay, #introDisplay { width: 70%; padding: 16px; font-size: 20px; }
    #introDisplay h2 { font-size: 28px; }
    #introDisplay p { font-size: 36px; }
}

@media (max-width: 480px) {
    #feedbackOverlay, #introDisplay { width: 80%; font-size: 18px; }
    #introDisplay h2 { font-size: 22px; }
    #introDisplay p { font-size: 32px; }
    .intro-continue { padding: 12px 18px; }
    .end-actions { flex-direction: column; gap: 8px; }
    .end-actions button { width: 100%; padding: 12px 15px; }
}