/* Tank Battle: force crosshair cursor on entire page during gameplay */
body.tank-battle-active,
body.tank-battle-active * {
    cursor: crosshair !important;
}

/* Score Toast */
.score-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.score-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Game Container */
.game-container {
    position: relative;
    padding-top: 40px;
    padding-bottom: 20px;
    box-sizing: border-box;
    background-color: var(--dark-bg);
    z-index: 10;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    text-align: center;
    width: 100%;
}

/* Crossfade transition for game screens */
@keyframes gameFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.game-fade-in {
    animation: gameFadeIn 0.35s ease;
}

/* Game Specific Styles */
.game-area {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--border-color);
}

.game-area h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-instruction {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.game-instruction:last-of-type {
    margin-bottom: 1.5rem;
}

.result-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.score-display {
    background-color: rgba(43, 135, 218, 0.1);
    border: 1px solid rgba(43, 135, 218, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem auto;
    max-width: 400px;
    text-align: center;
}

.score-display h3 {
    color: var(--primary-color);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.score-display p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.4rem 0;
    line-height: 1.6;
}

.multiplayer-waiting {
    color: var(--primary-color) !important;
    font-weight: 600;
    margin-top: 1rem !important;
    font-size: 1rem !important;
    animation: pulse-waiting 1.5s ease-in-out infinite;
}

@keyframes pulse-waiting {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Reaction Time Game */
.reaction-area {
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
}

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

.reaction-area.ready {
    background-color: #28a745;
}

.reaction-area.too-soon {
    background-color: #ffc107;
}

/* Typing Test */
.typing-text {
    font-size: 1.5rem;
    line-height: 2;
    margin-bottom: 2rem;
    text-align: left;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    word-break: keep-all;
    overflow-wrap: break-word;
    hyphens: none;
    align-self: stretch;
}

.typing-text .correct {
    color: var(--success-color);
}

.typing-text .incorrect {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.2);
}

.typing-text .current {
    border-bottom: 2px solid var(--primary-color);
}

.typing-input {
    width: 100%;
    align-self: stretch;
    padding: 1rem;
    font-size: 1.2rem;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Memory Games */
.number-display {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 3rem 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5rem;
    word-break: break-all;
    max-width: 100%;
    overflow-wrap: break-word;
}

.number-input {
    font-size: 2rem;
    padding: 1rem;
    text-align: center;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    font-family: 'Courier New', monospace;
}

.number-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Sequence Memory Grid */
.sequence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 420px;
    width: 100%;
    margin: 2rem auto;
    padding: 1rem;
}

.sequence-cell {
    aspect-ratio: 1;
    background-color: var(--card-bg);
    min-height: 110px;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sequence-cell:hover {
    border-color: var(--primary-color);
}

.sequence-cell.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.sequence-cell.lit {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.level-display {
    font-size: 2rem;
    margin: 1rem 0;
    color: var(--primary-color);
}

/* Aim Trainer Game */
.aim-area {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: var(--dark-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
}

.aim-target {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #dc3545 0%, #c82333 50%, #bd2130 100%);
    border-radius: 50%;
    cursor: crosshair;
    transition: transform 0.1s ease;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
    animation: aimTargetZoomIn 0.15s ease-out;
}
@keyframes aimTargetZoomIn {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.aim-target::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
}

.aim-target::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
}

.aim-target:hover {
    transform: scale(0.95);
}

.aim-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 8px;
}

.aim-stat {
    text-align: center;
    min-width: 70px;
}

.aim-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.aim-stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Chimp Test Game */
.chimp-grid {
    position: relative;
    width: 600px;
    height: 400px;
    background-color: var(--dark-bg);
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 100%;
}

.chimp-number {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.chimp-number:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.chimp-number.clicked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Visual Memory Game */
.visual-grid {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
    padding: 1rem;
    box-sizing: border-box;
}

.visual-cell {
    aspect-ratio: 1;
    perspective: 600px;
    cursor: pointer;
    border-radius: 8px;
}

.visual-cell-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    border-radius: 8px;
}

.visual-cell.flipped .visual-cell-inner {
    transform: rotateY(180deg);
}

.visual-cell-front,
.visual-cell-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    border: 3px solid var(--border-color);
    box-sizing: border-box;
}

.visual-cell-front {
    background-color: var(--card-bg);
    transition: border-color 0.2s ease;
}

.visual-cell:hover .visual-cell-front {
    border-color: var(--primary-color);
}

.visual-cell-back {
    background-color: white;
    border-color: white;
    transform: rotateY(180deg);
}

.visual-cell.lit .visual-cell-inner {
    transform: rotateY(180deg);
}

.visual-cell.selected {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.visual-cell.correct-cell .visual-cell-front {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.visual-cell.wrong-cell .visual-cell-front {
    background-color: #dc3545;
    border-color: #dc3545;
}

.visual-cell.strike-cell .visual-cell-front {
    background-color: rgba(148, 163, 184, 0.35);
    border-color: rgba(148, 163, 184, 0.5);
}
.visual-cell.strike-cell {
    cursor: default;
}

.visual-cell.missed-cell .visual-cell-front {
    background-color: #ffc107;
    border-color: #ffc107;
}

.visual-lives {
    text-align: center;
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* Verbal Memory Game */
@keyframes verbal-pop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.verbal-word {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 3rem 0;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: verbal-pop 0.2s ease-out;
}

.verbal-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.verbal-buttons .btn {
    min-width: 150px;
    font-size: 1.3rem;
    padding: 1rem 2rem;
}

.verbal-stats {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 8px;
}

.verbal-stat {
    text-align: center;
}

/* Math Test Game */
.math-test-area {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 12px;
    background: rgba(0,0,0,.25);
    border: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: background .15s;
}

.math-test-question {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.math-test-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.math-test-btn {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .1s;
}

.math-test-btn:hover {
    background: rgba(255,255,255,.12);
    border-color: var(--primary-color);
    transform: scale(1.03);
}

.math-test-btn:active {
    transform: scale(0.97);
}

.math-test-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 0 auto 1.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,.04);
    border-radius: 10px;
    max-width: 520px;
}

.math-test-stat {
    text-align: center;
    min-width: 60px;
}

.math-test-stat .aim-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.math-test-stat .aim-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Color Test Game */
.color-test-word {
    font-size: 5rem;
    font-weight: bold;
    margin: 3rem 0;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    animation: verbal-pop 0.2s ease-out;
}

.color-test-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.color-test-buttons .btn {
    font-size: 1.2rem;
    padding: 1.5rem;
    min-height: 70px;
    font-weight: bold;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.color-test-buttons .btn:hover {
    transform: scale(1.05);
    border-color: white;
}

.color-test-stats {
    display: flex;
    justify-content: space-around;
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 8px;
}

.color-test-stat {
    text-align: center;
}

/* Click Speed Game */
.click-speed-display {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 12px;
}

.click-speed-time,
.click-speed-clicks {
    text-align: center;
    min-width: 100px;
}

.click-speed-time .result-display,
.click-speed-clicks .result-display {
    margin: 0.5rem 0 0;
}

.click-speed-click-btn {
    font-size: 2rem;
    padding: 3rem 4rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e6bb8 100%);
    border: 4px solid var(--primary-color);
    margin: 2rem 0;
    transition: all 0.1s ease;
    user-select: none;
}

.click-speed-click-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(43, 135, 218, 0.4);
}

.click-speed-click-btn:active {
    transform: scale(0.98);
}

/* Multitasking Game */
.multitask-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background-color: rgba(43, 135, 218, 0.1);
    border-radius: 8px;
}

.multitask-stat {
    text-align: center;
}

.multitask-color-task {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: background-color 0.2s ease;
}

.multitask-color-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.multitask-color-word {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
    text-transform: uppercase;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multitask-color-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.multitask-color-btn {
    padding: 0.8rem;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.1s ease;
}

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

.multitask-word-display {
    margin: 2rem 0;
    text-align: center;
}

.multitask-target-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.multitask-typed-text {
    font-size: 2rem;
    min-height: 60px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

.multitask-typed-text .correct {
    color: var(--success-color);
}

.multitask-typed-text .incorrect {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.2);
}

.multitask-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    font-size: 1.3rem;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 1rem 0 2rem 0;
    font-family: 'Courier New', monospace;
}

.multitask-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.multitask-target-area {
    position: relative;
    width: 100%;
    max-width: 750px;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 0.5rem auto 0 auto;
    overflow: hidden;
}

.multitask-target {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, var(--primary-color) 0%, #1a6fbf 50%, #145a9e 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
    box-shadow: 0 0 15px rgba(43, 135, 218, 0.6);
    animation: pulse 1s ease-in-out infinite;
}

.multitask-target:hover {
    transform: scale(1.1);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(43, 135, 218, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(43, 135, 218, 0.9);
    }
}

/* Pattern Recognition Game */
.pattern-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
    min-height: 70px;
}

.pattern-item {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.pattern-question {
    color: var(--text-secondary);
    font-weight: bold;
    animation: questionPulse 1.5s ease-in-out infinite;
}

@keyframes questionPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.pattern-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 600px;
    margin: 1rem auto;
}

.pattern-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    min-width: 80px;
    min-height: 80px;
    background: linear-gradient(135deg, rgba(43, 135, 218, 0.2) 0%, rgba(43, 135, 218, 0.1) 100%);
    border: 3px solid var(--border-color);
    transition: all 0.2s ease;
}

.pattern-option-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(43, 135, 218, 0.3);
}

/* Portrait orientation: use same layout as desktop (no overrides) */

/* ===== SEO Game Content (below game area) ===== */
.seo-game-wrapper {
    background: var(--dark-bg);
    padding: 2rem 0 3rem;
    margin-top: 1rem;
}

.seo-game-wrapper .container {
    max-width: 800px;
}

.breadcrumb-nav {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-nav a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: var(--text-primary);
}

.seo-game-content {
    line-height: 1.8;
}

.seo-game-content .seo-section {
    margin-bottom: 2rem;
}

.seo-game-content h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.seo-game-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}
