/**
 * @author      Mike Fairbrother <mike@fairbrother.me>
 * @copyright   2024-2026 Mike Fairbrother. All rights reserved.
 * @license     PROPRIETARY - No rights to copy, modify, distribute, or reuse
 *              any part of this code without explicit written permission from the author.
 */
/* ============================================
   Math Maze - Styles
   Prefix: mz-
   ============================================ */

/* ---- Logo & Title ---- */
.mz-logo {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(255, 217, 61, 0.3));
    animation: mz-float 3s ease-in-out infinite;
}

@keyframes mz-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.mz-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ffd93d, #ff9f43);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mz-subtitle {
    font-size: 14px;
    color: var(--gp-text-secondary);
    margin-bottom: 16px;
}

.menu-best {
    font-size: 14px;
    color: var(--gp-text-secondary);
    margin-bottom: 20px;
}

.menu-best span {
    color: var(--gp-accent);
    font-weight: 700;
}

/* ---- Difficulty Pills ---- */
.mz-difficulty {
    margin-bottom: 24px;
    width: 100%;
    max-width: 320px;
}

.mz-diff-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gp-text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.mz-diff-pills {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.mz-pill {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gp-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--gp-font-stack);
}

.mz-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mz-pill.active {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2), rgba(255, 159, 67, 0.2));
    border-color: var(--gp-accent);
    color: var(--gp-accent);
}

/* ---- Game Area ---- */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    gap: 12px;
}

/* ---- Target Prompt ---- */
.mz-target {
    font-size: 16px;
    color: var(--gp-text-secondary);
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--gp-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 340px;
}

.mz-target strong {
    color: var(--gp-accent);
    font-size: 22px;
    font-weight: 800;
}

/* ---- Grid ---- */
.mz-grid-wrapper {
    display: grid;
    gap: 4px;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
}

.mz-grid-wrapper.mz-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.mz-grid-wrapper.mz-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

/* ---- Grid Cell ---- */
.mz-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gp-radius-sm);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--gp-font-stack);
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.25s ease;
    cursor: default;
    position: relative;
    user-select: none;
    min-height: 0;
    padding: 4px;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
}

.mz-cell.mz-visited {
    background: rgba(46, 213, 115, 0.15);
    border-color: rgba(46, 213, 115, 0.3);
    color: var(--gp-success);
}

.mz-cell.mz-current {
    background: rgba(255, 217, 61, 0.2);
    border-color: var(--gp-accent);
    color: var(--gp-accent);
    box-shadow: 0 0 16px rgba(255, 217, 61, 0.3);
    animation: mz-pulse 1.5s ease-in-out infinite;
}

@keyframes mz-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 217, 61, 0.3); }
    50% { box-shadow: 0 0 24px rgba(255, 217, 61, 0.5); }
}

.mz-cell.mz-available {
    background: rgba(100, 100, 255, 0.12);
    border-color: rgba(130, 130, 255, 0.4);
    color: #fff;
    cursor: pointer;
    animation: mz-glow 2s ease-in-out infinite;
}

@keyframes mz-glow {
    0%, 100% { border-color: rgba(130, 130, 255, 0.4); }
    50% { border-color: rgba(170, 170, 255, 0.7); }
}

.mz-cell.mz-available:hover {
    background: rgba(130, 130, 255, 0.22);
    transform: scale(1.05);
}

.mz-cell.mz-available:active {
    transform: scale(0.95);
}

.mz-cell.mz-finish {
    background: rgba(255, 217, 61, 0.08);
    border-color: rgba(255, 217, 61, 0.2);
}

.mz-cell.mz-finish.mz-available {
    background: rgba(255, 217, 61, 0.15);
    border-color: rgba(255, 217, 61, 0.5);
    animation: mz-finish-glow 1.5s ease-in-out infinite;
}

@keyframes mz-finish-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 217, 61, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 217, 61, 0.4); }
}

.mz-cell.mz-correct-flash {
    animation: mz-correct 0.5s ease;
}

@keyframes mz-correct {
    0% { background: rgba(46, 213, 115, 0.4); transform: scale(1.1); }
    100% { background: rgba(46, 213, 115, 0.15); transform: scale(1); }
}

.mz-cell.mz-wrong-flash {
    animation: mz-wrong 0.5s ease;
}

@keyframes mz-wrong {
    0% { background: rgba(255, 71, 87, 0.5); transform: scale(0.9); }
    50% { background: rgba(255, 71, 87, 0.3); }
    100% { background: rgba(255, 255, 255, 0.03); transform: scale(1); }
}

/* Start marker */
.mz-cell.mz-start::after {
    content: 'S';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 9px;
    color: var(--gp-success);
    font-weight: 800;
    opacity: 0.6;
}

/* Finish marker */
.mz-cell.mz-finish::after {
    content: '\2691';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    opacity: 0.5;
}

/* ---- Feedback ---- */
.mz-feedback {
    font-size: 15px;
    font-weight: 700;
    min-height: 24px;
    text-align: center;
    transition: opacity 0.3s ease;
}

.mz-feedback.mz-fb-correct {
    color: var(--gp-success);
}

.mz-feedback.mz-fb-wrong {
    color: var(--gp-danger);
}

/* ---- Game Over Stats ---- */
.mz-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin: 24px auto;
}

.mz-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: var(--gp-bg-surface);
    border-radius: var(--gp-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mz-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--gp-accent);
    line-height: 1.1;
}

.mz-stat-lbl {
    font-size: 11px;
    color: var(--gp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 4px;
}

/* ---- Help Sections ---- */
.help-section {
    margin-bottom: 16px;
}

.help-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gp-accent);
    margin-bottom: 6px;
}

.help-section p {
    font-size: 13px;
    color: var(--gp-text-secondary);
    line-height: 1.5;
}

/* ---- Maze Complete Banner ---- */
.mz-maze-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.95), rgba(255, 159, 67, 0.95));
    color: #1a1640;
    padding: 20px 40px;
    border-radius: var(--gp-radius-lg);
    font-size: 24px;
    font-weight: 800;
    z-index: 30;
    text-align: center;
    animation: mz-banner-pop 0.5s ease forwards;
    box-shadow: 0 8px 40px rgba(255, 217, 61, 0.4);
}

@keyframes mz-banner-pop {
    0% { transform: translate(-50%, -50%) scale(0); }
    60% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.mz-maze-complete span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0.7;
}

/* ---- Responsive ---- */
@media (max-height: 600px) {
    .mz-logo { font-size: 48px; }
    .mz-title { font-size: 24px; }
    .mz-grid-wrapper { max-width: 280px; }
    .mz-target { font-size: 14px; padding: 8px 16px; }
    .mz-target strong { font-size: 18px; }
}

@media (max-width: 340px) {
    .mz-cell { font-size: 13px; }
    .mz-grid-wrapper { gap: 3px; }
}
