/* Games page */
.games-list-section {
    padding: 2rem 0 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.game-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.game-card-icon {
    margin-bottom: 0.5rem;
}

.game-card-icon img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto;
}

.game-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-heading, #1a1a1a);
}

.game-card-desc {
    font-size: 0.9rem;
    color: var(--text-muted, #555);
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.game-card-playing {
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    margin: 0 0 1rem;
}

.game-card-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.game-card-badge-adults {
    background: rgba(15, 52, 96, 0.12);
    color: var(--primary, #0f3460);
}

.game-card-adults .game-card-icon {
    margin-top: 0;
}

.game-play-btn {
    width: 100%;
}

.game-panel-hint {
    font-size: 0.95rem;
    color: var(--text-muted, #555);
    margin: 0 0 1rem;
}

.game-badge-adults-inline {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary, #0f3460);
    background: rgba(15, 52, 96, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.game-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Game panel (when playing) */
.game-panel {
    display: none;
    padding: 2rem 0 3rem;
}

.game-panel.active {
    display: block;
}

.games-list-section.hidden {
    display: none;
}

.game-back-btn {
    background: none;
    border: none;
    color: var(--primary, #0f3460);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0.25rem 0;
}

.game-back-btn:hover {
    text-decoration: underline;
}

.game-panel-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 1rem;
    color: var(--text-heading, #1a1a1a);
}

.game-moves,
.game-score {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-muted, #555);
}

.game-restart-btn {
    margin-top: 1rem;
}

/* Memory Pairs */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-width: 320px;
    margin: 0 auto 1rem;
}

@media (max-width: 380px) {
    .memory-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 260px;
    }
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #0f3460 0%, #1a4a7a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s, opacity 0.2s;
    color: #fff;
}

.memory-card:hover {
    transform: scale(1.03);
}

.memory-card.flipped {
    background: #f0f0f0;
    color: #333;
}

.memory-card.matched {
    background: #0a9b5c;
    color: #fff;
    cursor: default;
    opacity: 0.9;
}

.memory-card .card-back {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Quick Math */
.math-question {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--text-heading, #1a1a1a);
}

.math-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.math-option {
    min-width: 80px;
    padding: 0.75rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.math-option:hover {
    background: #f5f5f5;
    border-color: var(--primary, #0f3460);
}

.math-option.correct {
    background: #d4edda;
    border-color: #0a9b5c;
}

.math-option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

.math-feedback {
    min-height: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.math-feedback.correct { color: #0a9b5c; }
.math-feedback.wrong { color: #dc3545; }

/* Word Scramble */
.scramble-hint {
    font-size: 1rem;
    color: var(--text-muted, #555);
    margin-bottom: 0.5rem;
}

.scramble-word {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--primary, #0f3460);
    margin-bottom: 1.25rem;
}

.scramble-input-wrap {
    display: flex;
    gap: 0.5rem;
    max-width: 280px;
    margin: 0 auto 1rem;
}

.scramble-input {
    flex: 1;
    padding: 0.65rem 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
}

.scramble-input:focus {
    outline: none;
    border-color: var(--primary, #0f3460);
}

.scramble-feedback {
    min-height: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.scramble-feedback.correct { color: #0a9b5c; }
.scramble-feedback.wrong { color: #dc3545; }

#scramble-next {
    margin-top: 0.5rem;
}

/* Reaction Test */
.reaction-instruction {
    font-size: 1rem;
    color: var(--text-muted, #555);
    margin-bottom: 1.5rem;
    text-align: center;
}

.reaction-box {
    width: 100%;
    max-width: 320px;
    height: 200px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    background: #6c757d;
    color: #fff;
}

.reaction-box.waiting {
    background: #dc3545;
    color: #fff;
}

.reaction-box.go {
    background: #0a9b5c;
    color: #fff;
}

.reaction-result {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

#reaction-try {
    display: none;
}

#reaction-try.visible {
    display: inline-block;
}

/* Sudoku */
.sudoku-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.sudoku-grid {
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 1.1rem;
    font-weight: 700;
}

.sudoku-grid td {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color, #ccc);
    text-align: center;
    vertical-align: middle;
    padding: 0;
}

.sudoku-grid td:nth-child(3n) {
    border-right-width: 2px;
}

.sudoku-grid tr:nth-child(3n) td {
    border-bottom-width: 2px;
}

.sudoku-grid input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.sudoku-grid input:focus {
    outline: none;
    background: rgba(15, 52, 96, 0.08);
}

.sudoku-grid .cell-given {
    background: #f0f0f0;
    color: #333;
}

.sudoku-grid .cell-error {
    background: #f8d7da;
}

.sudoku-feedback {
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.sudoku-feedback.success { color: #0a9b5c; }
.sudoku-feedback.error { color: #dc3545; }

@media (max-width: 400px) {
    .sudoku-grid td { width: 2rem; height: 2rem; font-size: 0.9rem; }
    .sudoku-grid input { font-size: 0.85rem; }
}

/* Crossword */
.crossword-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.crossword-clues {
    min-width: 200px;
}

.crossword-clues-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-heading, #1a1a1a);
}

.crossword-clues-list {
    font-size: 0.85rem;
    color: var(--text-muted, #555);
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    line-height: 1.5;
}

.crossword-grid-wrap {
    overflow-x: auto;
}

.crossword-grid {
    border-collapse: collapse;
    font-size: 1rem;
    font-weight: 700;
}

.crossword-grid td {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border-color, #999);
    text-align: center;
    vertical-align: middle;
    padding: 0;
}

.crossword-grid input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}

.crossword-grid input:focus {
    outline: none;
    background: rgba(15, 52, 96, 0.08);
}

.crossword-grid .cell-block {
    background: #333;
    border-color: #333;
}

.cell-num-label {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted, #666);
    z-index: 1;
    pointer-events: none;
}

.crossword-grid td:has(.cell-num-label) input {
    padding-left: 1rem;
    padding-top: 0.9rem;
}

.crossword-feedback {
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.crossword-feedback.success { color: #0a9b5c; }
.crossword-feedback.error { color: #dc3545; }

/* EQ & SQ games (for adults) */
.eq-score,
.sq-score {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #555);
    margin: 0 0 1rem;
}

.eq-question,
.sq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading, #1a1a1a);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.eq-options,
.sq-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 32em;
}

.eq-option,
.sq-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    text-align: left;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.eq-option:hover,
.sq-option:hover {
    background: #f5f5f5;
    border-color: var(--primary, #0f3460);
}

.eq-option.correct,
.sq-option.correct {
    background: #d4edda;
    border-color: #0a9b5c;
}

.eq-option.wrong,
.sq-option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

.eq-feedback,
.sq-feedback {
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 1.5rem;
}

.eq-feedback.correct,
.sq-feedback.correct { color: #0a9b5c; }
.eq-feedback.wrong,
.sq-feedback.wrong { color: #dc3545; }
