@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Poppins:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: #1a1a2e;
    color: #fff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 750px;
    background: #0f0f1b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Backgrounds para cada fase */
.bg-menu {
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
}

.bg-desert {
    background: linear-gradient(180deg, #ffb75e 0%, #ed8f03 100%);
}

.bg-ice {
    background: linear-gradient(180deg, #70e1f5 0%, #ffd194 100%);
}

.bg-romantic {
    background: linear-gradient(180deg, #ff758c 0%, #ff7eb3 100%);
}

.bg-celebration {
    background: linear-gradient(135deg, #1f1c2c 0%, #928dab 100%);
}

/* Telas (Screens) */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
}

/* Tela de Início */
.logo-container {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.game-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.4;
}

.instructions-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.instructions-card h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 20px;
    margin-bottom: 10px;
    color: #fff;
}

.instructions-card p {
    font-size: 14px;
    line-height: 1.6;
}

.btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 600;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    background: #ffffff;
    color: #ff7e5f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255,255,255,0.7);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
}

.btn-ice {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #fff;
}

.btn-romantic {
    background: linear-gradient(135deg, #ff0844, #ffb199);
    color: #fff;
}

/* Game Interface */
#game-screen {
    padding: 0;
    justify-content: flex-start;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.level-indicator {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-name {
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.score-container {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-icon {
    font-size: 20px;
}

.progress-bar-container {
    width: 100px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    padding: 2px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2fe, #4facfe);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

/* Modal de Transição de Fase */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 35px 25px;
    border-radius: 25px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.modal-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.story-text {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.03);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #ff416c;
}

/* Tela Final */
#final-screen {
    justify-content: flex-start;
    padding-top: 50px;
    overflow-y: auto;
}

.final-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 40px 30px;
    border-radius: 30px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.6s ease-out;
}

.final-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 32px;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.final-story-summary {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 35px;
    color: rgba(255, 255, 255, 0.95);
}

.big-question {
    background: rgba(0, 0, 0, 0.3);
    padding: 25px 20px;
    border-radius: 20px;
    border: 2px solid #ff7eb3;
    margin-bottom: 40px;
}

.big-question h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    color: #ff7eb3;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

.options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.btn-huge {
    font-size: 20px;
    width: 100%;
    padding: 20px;
    border-radius: 60px;
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    color: #fff;
    animation: heartbeat 2s infinite;
}

/* Opção bem escondida */
.hidden-option {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25); /* Bem discreto */
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.hidden-option:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

/* Tela de Celebração (Sim) */
#celebrated-screen {
    justify-content: center;
    background: radial-gradient(circle, #ff7eb3 0%, #ff758c 100%);
}

.celebration-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.felicitations-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 38px;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.felicitations-message {
    font-size: 18px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 30px;
}

/* Tela de Desistência (Não / Parar) */
#giveup-screen {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.giveup-icon {
    font-size: 70px;
    margin-bottom: 20px;
}

/* Efeitos e Animações */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.06); }
    30% { transform: scale(1); }
    45% { transform: scale(1.06); }
    60%, 100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

/* Utilitários para som e controles */
.sound-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 30;
    transition: all 0.2s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Responsividade adicional */
@media (max-width: 400px) {
    .game-title { font-size: 44px; }
    .btn { padding: 12px 30px; font-size: 18px; }
    .final-title { font-size: 26px; }
    .felicitations-title { font-size: 30px; }
}
