/* ==========================================================================
   Distinct Bespoke Styles for Memory & Aim/Coordination Tools (4 Tools)
   ========================================================================== */

/* --------------------------------------------------------------------------
   7. MEMORY TEST — Spatial Neon-Tile Matrix
   -------------------------------------------------------------------------- */
.mem-lab {
    max-width: 760px;
    margin: 0 auto;
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 55%, #1e1b4b 100%);
    color: #eef2ff;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 22px 48px rgba(49, 46, 129, 0.34);
    border: 1px solid rgba(165, 180, 252, 0.22);
}

.mem-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.mem-top h1 {
    margin: 0;
    font-size: 1.65rem;
    color: #fff;
}

.mem-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    margin-bottom: 20px;
    font-family: var(--font-mono);
}

.mem-hearts {
    display: inline-flex;
    gap: 6px;
    color: #fb7185;
}

.mem-hearts svg.is-lost {
    opacity: 0.22;
}

.mem-board-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.mem-grid {
    display: grid;
    gap: 10px;
    width: min(400px, 100%);
    aspect-ratio: 1 / 1;
}

.mem-tile {
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.12s ease, background-color 0.14s ease, box-shadow 0.14s ease;
    touch-action: manipulation;
}

.mem-tile:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.mem-tile.is-lit {
    background: #38bdf8;
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.85);
    transform: scale(0.96);
}

.mem-tile.is-correct {
    background: #34d399;
    box-shadow: 0 0 18px rgba(52, 211, 153, 0.7);
}

.mem-tile.is-wrong {
    background: #f43f5e;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.75);
}

/* --------------------------------------------------------------------------
   8. NUMBER MEMORY TEST — Vault / Cipher Terminal
   -------------------------------------------------------------------------- */
.nm-vault {
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 2px solid #059669;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(5, 150, 105, 0.14);
}

.nm-vault-header {
    background: #064e3b;
    color: #ecfdf5;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nm-vault-header h1 {
    margin: 0;
    font-size: 1.45rem;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.nm-vault-body {
    padding: 32px 26px;
    text-align: center;
}

.nm-digit-screen {
    min-height: 112px;
    border-radius: 16px;
    background: #022c22;
    color: #34d399;
    border: 1px solid #065f46;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.nm-digits {
    font-family: var(--font-mono);
    font-size: clamp(1.9rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: 0.14em;
    word-break: break-all;
}

.nm-drain-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
}

.nm-drain-fill {
    height: 100%;
    width: 100%;
    background: #10b981;
    transform-origin: left;
}

.nm-input-row {
    display: flex;
    gap: 10px;
    max-width: 460px;
    margin: 0 auto 16px;
}

.nm-input {
    flex: 1;
    padding: 13px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-strong);
    background: var(--bg-page);
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.12em;
}

.nm-input:focus {
    outline: none;
    border-color: #10b981;
}

.nm-diff-box {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: 18px;
}

.nm-char-ok { color: #10b981; font-weight: 800; }
.nm-char-bad { color: #ef4444; text-decoration: underline; font-weight: 800; }

/* --------------------------------------------------------------------------
   9. AIM TRAINER — Esports Tactical Shooting Range
   -------------------------------------------------------------------------- */
.aim-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aim-hud-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.aim-hud-cell {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left: 3px solid #e11d48;
    border-radius: 12px;
    padding: 12px 14px;
}

.aim-hud-cell span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}

.aim-hud-cell strong {
    font-family: var(--font-mono);
    font-size: 1.35rem;
}

.aim-arena {
    position: relative;
    width: 100%;
    height: 460px;
    border-radius: 20px;
    background-color: #0b1120;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 36px 36px;
    border: 2px solid #334155;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.aim-arena.crosshair-plus { cursor: crosshair; }
.aim-arena.crosshair-dot { cursor: cell; }
.aim-arena.crosshair-circle { cursor: pointer; }

.aim-target {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #fff 0 18%, #e11d48 19% 48%, #fff 49% 68%, #e11d48 69% 100%);
    box-shadow: 0 0 20px rgba(225, 29, 72, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.85);
    cursor: inherit;
    transition: transform 0.06s ease;
}

.aim-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.82);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 12px;
}

.aim-hit-pop {
    position: absolute;
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 800;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: aimFloat 0.45s ease-out forwards;
}

@keyframes aimFloat {
    to {
        transform: translate(-50%, -140%);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   10. DRAW A PERFECT CIRCLE — Geometric Blueprint Compass Studio
   -------------------------------------------------------------------------- */
.cir-studio {
    display: grid;
    grid-template-columns: 1.5fr 0.85fr;
    gap: 18px;
    align-items: start;
}

.cir-board-card {
    background: #0c2340;
    border: 2px solid #1d4ed8;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 18px 44px rgba(12, 35, 64, 0.28);
    position: relative;
}

.cir-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background-color: #0b223d;
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.14) 1px, transparent 1px);
    background-size: 28px 28px;
    touch-action: none;
}

#cir-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.cir-live-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(11, 34, 61, 0.82);
    border: 1px solid rgba(147, 197, 253, 0.4);
    color: #eff6ff;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    pointer-events: none;
}

.cir-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cir-sidebar h1 {
    margin: 0;
    font-size: 1.45rem;
}

.cir-big-score {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 900;
    color: #2563eb;
    line-height: 1;
}

[data-theme="dark"] .cir-big-score {
    color: #60a5fa;
}

.cir-metric-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cir-metric-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.84rem;
}

.cir-metric-bar {
    height: 7px;
    border-radius: 999px;
    background: var(--bg-surface-2);
    overflow: hidden;
}

.cir-metric-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    transition: width 0.25s ease;
}

@media (max-width: 900px) {
    .aim-hud-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .cir-studio {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .mem-lab, .nm-vault-body {
        padding: 18px 16px;
    }
    .aim-arena {
        height: 360px;
    }
    .aim-hud-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nm-input-row {
        flex-direction: column;
    }
}
