:root {
    --bg-top: #ffd15c;
    --bg-bottom: #ff9c70;
    --primary: #008dd2;
    --primary-dark: #00679a;
    --text-main: #222;
    --card-bg: #ffffff;
    --baba-green: #48c774;
    --shadow-soft: 0 6px 16px rgba(0, 0, 0, 0.15);
    --radius-big: 18px;
    --transition-fast: 0.2s ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background: linear-gradient(to bottom, var(--bg-top), var(--bg-bottom));
    min-height: 100vh;
}

#game-root {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    display: none;
    width: 100%;
}

.screen-active {
    display: block;
}

/* PANTALLA INICIO */

.logo-area {
    text-align: center;
    margin-bottom: 24px;
}

.logo-main {
    max-width: 260px;
    width: 60%;
}

.start-content {
    text-align: center;
    background: var(--card-bg);
    padding: 24px 16px;
    border-radius: var(--radius-big);
    box-shadow: var(--shadow-soft);
}

.game-title {
    margin: 0 0 8px;
    font-size: 2.1rem;
}

.game-subtitle {
    margin: 0 0 20px;
}

.credits {
    margin-top: 16px;
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.8;
}

/* BOTONES */

.btn {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 1rem;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}

.btn.big {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.btn.primary {
    margin-top: 16px;
}

/* INTRO / DIÁLOGOS */

.scene {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.character-area {
    flex: 0 0 220px;
    text-align: center;
}

.character-area img {
    max-width: 100%;
}

.dialog-area {
    flex: 1 1 260px;
}

.dialog-bubble {
    background: #fdfdfd;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.dialog-bubble::after {
    content: "";
    position: absolute;
    left: 28px;
    bottom: -16px;
    border-width: 16px 16px 0;
    border-style: solid;
    border-color: #fdfdfd transparent transparent;
}

.dialog-meta {
    margin-top: 6px;
    font-weight: 600;
}

/* PANTALLA REGLAS */

.rules-card,
.feedback-card,
.end-card {
    background: var(--card-bg);
    padding: 24px 20px;
    border-radius: var(--radius-big);
    box-shadow: var(--shadow-soft);
    max-width: 720px;
    margin: 0 auto;
}

.rules-card ol {
    padding-left: 20px;
}

/* PANTALLA JUEGO */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.logo-mini {
    height: 32px;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 18px;
    align-items: stretch;
}

.news-panel {
    background: var(--card-bg);
    border-radius: var(--radius-big);
    padding: 18px 16px;
    box-shadow: var(--shadow-soft);
}

.news-body {
    margin-top: 8px;
    margin-bottom: 12px;
}

.news-source {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 18px;
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice {
    flex: 1 1 30%;
}

.baba-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.baba-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
}

.baba-wrapper img {
    max-width: 80%;
}

/* Texto je je je */

.laugh-text {
    position: absolute;
    bottom: 18px;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0;
    animation: laugh 0.6s ease-out infinite;
}

.hidden {
    display: none;
}

@keyframes laugh {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

/* Animaciones baba */

.baba-hit {
    animation: babaHit 0.5s ease-out;
}

@keyframes babaHit {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.baba-laugh {
    animation: babaLaugh 0.6s ease-in-out;
}

@keyframes babaLaugh {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-4px);
    }

    100% {
        transform: translateX(0);
    }
}

/* PANTALLA FEEDBACK */

.reflection-block {
    margin-top: 18px;
}

.reflection-options {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reflection-options .btn {
    font-size: 0.9rem;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    #game-root {
        padding: 12px;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .baba-wrapper {
        width: 220px;
        height: 220px;
    }

    .game-title {
        font-size: 1.6rem;
    }
}