/* ========================================================
   MAZE ZIP - GAME CSS v3.0
   5 Temas Modernos, Efeitos Visuais, Confetes e UI Responsiva
   ======================================================== */

:root {
    --bg-page: #f8fafc;
    --board-bg: #ffffff;
    --board-border: #e2e8f0;
    --grid-line: #e2e8f0;
    --wall-color: #0f172a;
    --path-color: #0284c7;
    --path-gradient: #2563eb;
    --node-bg: #0f172a;
    --node-text: #ffffff;
    --active-ring: #0284c7;
    --hint-color: rgba(2, 132, 199, 0.35);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --btn-bg: #f1f5f9;
    --btn-border: #cbd5e1;
    --btn-text: #0f172a;
    --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* TEMA 2: CYBER NEON */
body.theme-cyber {
    --bg-page: #090d16;
    --board-bg: #0f172a;
    --board-border: #06b6d4;
    --grid-line: #1e293b;
    --wall-color: #38bdf8;
    --path-color: #ec4899;
    --path-gradient: #06b6d4;
    --node-bg: #1e293b;
    --node-text: #38bdf8;
    --active-ring: #ec4899;
    --hint-color: rgba(56, 189, 248, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --btn-bg: #1e293b;
    --btn-border: #334155;
    --btn-text: #f8fafc;
    --shadow-main: 0 0 35px rgba(6, 182, 212, 0.25);
}

/* TEMA 3: SUNSET CORAL */
body.theme-sunset {
    --bg-page: #fdf4ff;
    --board-bg: #fae8ff;
    --board-border: #f0abfc;
    --grid-line: #e9d5ff;
    --wall-color: #0f172a;
    --path-color: #db2777;
    --path-gradient: #f43f5e;
    --node-bg: #0f172a;
    --node-text: #ffffff;
    --active-ring: #db2777;
    --hint-color: rgba(219, 39, 119, 0.35);
    --text-primary: #3b0764;
    --text-secondary: #86198f;
    --btn-bg: #f5d0fe;
    --btn-border: #e879f9;
    --btn-text: #3b0764;
    --shadow-main: 0 10px 30px rgba(219, 39, 119, 0.15);
}

/* TEMA 4: ESMERALDA LAB */
body.theme-emerald {
    --bg-page: #022c22;
    --board-bg: #064e3b;
    --board-border: #0d9488;
    --grid-line: #0f3a38;
    --wall-color: #5eead4;
    --path-color: #10b981;
    --path-gradient: #34d399;
    --node-bg: #042f2e;
    --node-text: #6ee7b7;
    --active-ring: #10b981;
    --hint-color: rgba(16, 185, 129, 0.4);
    --text-primary: #f0fdfa;
    --text-secondary: #99f6e4;
    --btn-bg: #0f3a38;
    --btn-border: #0d9488;
    --btn-text: #f0fdfa;
    --shadow-main: 0 10px 35px rgba(13, 148, 136, 0.3);
}

/* TEMA 5: GALÁXIA ÍNDIGO */
body.theme-midnight {
    --bg-page: #030712;
    --board-bg: #0f172a;
    --board-border: #4f46e5;
    --grid-line: #1e1b4b;
    --wall-color: #a855f7;
    --path-color: #6366f1;
    --path-gradient: #a855f7;
    --node-bg: #1e1b4b;
    --node-text: #facc15;
    --active-ring: #a855f7;
    --hint-color: rgba(99, 102, 241, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --btn-bg: #1e293b;
    --btn-border: #4338ca;
    --btn-text: #f8fafc;
    --shadow-main: 0 0 35px rgba(99, 102, 241, 0.3);
}

/* Layout Geral */
body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
}

#maze-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 20px 40px;
    box-sizing: border-box;
    min-height: calc(100vh - 80px);
}

/* Telas (Levels vs Game) */
.armp-screen {
    display: none;
    animation: fadeIn 0.3s ease;
}
.armp-screen--active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header de Níveis */
.armp-header {
    text-align: center;
    margin-bottom: 24px;
    width: 100%;
}
.armp-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.armp-logo-icon {
    font-size: 38px;
}
.armp-title {
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.armp-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 6px 0 16px;
}

/* Abas de Dificuldade no Seletor */
.level-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
    width: 100%;
}
.level-tab {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.level-tab:hover {
    transform: translateY(-2px);
    border-color: var(--path-color);
}
.level-tab.active {
    background: var(--path-color);
    color: #ffffff;
    border-color: var(--path-color);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Grid de Níveis */
.armp-level-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box;
}

.level-card {
    background: var(--board-bg);
    border: 1.5px solid var(--board-border);
    border-radius: 14px;
    height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    position: relative;
    user-select: none;
}
.level-card:hover:not(.locked) {
    transform: translateY(-3px);
    border-color: var(--path-color);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.level-card.locked {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--btn-bg);
}
.level-card.completed {
    border-color: #10b981;
}
.level-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}
.level-stars {
    font-size: 11px;
    color: #fbbf24;
    margin-top: 2px;
}
.level-dim {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Tela de Jogo */
#armp-screen-game {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 14px;
    padding: 0 4px;
}

.level-info-box {
    text-align: center;
}
.level-title-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}
.level-meta-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.icon-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}
.icon-btn:hover {
    background: var(--board-border);
    transform: translateY(-2px);
}

/* Tabuleiro Canvas */
.armp-board-container {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 16px;
}

#armp-canvas {
    background: var(--board-bg);
    border: 2px solid var(--board-border);
    border-radius: 20px;
    box-shadow: var(--shadow-main);
    touch-action: none;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Barra de Controles Inferior */
.armp-controls {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1.5px solid var(--btn-border);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 120px;
    justify-content: center;
}
.control-btn:hover {
    transform: translateY(-2px);
    border-color: var(--path-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.control-btn:active {
    transform: translateY(0);
}
.control-btn.btn-hint {
    border-color: #38bdf8;
    color: var(--text-primary);
}

/* Barra de Dicas / Instrução Rápida */
.hint-banner {
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 600;
}

/* Menu de Temas Rápido */
.theme-picker-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}
.theme-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.theme-dot:hover, .theme-dot.active {
    transform: scale(1.15);
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Modal Genérico */
.armp-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.armp-modal.show {
    display: flex;
    animation: modalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.armp-modal-content {
    background: var(--board-bg);
    border: 1px solid var(--board-border);
    color: var(--text-primary);
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}
.armp-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.win-trophy {
    font-size: 64px;
    margin-bottom: 12px;
    animation: bounce 0.8s infinite alternate;
}
@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.win-title {
    font-size: 26px;
    font-weight: 900;
    margin: 0 0 8px;
    color: var(--text-primary);
}
.win-msg {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
}
.win-stars {
    font-size: 36px;
    color: #fbbf24;
    margin-bottom: 20px;
}

.modal-action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.modal-btn-next {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}
.modal-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}
.modal-btn-levels {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
}

/* Confetes Canvas */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10001;
}

/* How to play card */
.howto-card {
    text-align: left;
    margin: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.howto-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.howto-badge {
    background: var(--path-color);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

@media(max-width: 600px) {
    #maze-wrapper { padding: 12px; }
    .control-btn { padding: 10px 16px; font-size: 14px; }
    .armp-level-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)) !important; }
}
