/* Global app shell styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, sans-serif;
    background-color: var(--verde-fundo, #E8F0E4);
    color: var(--texto, #333333);
    overflow: hidden;
}

#app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen {
    width: 100%;
    min-height: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* ─── COMMON UI ─── */
.btn-primary, .btn-secondary, .btn-full {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--verde-principal, #4CAF50);
    color: white;
    box-shadow: 0 4px 0 var(--verde-escuro, #388E3C);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--verde-escuro);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    box-shadow: 0 4px 0 #ccc;
}

.btn-secondary:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #ccc;
}

.btn-full {
    width: 100%;
    display: block;
    margin-top: 20px;
}

.btn-large {
    width: 250px;
    padding: 16px 24px;
    font-size: 18px;
    margin-bottom: 16px;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-bar h1 {
    margin: 0;
    font-size: 18px;
    color: var(--verde-principal);
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--verde-principal);
}

/* ─── TELA 0: SPLASH SCREEN ─── */
.splash-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--verde-fundo);
}

.splash-logo {
    animation: pulse 2s infinite ease-in-out;
}

.splash-loading {
    margin-top: 40px;
    text-align: center;
}

.loading-bar {
    width: 200px;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.loading-progress {
    height: 100%;
    background: var(--verde-principal);
    width: 0%;
    animation: loadProgress 2s forwards ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes loadProgress {
    to { width: 100%; }
}

/* ─── TELA 1: MAIN MENU ─── */
.main-menu-screen {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('../assets/textures/watercolor-bg.jpg') center/cover;
    opacity: 0.2;
    z-index: -1;
}

.menu-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    backdrop-filter: blur(10px);
}

.menu-logo {
    margin-bottom: 40px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-footer {
    margin-top: 30px;
    font-size: 12px;
    color: #888;
}

/* ─── TELA 2: CONFIG PARTIDA ─── */
.config-game-screen {
    min-height: 100vh;
    background-color: var(--verde-fundo);
}

.config-content {
    padding: 24px;
}

.config-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.config-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.toggle-group, .difficulty-select {
    display: flex;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn, .diff-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
}

.toggle-btn.active, .diff-btn.active {
    background: white;
    color: var(--verde-principal);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.config-footer {
    padding: 24px;
}

/* ─── TELA 6: CONFIGURAÇÕES ─── */
.settings-screen {
    min-height: 100vh;
    background-color: var(--cor-pergaminho, #Fdfbf7);
}

.settings-content {
    padding: 24px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.setting-row label {
    font-weight: 600;
}

.slider {
    width: 150px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: var(--verde-principal);
}

input:checked + .slider-toggle:before {
    transform: translateX(22px);
}

.dropdown-select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
}

.settings-footer {
    padding: 24px;
    display: flex;
    gap: 12px;
}

.settings-footer button {
    flex: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9999;
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ─── TELA 3: TUTORIAL ─── */
.tutorial-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.btn-text {
    background: none; border: none; font-weight: bold; color: #666; cursor: pointer;
}
.tutorial-game-bg {
    flex: 1;
    background: var(--verde-fundo);
    position: relative;
}
.tutorial-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
}
.mascot-dialogue {
    position: absolute; bottom: 40px; left: 5%; width: 90%;
    background: white; border-radius: 16px; padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex; gap: 16px; align-items: flex-start;
}
.mascot-avatar {
    width: 60px; height: 60px; font-size: 40px;
    background: var(--verde-fundo); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.mascot-text h3 { margin: 0 0 8px 0; color: var(--verde-principal); }
.mascot-text p { margin: 0 0 16px 0; line-height: 1.4; }
.dialogue-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ─── TELA 4: COMO JOGAR ─── */
.rules-screen, .credits-screen {
    min-height: 100vh;
    background: var(--cor-pergaminho);
}
.rules-content, .credits-content { padding: 24px; }
.rules-tabs {
    display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto;
}
.tab-btn {
    padding: 8px 16px; border: none; border-radius: 20px;
    background: #e0e0e0; font-weight: bold; cursor: pointer; white-space: nowrap;
}
.tab-btn.active {
    background: var(--verde-principal); color: white;
}
.rules-body h2 { color: var(--verde-escuro); margin-top: 0; }
.rules-body h3 { color: var(--laranja-alerta); margin-top: 24px; }

/* ─── TELA 5: CRÉDITOS ─── */
.credits-content { text-align: center; }
.credits-logo { margin: 20px 0 40px 0; }
.credit-block { margin-bottom: 24px; }
.credit-block strong { color: var(--verde-principal); display: block; margin-bottom: 8px; }
.credit-block p { margin: 0; color: #555; }
