/* ===== IMPORTAÇÃO DE FONTES CARTOON ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Lilita+One&display=swap');

/* ===== VARIÁVEIS DE CORES VIBRANTES ===== */
:root {
    --cartoon-blue: #00D4FF;
    --cartoon-green: #00FF88;
    --cartoon-yellow: #FFD700;
    --cartoon-orange: #FF8C00;
    --cartoon-red: #FF4757;
    --cartoon-purple: #A855F7;
    --cartoon-pink: #FF6B9D;
    --shadow-cartoon: 0 8px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px currentColor;
}

/* ===== GUARDIÃO DA ÁGUA - INTERFACE CARTOON ===== */

/* ===== HUD PRINCIPAL ===== */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    font-family: 'Fredoka', sans-serif;
}

.hud > * {
    pointer-events: auto;
}

/* ===== PAINEL SUPERIOR - RECURSOS ===== */
.hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(180deg, #2D3561 0%, #1A1F3A 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 6px solid var(--cartoon-blue);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.resource-panel {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    padding: 0.1em 0.1em;
    border-radius: 50px;
    border: 4px solid #FF8C00;
    box-shadow: var(--shadow-cartoon), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    min-width: 70px;
    position: relative;
}

.resource-item::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 8px;
    right: 8px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(4px);
}

.resource-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.3), 0 0 30px var(--cartoon-yellow);
    filter: brightness(1.2);
}

.resource-item:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.resource-icon {
    font-size: 0.9rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
    animation: bounce 2s ease-in-out infinite;
}

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

.resource-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2D3561;
    font-family: 'Lilita One', cursive;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.control-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.control-btn {
    width: 56px;
    height: 56px;
    border: 4px solid #00D4FF;
    border-radius: 50%;
    background: linear-gradient(145deg, #00FF88, #00D4AA);
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    box-shadow: var(--shadow-cartoon), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 8px;
    right: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(4px);
}

.control-btn:hover {
    transform: translateY(-6px) rotate(5deg) scale(1.1);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.3), 0 0 25px var(--cartoon-green);
}

.control-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.control-btn.active {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border-color: #FF1744;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: var(--shadow-cartoon), 0 0 15px #FF6B9D;
    }
    50% {
        box-shadow: var(--shadow-cartoon), 0 0 30px #FF6B9D;
    }
}

/* ===== PAINEL LATERAL ESQUERDO - CONSTRUÇÃO ===== */
.hud-left {
    position: absolute;
    left: 0;
    top: 90px;
    bottom: 140px;
    width: 340px;
    background: linear-gradient(90deg, #2D3561 0%, #1A1F3A 100%);
    border-right: 6px solid var(--cartoon-purple);
    box-shadow: 6px 0 0 rgba(0, 0, 0, 0.3), inset -2px 0 0 rgba(255, 255, 255, 0.1);
}

.building-panel {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: visible;
}

.building-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
    color: var(--cartoon-yellow);
    font-family: 'Lilita One', cursive;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--cartoon-yellow);
    letter-spacing: 2px;
    animation: title-float 3s ease-in-out infinite;
}

@keyframes title-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.building-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem;
    border: 4px solid transparent;
    border-radius: 20px;
    background: linear-gradient(145deg, #A855F7, #7C3AED);
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 6px 0 #5B21B6, inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 12px;
    right: 12px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    filter: blur(4px);
}

.category-btn:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 10px 0 #5B21B6, 0 0 25px var(--cartoon-purple);
}

.category-btn.active {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border-color: #FF1744;
    box-shadow: 0 6px 0 #C41C3B, 0 0 20px var(--cartoon-pink);
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.building-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #0b0b0b5c;
    padding: 10px;
}

.building-items::-webkit-scrollbar {
    width: 12px;
}

.building-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.building-items::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cartoon-blue), var(--cartoon-purple));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.building-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0px 10px;
    background: linear-gradient(145deg, #303F9F, #3F51B5);
    border: 2px solid #0096C7;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: white;
    box-shadow: 0 6px 0 #006D8F, inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.building-item::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 16px;
    right: 16px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    filter: blur(6px);
}

.building-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 0 #006D8F, 0px 0 5px var(--cartoon-blue);
    filter: brightness(1.15);
}

.building-item.selected {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border-color: #FF8C00;
    box-shadow: 0 6px 0 #CC7000, 0 0 30px var(--cartoon-yellow);
    animation: selected-pulse 1s ease-in-out infinite;
}

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

.building-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.3));
}

.building-info {
    flex: 1;
}

.building-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.building-cost {
    font-size: 0.95rem;
    color: #FFD700;
    font-weight: 600;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.building-description {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.3rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* ===== PAINEL INFERIOR - INFORMAÇÕES ===== */
.hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(0deg, #2D3561 0%, #1A1F3A 100%);
    border-top: 6px solid var(--cartoon-green);
    box-shadow: 0 -6px 0 rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(255, 255, 255, 0.1);
}

.info-panel {
    display: flex;
    height: 100%;
    padding: 1.25rem 2rem;
    gap: 2rem;
}

.mission-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mission-info h4 {
    color: var(--cartoon-yellow);
    margin: 0;
    font-size: 1.4rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3), 0 0 15px var(--cartoon-yellow);
}

.mission-urgency {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 3px solid;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.mission-urgency.low {
    background: linear-gradient(145deg, #00D4FF, #00A8CC);
    border-color: #0096C7;
    color: white;
}

.mission-urgency.medium {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border-color: #FF8C00;
    color: #2D3561;
}

.mission-urgency.high {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border-color: #FF1744;
    color: white;
    animation: pulse-urgency-cartoon 1.5s infinite;
}

.mission-urgency.critical {
    background: linear-gradient(145deg, #FF4757, #E60000);
    border-color: #B30000;
    color: white;
    animation: pulse-urgency-cartoon 0.8s infinite, shake 0.5s infinite;
}

@keyframes pulse-urgency-cartoon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), 0 0 20px currentColor;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-3px) rotate(-2deg); }
    75% { transform: translateX(3px) rotate(2deg); }
}

.mission-objective-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
    border: 4px solid var(--cartoon-green);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 6px 0 rgba(0, 200, 100, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.mission-objective-display:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 0 rgba(0, 200, 100, 0.5), 0 0 30px var(--cartoon-green);
}

.objective-icon {
    font-size: 2rem;
    min-width: 2rem;
    text-align: center;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
}

.objective-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.objective-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.objective-action {
    font-size: 0.9rem;
    color: var(--cartoon-yellow);
    font-weight: 500;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.objective-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mission-info p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.mission-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cartoon-green), var(--cartoon-blue));
    border-radius: 20px;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px var(--cartoon-green);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    to { left: 100%; }
}

.progress-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cartoon-green);
    font-family: 'Lilita One', cursive;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* ===== PAINEL DIREITO - DETALHES ===== */
.hud-right {
    position: absolute;
    right: 0;
    top: 90px;
    bottom: 140px;
    width: 340px;
    background: linear-gradient(270deg, #2D3561 0%, #1A1F3A 100%);
    border-left: 6px solid var(--cartoon-orange);
    box-shadow: -6px 0 0 rgba(0, 0, 0, 0.3), inset 2px 0 0 rgba(255, 255, 255, 0.1);
    display: none;
}

.details-panel {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ✕ do painel da direita (desktop; no mobile a gaveta tem o próprio botão no cabeçalho) */
.details-panel {
    position: relative;
}

.hud-right-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 3px solid #FF1744;
    border-radius: 50%;
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.hud-right-close:hover,
.hud-right-close:focus-visible {
    transform: scale(1.1);
    outline: none;
}

.hud-right-close span {
    color: #FFFFFF;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

@media screen and (max-width: 768px) {
    .hud-right-close { display: none; }
}

.details-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
    color: var(--cartoon-orange);
    font-family: 'Lilita One', cursive;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--cartoon-orange);
    letter-spacing: 2px;
}

.details-content {
    flex: 1;
    overflow-y: auto;
}

.detail-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border-radius: 16px;
    border: 3px solid var(--cartoon-blue);
    box-shadow: 0 5px 0 rgba(0, 150, 199, 0.5);
}

.detail-label {
    font-weight: bold;
    color: var(--cartoon-blue);
    margin-bottom: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
}

.detail-value {
    font-size: 0.9rem;
    opacity: 0.9;
    color: white;
}

/* ===== INFORMAÇÕES DO TERRENO ===== */
.terrain-info {
    padding: 0;
    color: white;
}

.terrain-info h4 {
    margin: 0 0 1rem 0;
    color: var(--cartoon-green);
    font-size: 1.3rem;
    border-bottom: 3px solid var(--cartoon-green);
    padding-bottom: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.terrain-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.terrain-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.terrain-icon {
    font-size: 1.8rem;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.3));
}

.terrain-name {
    color: var(--cartoon-green);
    font-family: 'Fredoka', sans-serif;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.terrain-position,
.terrain-elevation {
    font-size: 0.9rem;
    color: #ffffff;
}

.terrain-buildable {
    font-size: 0.9rem;
}

.buildable-yes {
    color: var(--cartoon-green);
    font-weight: 700;
}

.buildable-no {
    color: var(--cartoon-red);
    font-weight: 700;
}

.terrain-water {
    color: var(--cartoon-blue);
    font-size: 0.9rem;
    font-style: italic;
    font-weight: 600;
}

.terrain-description {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
    padding: 0.8rem;
    border-radius: 12px;
    border-left: 5px solid var(--cartoon-green);
    box-shadow: 0 4px 0 rgba(0, 200, 100, 0.3);
}

.terrain-description p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #ffffff;
}

.terrain-tips {
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.2), rgba(255, 165, 0, 0.1));
    padding: 0.8rem;
    border-radius: 12px;
    border-left: 5px solid var(--cartoon-orange);
    box-shadow: 0 4px 0 rgba(255, 140, 0, 0.3);
}

.terrain-tips h5 {
    margin: 0 0 0.5rem 0;
    color: var(--cartoon-orange);
    font-size: 1rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.terrain-tips ul {
    margin: 0;
    padding-left: 1.2rem;
}

.terrain-tips li {
    font-size: 0.8rem;
    color: #ffffff;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideInRight {
    from {
        transform: translateX(150%) rotate(10deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-150%) rotate(-10deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(150%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-150%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== ESTADOS ESPECIAIS ===== */
.resource-value.critical {
    color: var(--cartoon-red) !important;
    animation: pulse-critical-cartoon 1s infinite;
    text-shadow: 0 0 10px var(--cartoon-red);
}

@keyframes pulse-critical-cartoon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.resource-value.warning {
    color: var(--cartoon-orange) !important;
    text-shadow: 0 0 8px var(--cartoon-orange);
}

.resource-value.good {
    color: #2D3561 !important;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.building-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.building-item.disabled:hover {
    transform: none;
    box-shadow: 0 6px 0 #006D8F;
}

/* ===== CONTINUA NO PRÓXIMO COMENTÁRIO (parte 2/3) ===== */
/* ===== PARTE 2/3 - CONTINUAÇÃO DO CSS CARTOON ===== */

/* ===== TOOLTIPS CARTOON ===== */
.hover-tooltip {
    position: fixed;
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    color: white;
    padding: 16px;
    border-radius: 16px;
    border: 4px solid var(--cartoon-green);
    font-size: 13px;
    font-family: 'Fredoka', sans-serif;
    z-index: 10000;
    pointer-events: none;
    max-width: 280px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--cartoon-green);
    display: none;
}

.tooltip-header {
    color: var(--cartoon-yellow);
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--cartoon-yellow);
    padding-bottom: 6px;
    font-size: 15px;
    font-family: 'Lilita One', cursive;
}

.tooltip-building {
    margin-top: 10px;
}

.building-name {
    color: var(--cartoon-green);
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    font-family: 'Fredoka', sans-serif;
}

.building-status {
    color: var(--cartoon-green);
    margin-bottom: 3px;
    font-weight: 600;
}

.building-efficiency {
    color: var(--cartoon-yellow);
    margin-bottom: 6px;
    font-weight: 600;
}

.building-stat {
    margin: 3px 0;
    font-size: 12px;
    color: #ffffff;
}

.tooltip-terrain {
    margin-top: 10px;
}

.terrain-type {
    color: var(--cartoon-blue);
    font-weight: bold;
    margin-bottom: 6px;
}

.terrain-buildable {
    color: var(--cartoon-green);
    font-size: 12px;
}

/* ===== RESOURCE TOOLTIP ===== */
.resource-tooltip {
    position: fixed;
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    border: 4px solid var(--cartoon-yellow);
    font-size: 13px;
    font-family: 'Fredoka', sans-serif;
    z-index: 10001;
    pointer-events: none;
    max-width: 250px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--cartoon-yellow);
    display: none;
    white-space: nowrap;
}

.resource-tooltip .tooltip-header {
    color: var(--cartoon-yellow);
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
    font-family: 'Lilita One', cursive;
}

.resource-tooltip .tooltip-description {
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
}

/* ===== MODAL DE CONTROLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    border: 6px solid var(--cartoon-green);
    border-radius: 24px;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 0 rgba(0, 0, 0, 0.4), 0 0 40px var(--cartoon-green);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 4px solid var(--cartoon-green);
}

.modal-header h2 {
    color: var(--cartoon-yellow);
    margin: 0;
    font-size: 2rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.close-btn {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border: 4px solid #FF1744;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 6px 0 #C41C3B;
    font-weight: bold;
    display: none !important;
}

.close-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 0 #C41C3B, 0 0 20px #FF6B9D;
}

.close-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 0 #C41C3B;
}

.modal-body {
    padding: 24px;
}

.controls-section {
    margin-bottom: 30px;
}

.controls-section h3 {
    color: var(--cartoon-blue);
    margin-bottom: 12px;
    font-size: 1.4rem;
    border-bottom: 3px solid var(--cartoon-blue);
    padding-bottom: 8px;
    font-family: 'Lilita One', cursive;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.controls-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.controls-section li {
    color: white;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border-radius: 12px;
    border-left: 5px solid var(--cartoon-green);
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    box-shadow: 0 4px 0 rgba(0, 200, 100, 0.3);
}

.controls-section li strong {
    color: var(--cartoon-yellow);
    font-weight: 700;
}

.help-btn {
    background: linear-gradient(145deg, #FF8C00, #FF6B00) !important;
    border: 4px solid #CC6000 !important;
    box-shadow: 0 6px 0 #994800 !important;
}

.help-btn:hover {
    transform: translateY(-6px) scale(1.05) !important;
    box-shadow: 0 10px 0 #994800, 0 0 25px #FF8C00 !important;
}

/* ===== DEVICE SELECTOR (help modal) ===== */
.device-selector {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.device-selector p {
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.device-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.device-btn {
    padding: 0.6rem 1.5rem;
    border: 3px solid transparent;
    border-radius: 16px;
    background: linear-gradient(145deg, #A855F7, #7C3AED);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 5px 0 #5B21B6;
    transition: all 0.2s ease;
}

.device-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #5B21B6;
}

.device-btn.active {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border-color: #FF1744;
    box-shadow: 0 5px 0 #C41C3B;
}

.controls-group {
    margin-bottom: 0.5rem;
}

/* ===== CONTROLES (#controls-modal): teclas e aviso do celular ===== */
.controls-section kbd {
    display: inline-block;
    min-width: 1.6em;
    margin: 0 0.1em;
    padding: 0.05em 0.4em;
    border: 2px solid #fff;
    border-bottom-width: 4px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font: 600 0.9em 'Fredoka', sans-serif;
    text-align: center;
    line-height: 1.3;
}

.controls-intro {
    margin: 0 0 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Fredoka', sans-serif;
    text-align: center;
}

.controls-soon {
    padding: 1.5rem 1rem;
    border: 3px dashed var(--cartoon-yellow);
    border-radius: 16px;
    background: rgba(255, 215, 0, 0.08);
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    text-align: center;
}

.controls-soon-tag {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0.9rem;
    border: 3px solid #000;
    border-radius: 999px;
    background: var(--cartoon-yellow);
    color: #000;
    font-family: 'Lilita One', cursive;
    font-size: 1.2rem;
}

.controls-soon p { margin: 0.4rem 0 0; line-height: 1.5; }

/* ===== BUILDING REQUIREMENTS PANEL ===== */
.building-requirements {
    padding: 18px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 16px;
    margin-bottom: 12px;
    border: 4px solid var(--cartoon-blue);
    box-shadow: 0 6px 0 rgba(0, 150, 199, 0.5);
}

.building-requirements h4 {
    color: var(--cartoon-blue);
    margin: 0 0 12px 0;
    font-size: 1.4em;
    border-bottom: 3px solid var(--cartoon-blue);
    padding-bottom: 6px;
    font-family: 'Lilita One', cursive;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.building-description {
    color: #fff;
    font-style: italic;
    margin-bottom: 18px;
    line-height: 1.5;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
}

.requirements-section h5 {
    color: var(--cartoon-purple);
    margin: 18px 0 10px 0;
    font-size: 1.1em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.terrain-requirements {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.15), rgba(0, 200, 100, 0.1));
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 5px solid var(--cartoon-green);
}

.compatible-terrain h6,
.incompatible-terrain h6 {
    margin: 0 0 6px 0;
    font-size: 1em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.compatible-terrain h6 {
    color: var(--cartoon-green);
}

.incompatible-terrain h6 {
    color: var(--cartoon-red);
}

.terrain-requirements ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}

.terrain-requirements li {
    padding: 4px 0;
    font-size: 0.95em;
    font-family: 'Fredoka', sans-serif;
}

.additional-requirements {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.15), rgba(0, 168, 204, 0.1));
    padding: 10px;
    border-radius: 10px;
    margin: 12px 0;
    border-left: 5px solid var(--cartoon-blue);
}

.additional-requirements h6 {
    color: var(--cartoon-blue);
    margin: 0 0 6px 0;
    font-size: 1em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.building-effects {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.1));
    padding: 12px;
    border-radius: 12px;
    margin-top: 12px;
    border-left: 5px solid var(--cartoon-purple);
}

.building-effects h5 {
    color: var(--cartoon-purple);
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.building-effects ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.building-effects li {
    padding: 3px 0;
    font-size: 0.95em;
    color: #333;
    font-family: 'Fredoka', sans-serif;
}

/* ===== BUILDING COOLDOWN INDICATOR ===== */
.building-cooldown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    color: white;
    padding: 30px 40px;
    border-radius: 24px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 16px 0 rgba(0, 0, 0, 0.4), 0 0 40px var(--cartoon-blue);
    border: 6px solid var(--cartoon-blue);
    min-width: 320px;
}

.building-cooldown.enhanced {
    animation: cooldownAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cooldown-icon {
    font-size: 3em;
    margin-bottom: 15px;
    animation: rotate-bounce 2s ease-in-out infinite;
    filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.3));
}

@keyframes rotate-bounce {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(1.1); }
    75% { transform: rotate(15deg) scale(1.1); }
}

.cooldown-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 18px;
    color: var(--cartoon-yellow);
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.cooldown-subtitle {
    font-size: 1em;
    color: #ffffff;
    margin-top: 12px;
    font-style: italic;
    font-family: 'Fredoka', sans-serif;
}

.cooldown-progress {
    width: 260px;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin: 18px auto;
    overflow: hidden;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.cooldown-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cartoon-red), var(--cartoon-orange), var(--cartoon-green));
    transition: width 0.1s ease;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 0 15px currentColor;
}

.cooldown-progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    transition: width 0.1s ease;
}

.cooldown-time {
    font-size: 2em;
    font-weight: bold;
    color: var(--cartoon-blue);
    margin-top: 12px;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

@keyframes cooldownAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.building-item.cooldown-disabled {
    position: relative;
    cursor: not-allowed !important;
    filter: grayscale(80%);
    opacity: 0.6;
}

.cooldown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    color: var(--cartoon-red);
    animation: pulse 1s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5));
}

.building-panel.cooldown-pulse {
    animation: panelPulse 2s ease-in-out infinite;
}

@keyframes panelPulse {
    0%, 100% {
        box-shadow: 6px 0 0 rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 6px 0 0 rgba(0, 0, 0, 0.3), 0 0 30px var(--cartoon-blue);
    }
}

/* ===== CONTINUA NO PRÓXIMO COMENTÁRIO (parte 3/3) ===== */
/* ===== PARTE 3/3 - CONTINUAÇÃO FINAL DO CSS CARTOON ===== */

/* ===== RESOURCE DETAILS PANELS ===== */
.resource-details-panel {
    padding: 18px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 16px;
    margin-bottom: 12px;
    border: 4px solid var(--cartoon-green);
    box-shadow: 0 6px 0 rgba(0, 170, 85, 0.5);
}

.resource-details-panel h4 {
    color: var(--cartoon-green);
    margin: 0 0 18px 0;
    font-size: 1.4em;
    border-bottom: 3px solid var(--cartoon-green);
    padding-bottom: 6px;
    font-family: 'Lilita One', cursive;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.resource-summary {
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.15), rgba(0, 200, 100, 0.1));
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 18px;
    border-left: 5px solid var(--cartoon-green);
}

.resource-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.resource-stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #444;
    font-family: 'Fredoka', sans-serif;
}

.stat-value {
    font-weight: bold;
    color: var(--cartoon-blue);
    font-family: 'Lilita One', cursive;
    font-size: 1.1em;
}

.stat-value.positive {
    color: var(--cartoon-green);
}

.stat-value.negative {
    color: var(--cartoon-red);
}

.resource-sources h5 {
    color: var(--cartoon-purple);
    margin: 18px 0 12px 0;
    font-size: 1.2em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

.resource-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-sources li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.15), rgba(0, 168, 204, 0.1));
    border-radius: 12px;
    border-left: 5px solid var(--cartoon-blue);
    color: #222;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s ease;
}

.resource-sources li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 0 rgba(0, 150, 199, 0.3);
}

.building-icon {
    font-size: 1.4em;
    margin-right: 12px;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.2));
}

.building-name {
    flex: 1;
    font-weight: 600;
    
}

.building-production,
.building-consumption,
.building-storage,
.building-cost,
.building-bonus {
    font-weight: bold;
    margin-left: 10px;
    font-family: 'Lilita One', cursive;
}

.building-production {
    color: var(--cartoon-green);
}

.building-consumption,
.building-cost {
    color: var(--cartoon-red);
}

.building-storage,
.building-bonus {
    color: var(--cartoon-blue);
}

.renewable-indicator {
    font-size: 0.85em;
    color: #555;
    margin-left: 6px;
}

.no-sources {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
}

.resource-counter {
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-counter:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transform: scale(1.05);
}

/* ===== EFEITOS DE ESCASSEZ DE ENERGIA ===== */
.building-status.power-shortage {
    color: var(--cartoon-red) !important;
    font-weight: bold;
    animation: powerShortageFlash 2s infinite;
    text-shadow: 0 0 10px var(--cartoon-red);
}

.power-shortage-warning {
    color: var(--cartoon-red) !important;
    font-weight: bold;
    background: linear-gradient(145deg, rgba(255, 71, 87, 0.2), rgba(230, 0, 0, 0.1));
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid var(--cartoon-red);
}

@keyframes powerShortageFlash {
    0%, 50% { opacity: 1; transform: scale(1); }
    25%, 75% { opacity: 0.6; transform: scale(1.05); }
}

/* ===== SISTEMA DE ALUGUEL ===== */
.rental-income {
    color: var(--cartoon-green) !important;
    font-weight: bold;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 212, 112, 0.1));
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid var(--cartoon-green);
    font-family: 'Fredoka', sans-serif;
}

.income-generation {
    color: var(--cartoon-blue) !important;
    font-weight: bold;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid var(--cartoon-blue);
    font-family: 'Fredoka', sans-serif;
}

/* ===== SELEÇÃO DE EDIFÍCIOS ===== */
.building-selection-info {
    padding: 18px;
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    border-radius: 16px;
    color: white;
    border: 4px solid var(--cartoon-yellow);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3), 0 0 25px var(--cartoon-yellow);
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--cartoon-yellow);
}

.selection-header h3 {
    margin: 0;
    color: var(--cartoon-yellow);
    font-size: 1.5rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.deselect-btn {
    background: linear-gradient(145deg, #FF6B9D, #FF4757);
    border: 3px solid #FF1744;
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 5px 0 #C41C3B;
}

.deselect-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 #C41C3B, 0 0 15px #FF6B9D;
}

.deselect-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #C41C3B;
}

.building-details {
    margin-bottom: 18px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 6px 0;
}

.detail-label {
    font-weight: bold;
    color: var(--cartoon-blue);
    font-family: 'Fredoka', sans-serif;
}

.detail-value {
    color: white;
    font-weight: 600;
}

.status-active {
    color: var(--cartoon-green) !important;
    font-weight: 700;
}

.status-inactive {
    color: var(--cartoon-red) !important;
    font-weight: 700;
}

.building-stats {
    margin-bottom: 18px;
}

.stat-item {
    padding: 6px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
}

.building-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
    position: relative;
}

.rental-btn {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    color: white;
    border: 4px solid #00AA55;
    box-shadow: 0 6px 0 #008844;
}

.rental-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #008844, 0 0 20px var(--cartoon-green);
}

.rental-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #008844;
}

/* Girar o prédio selecionado (UIManager.generateBuildingActions) */
.rotate-actions {
    display: flex;
    gap: 8px;
}

.rotate-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: 13px;
    line-height: 1.15;
    background: linear-gradient(145deg, #4FC3F7, #0288D1);
    color: white;
    border: 3px solid #01579B;
    box-shadow: 0 5px 0 #01579B;
    touch-action: manipulation;
}

.rotate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #01579B, 0 0 14px #4FC3F7;
}

.rotate-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #01579B;
}

.rotate-icon-wrap {
    display: inline-flex;
    flex: none;
}

.rotate-icon-spin {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rotate-btn:hover .rotate-icon-spin,
.rotate-btn:focus-visible .rotate-icon-spin {
    transform: rotate(40deg);
}

.rotate-btn.spin .rotate-icon-spin {
    animation: rotate-icon-quick-spin 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rotate-icon-quick-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stat-note {
    padding: 2px 0 6px;
    font-size: 12px;
    opacity: 0.85;
    font-family: 'Fredoka', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
    .rotate-icon-spin { transition: none; }
    .rotate-btn:hover .rotate-icon-spin,
    .rotate-btn:focus-visible .rotate-icon-spin { transform: none; }
    .rotate-btn.spin .rotate-icon-spin { animation: none; }
}

.recycle-btn {
    background: linear-gradient(145deg, var(--cartoon-orange), #FF6B00);
    color: white;
    border: 4px solid #CC6000;
    box-shadow: 0 6px 0 #994800;
}

.recycle-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #994800, 0 0 20px var(--cartoon-orange);
}

.recycle-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #994800;
}

/* ===== SISTEMA DE EMPRÉSTIMOS ===== */
.loan-interface {
    padding: 24px;
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    border-radius: 20px;
    color: white;
    max-height: 85vh;
    overflow-y: auto;
    border: 6px solid var(--cartoon-yellow);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.4), 0 0 35px var(--cartoon-yellow);
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 4px solid var(--cartoon-yellow);
}

.loan-header h3 {
    margin: 0;
    color: var(--cartoon-yellow);
    font-size: 1.8rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.financial-status {
    margin-bottom: 30px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
    border-radius: 16px;
    border: 4px solid var(--cartoon-green);
    box-shadow: 0 6px 0 rgba(0, 170, 85, 0.5);
}

.financial-status h4 {
    margin: 0 0 18px 0;
    color: var(--cartoon-green);
    font-family: 'Lilita One', cursive;
    font-size: 1.4rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.status-label {
    color: #ffffff;
    font-weight: bold;
    font-family: 'Fredoka', sans-serif;
}

.status-value {
    color: white;
    font-weight: 700;
    font-family: 'Lilita One', cursive;
}

.credit-score-excellent { color: var(--cartoon-green) !important; }
.credit-score-good { color: #8BC34A !important; }
.credit-score-fair { color: var(--cartoon-orange) !important; }
.credit-score-poor { color: var(--cartoon-red) !important; }

.loan-application {
    margin-bottom: 30px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border-radius: 16px;
    border: 4px solid var(--cartoon-blue);
    box-shadow: 0 6px 0 rgba(0, 150, 199, 0.5);
}

.loan-application h4 {
    margin: 0 0 18px 0;
    color: var(--cartoon-blue);
    font-family: 'Lilita One', cursive;
    font-size: 1.4rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.loan-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    color: #ffffff;
    font-weight: bold;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cartoon-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3), 0 4px 0 rgba(0, 150, 199, 0.5);
    transform: translateY(-2px);
}

.loan-preview {
    padding: 18px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border-radius: 12px;
    border: 3px solid var(--cartoon-blue);
}

.preview-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
}

.preview-item:last-child {
    margin-bottom: 0;
    font-weight: bold;
    color: var(--cartoon-yellow);
    font-size: 1.1em;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.loan-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Fredoka', sans-serif;
}

.calculate-btn {
    background: linear-gradient(145deg, var(--cartoon-orange), #FF6B00);
    color: white;
    border: 4px solid #CC6000;
    box-shadow: 0 6px 0 #994800;
}

.calculate-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #994800, 0 0 20px var(--cartoon-orange);
}

.calculate-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #994800;
}

.apply-btn {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    color: white;
    border: 4px solid #00AA55;
    box-shadow: 0 6px 0 #008844;
}

.apply-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #008844, 0 0 20px var(--cartoon-green);
}

.apply-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #008844;
}

.active-loans {
    padding: 18px;
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.2), rgba(255, 107, 0, 0.1));
    border-radius: 16px;
    border: 4px solid var(--cartoon-orange);
    box-shadow: 0 6px 0 rgba(204, 96, 0, 0.5);
}

.active-loans h4 {
    margin: 0 0 18px 0;
    color: var(--cartoon-orange);
    font-family: 'Lilita One', cursive;
    font-size: 1.4rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.no-loans {
    text-align: center;
    color: #ffffff;
    font-style: italic;
    margin: 0;
    font-family: 'Fredoka', sans-serif;
}

.loan-item {
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 5px solid var(--cartoon-orange);
}

.loan-item:last-child {
    margin-bottom: 0;
}

.loan-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
    font-family: 'Fredoka', sans-serif;
}

.loan-id {
    font-weight: bold;
    color: var(--cartoon-yellow);
    font-family: 'Lilita One', cursive;
}

.loan-balance {
    color: var(--cartoon-red);
    font-weight: 700;
}

.loan-payment {
    color: var(--cartoon-orange);
    font-weight: 700;
}

.loan-remaining {
    color: var(--cartoon-green);
    font-weight: 700;
}

/* ===== TERRAIN SELECTION INFO PANEL ===== */
.terrain-selection-info {
    padding: 18px;
    background: linear-gradient(145deg, #2D3561, #1A1F3A);
    border-radius: 16px;
    color: white;
    font-family: 'Fredoka', sans-serif;
    border: 4px solid var(--cartoon-green);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3), 0 0 25px var(--cartoon-green);
}

.terrain-selection-info h3 {
    margin: 0 0 18px 0;
    color: var(--cartoon-green);
    text-align: center;
    font-size: 1.6rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.terrain-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 18px;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
    border-radius: 16px;
    border: 3px solid var(--cartoon-green);
}

.terrain-type-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.terrain-icon-large {
    font-size: 56px;
    filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.3));
    animation: bounce 2s ease-in-out infinite;
}

.terrain-name-large {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--cartoon-yellow);
    font-family: 'Lilita One', cursive;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.terrain-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border-radius: 12px;
    border-left: 5px solid var(--cartoon-blue);
}

.terrain-action-btn {
    background: linear-gradient(145deg, var(--cartoon-blue), #00A8CC);
    color: white;
    border: 4px solid #0096C7;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 15px;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 6px 0 #006D8F;
}

.terrain-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #006D8F, 0 0 20px var(--cartoon-blue);
}

.terrain-action-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #006D8F;
}

/* ===== MISSION SYSTEM (SIMPLIFICADO) ===== */
.mission-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    font-family: 'Fredoka', sans-serif;
}

.mission-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(145deg, var(--cartoon-purple), #7C3AED);
    border: 3px solid #5B21B6;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 5px 0 #5B21B6;
}

.category-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 #5B21B6, 0 0 15px var(--cartoon-purple);
}

.category-btn.active {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    border-color: #00AA55;
    box-shadow: 0 5px 0 #00AA55, 0 0 15px var(--cartoon-green);
}

/* TASK #1: Mission Filter Buttons */
.mission-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.filter-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 1rem;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.3), rgba(0, 168, 204, 0.2));
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 10px;
    color: #00D4FF;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 3px 0 rgba(0, 150, 199, 0.3);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0, 150, 199, 0.3), 0 0 10px rgba(0, 212, 255, 0.5);
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.4), rgba(0, 168, 204, 0.3));
}

.filter-btn.active {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    border-color: #00AA55;
    color: white;
    box-shadow: 0 3px 0 #00AA55, 0 0 10px var(--cartoon-green);
}

.filter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #00AA55, 0 0 15px var(--cartoon-green);
}

.mission-count {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    min-width: 1.8rem;
    text-align: center;
    font-family: 'Lilita One', cursive;
}

.mission-card {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border: 3px solid var(--cartoon-blue);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 5px 0 rgba(0, 150, 199, 0.5);
}

.mission-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 rgba(0, 150, 199, 0.5), 0 0 20px var(--cartoon-blue);
}

.mission-card.completed {
    border-color: var(--cartoon-green);
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.1));
}

.mission-status {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    font-family: 'Fredoka', sans-serif;
    border: 2px solid;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.mission-status.available {
    background: linear-gradient(145deg, var(--cartoon-blue), #00A8CC);
    border-color: #0096C7;
    color: white;
}

.mission-status.completed {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    border-color: #00AA55;
    color: white;
}

.mission-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
}

.mission-btn.start {
    background: linear-gradient(145deg, var(--cartoon-green), #00D470);
    color: white;
    border: 3px solid #00AA55;
    box-shadow: 0 4px 0 #008844;
}

.mission-btn.start:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #008844, 0 0 12px var(--cartoon-green);
}

.mission-btn.info {
    background: linear-gradient(145deg, var(--cartoon-blue), #00A8CC);
    color: white;
    border: 3px solid #0096C7;
    box-shadow: 0 4px 0 #006D8F;
}

.mission-btn.info:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #006D8F, 0 0 12px var(--cartoon-blue);
}

/* ===== SCROLLBARS CUSTOMIZADAS ===== */
*::-webkit-scrollbar {
    width: 14px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cartoon-blue), var(--cartoon-purple));
    border-radius: 10px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--cartoon-purple), var(--cartoon-pink));
}

/* TASK #2: Choice Dialog Styles */
.choice-dialog {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
    border-radius: 16px;
    border: 3px solid var(--cartoon-blue);
}

.choice-header {
    text-align: center;
}

.choice-mission-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.choice-mission-title .mission-icon {
    font-size: 2rem;
}

.choice-mission-title h3 {
    color: var(--cartoon-yellow);
    margin: 0;
    font-size: 1.5rem;
    font-family: 'Lilita One', cursive;
}

.choice-question {
    color: #00D4FF;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.choice-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.choice-option {
    padding: 1.25rem;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 168, 204, 0.1));
    border: 3px solid var(--cartoon-blue);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    text-align: left;
    box-shadow: 0 4px 0 rgba(0, 150, 199, 0.5);
}

.choice-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 rgba(0, 150, 199, 0.5), 0 0 20px var(--cartoon-blue);
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.3), rgba(0, 168, 204, 0.2));
}

.choice-option-text {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.choice-consequences {
    font-size: 0.85rem;
    color: var(--cartoon-yellow);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.choice-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

.choice-cancel-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(145deg, rgba(255, 0, 0, 0.3), rgba(200, 0, 0, 0.2));
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 10px;
    color: #FF6B6B;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 3px 0 rgba(200, 0, 0, 0.3);
}

.choice-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(200, 0, 0, 0.3), 0 0 10px rgba(255, 0, 0, 0.5);
    background: linear-gradient(145deg, rgba(255, 0, 0, 0.4), rgba(200, 0, 0, 0.3));
}

/* ===== STUDY BOOK SYSTEM ===== */
.study-book-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.study-book-overlay.active {
    display: flex;
    opacity: 1;
}

.study-book-container {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: bookOpen 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bookOpen {
    from {
        transform: scale(0.8) rotateY(-15deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

/* Folha virando (StudyBookUI.showStudyBookInterface/turnStudyPage): mesmas keyframes
   page-in-next/page-in-prev do livro do tutorial (css/lessons.css). O livro é recriado a
   cada página; .is-turning evita que o bookOpen da abertura rode de novo na virada. */
.study-book-container.is-turning { animation: none; }

.study-book .book-content { transform-origin: left center; }
.study-book .book-content.turn-in-next { animation: page-in-next 0.4s ease-out; }
.study-book .book-content.turn-in-prev { animation: page-in-prev 0.4s ease-out; }

.study-book {
    background: linear-gradient(145deg, #FFF8E7, #F5E6D3);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.5);
    border: 4px solid #8B4513;
    perspective: 1800px; /* profundidade da folha virando */
    overflow-x: clip; /* a folha girando na direção do leitor não cria barra de rolagem lateral */
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #D4A574;
}

.book-header h2 {
    font-family: 'Lilita One', cursive;
    color: #5D4037;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5);
}

.book-close-btn {
    background: linear-gradient(145deg, #FF6B6B, #FF4757);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 0 #C92A2A;
    transition: all 0.2s;
}

.book-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #C92A2A;
}

.book-close-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #C92A2A;
}

.book-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cartoon-green), var(--cartoon-blue));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 600;
    color: #5D4037;
}

.book-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    min-height: 400px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-number {
    font-size: 0.9rem;
    color: #8B7355;
    margin-bottom: 0.5rem;
}

.page-title {
    font-family: 'Lilita One', cursive;
    color: #2D3561;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.page-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Botão 🔊 de leitura em voz alta (livro de estudo e tutorial) — setupReadAloud() em GameUtils.js */
.read-aloud-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 2px solid #b9d7ff;
    border-radius: 50%;
    background: #eef5ff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.read-aloud-btn:hover {
    background: #dcebff;
}

.read-aloud-btn:focus-visible {
    outline: 3px solid #4a9eff;
    outline-offset: 2px;
}

.read-aloud-btn[aria-pressed="true"] {
    background: #ffe9a8;
    border-color: #ffc845;
}

.read-aloud-btn[hidden] {
    display: none;
}

.page-image {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.page-text {
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

.page-text h3 {
    color: #2D3561;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.page-text h4 {
    color: #5D4037;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.page-text ul, .page-text ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.page-text li {
    margin-bottom: 0.5rem;
}

.page-text .highlight {
    background: linear-gradient(120deg, #FFD700 0%, #FFA500 100%);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #FF8C00;
    margin: 1rem 0;
}

.page-text .warning {
    background: linear-gradient(120deg, #FFE5E5 0%, #FFD0D0 100%);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #FF4757;
    margin: 1rem 0;
}

.page-text .success {
    background: linear-gradient(120deg, #E5FFE5 0%, #D0FFD0 100%);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #00FF88;
    margin: 1rem 0;
}

.page-text .tip {
    background: linear-gradient(120deg, #E5F5FF 0%, #D0EBFF 100%);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #00D4FF;
    margin: 1rem 0;
}

/* ===== QUIZ STYLES ===== */
.quiz-container {
    margin-top: 2rem;
}

.quiz-question {
    background: linear-gradient(145deg, #F8F9FA, #E9ECEF);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    border: 3px solid #DEE2E6;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.question-text {
    color: #2D3561;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.question-number {
    display: inline-block;
    background: linear-gradient(145deg, var(--cartoon-blue), #0099CC);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 3px solid #CED4DA;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.quiz-option:hover {
    border-color: var(--cartoon-blue);
    transform: translateX(5px);
    box-shadow: 0 4px 0 rgba(0, 212, 255, 0.3);
}

.quiz-option.selected {
    background: linear-gradient(145deg, #E3F2FD, #BBDEFB);
    border-color: var(--cartoon-blue);
    box-shadow: 0 4px 0 rgba(0, 212, 255, 0.3),
                inset 0 0 0 2px var(--cartoon-blue);
}

.quiz-option input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-text {
    flex: 1;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

.quiz-info {
    background: linear-gradient(145deg, #FFF3CD, #FFE69C);
    padding: 1.5rem;
    border-radius: 12px;
    border: 3px solid #FFD700;
    margin-top: 1.5rem;
    box-shadow: 0 4px 0 rgba(255, 193, 7, 0.3);
}

.quiz-info p {
    margin: 0.5rem 0;
    color: #5D4037;
    font-weight: 600;
}

/* ===== QUIZ WARNING & UNANSWERED ===== */
.quiz-warning-message {
    background: linear-gradient(145deg, #FFF3E0, #FFE0B2);
    border: 3px solid #FF9800;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    color: #E65100;
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 4px 0 rgba(255, 152, 0, 0.3);
    animation: shake 0.5s ease-in-out;
}

.quiz-question.unanswered {
    border-color: #FF9800 !important;
    box-shadow: 0 4px 0 rgba(255, 152, 0, 0.3), inset 0 0 0 2px rgba(255, 152, 0, 0.2);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse-border {
    0%, 100% { border-color: #FF9800; }
    50% { border-color: #FFE0B2; }
}

/* ===== QUIZ RESULTS ===== */
.quiz-results {
    text-align: center;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
    animation: resultsAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.quiz-results.quiz-passed {
    background: linear-gradient(145deg, #D4EDDA, #C3E6CB);
    border: 4px solid #28A745;
    box-shadow: 0 6px 0 rgba(40, 167, 69, 0.3),
                0 0 30px rgba(40, 167, 69, 0.2);
}

.quiz-results.quiz-failed {
    background: linear-gradient(145deg, #F8D7DA, #F5C6CB);
    border: 4px solid #DC3545;
    box-shadow: 0 6px 0 rgba(220, 53, 69, 0.3),
                0 0 30px rgba(220, 53, 69, 0.2);
}

.results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: iconBounce 0.6s ease;
}

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

.quiz-results h3 {
    font-family: 'Lilita One', cursive;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.quiz-passed h3 {
    color: #28A745;
}

.quiz-failed h3 {
    color: #DC3545;
}

.results-score {
    margin: 1.5rem 0;
}

.score-circle {
    display: inline-block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2),
                inset 0 0 0 6px currentColor;
    animation: scoreReveal 0.8s ease;
}

@keyframes scoreReveal {
    from {
        transform: rotate(-180deg) scale(0);
    }
    to {
        transform: rotate(0deg) scale(1);
    }
}

.quiz-passed .score-circle {
    color: #28A745;
}

.quiz-failed .score-circle {
    color: #DC3545;
}

.score-value {
    font-family: 'Lilita One', cursive;
    font-size: 2.5rem;
    color: inherit;
}

.results-message {
    font-size: 1.1rem;
    color: #333;
    margin: 1rem 0;
    font-weight: 600;
}

.retry-btn {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(145deg, var(--cartoon-orange), #FF7700);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 0 #CC5500;
    transition: all 0.2s;
}

.retry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 #CC5500;
}

.retry-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #CC5500;
}

/* ===== BOOK NAVIGATION ===== */
.book-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nav-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.prev-btn {
    background: linear-gradient(145deg, #ADB5BD, #868E96);
    color: white;
    box-shadow: 0 4px 0 #495057;
}

.prev-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #495057;
}

.prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn {
    background: linear-gradient(145deg, var(--cartoon-blue), #0099CC);
    color: white;
    box-shadow: 0 4px 0 #0077AA;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #0077AA;
}

.complete-btn {
    background: linear-gradient(145deg, var(--cartoon-green), #00CC66);
    color: white;
    box-shadow: 0 4px 0 #009944;
}

.complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #009944;
}

.nav-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 currentColor;
}

.book-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #8B7355;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== RESPONSIVE QUIZ STYLES ===== */
@media (max-width: 768px) {
    .study-book-container {
        width: 95%;
        max-height: 95vh;
    }

    .study-book {
        padding: 1.5rem;
    }

    .book-header h2 {
        font-size: 1.4rem;
    }

    .book-content {
        padding: 1.5rem;
        min-height: 300px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .quiz-question {
        padding: 1rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-value {
        font-size: 2rem;
    }

    .book-navigation {
        flex-direction: column;
    }
}

/* ===== CENTRAL ALERT MODAL ===== */
.central-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: centralAlertFadeIn 0.3s ease;
    pointer-events: auto;
}

.central-alert-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: centralAlertSlideIn 0.3s ease;
}

.central-alert-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.central-alert-title {
    font-family: 'Lilita One', cursive;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 10px;
}

.central-alert-message {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin-bottom: 8px;
}

.central-alert-details {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.central-alert-card.warning {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.15);
}

.central-alert-card.error {
    border-color: rgba(255, 71, 87, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 71, 87, 0.15);
}

.central-alert-btn {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 40px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--cartoon-blue), #0099cc);
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.central-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
}

.central-alert-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

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

@keyframes centralAlertSlideIn {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== FIM DO CSS CARTOON ===== */

/* ===== ÍCONES SVG DA INTERFACE (js/utils/Icons.js → uiIcon) =====
   Tamanho em em: acompanham a fonte de quem os contém, como os emojis que substituem. */
.ui-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    flex-shrink: 0;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.ui-icon--lg {
    width: 2.4em;
    height: 2.4em;
}

/* Em títulos, mesmo a versão grande fica do tamanho da linha */
h1 .ui-icon, h2 .ui-icon, h3 .ui-icon, h4 .ui-icon, h5 .ui-icon {
    width: 1.3em;
    height: 1.3em;
    margin-top: -0.15em;
}

/* Contêineres que já dão o tamanho do ícone (antes, pelo font-size do emoji) */
.btn-icon .ui-icon,
.building-icon .ui-icon,
.building-icon-large .ui-icon,
.objective-icon .ui-icon,
.compact-icon .ui-icon,
#tutorial-icon .ui-icon,
#gameover-icon .ui-icon,
.lesson-card-icon .ui-icon,
.mission-icon .ui-icon,
.central-alert-icon .ui-icon,
.weather-day-icon .ui-icon,
.cooldown-icon .ui-icon,
.cooldown-overlay .ui-icon,
.results-icon .ui-icon,
.pp-stat-icon .ui-icon,
.study-icon .ui-icon {
    width: 1.15em;
    height: 1.15em;
}

.book-chapter .ui-icon,
.weather-day-icon .ui-icon,
.category-btn .ui-icon {
    width: 1.6em;
    height: 1.6em;
}

/* Lista de construção: o ícone ocupa a caixa (que tem tamanho fixo, menor no celular) */
.building-item .building-icon .ui-icon {
    width: 78%;
    height: 78%;
}

.resource-icon .ui-icon {
    width: 1.9em;
    height: 1.9em;
}

.control-btn .ui-icon {
    width: 1.35em;
    height: 1.35em;
}

@media (max-width: 768px) {
    .resource-icon .ui-icon {
        width: 1.5em;
        height: 1.5em;
    }
}

/* Dica das construções que precisam de estudo (UIManager.showStudyTooltip) */
.study-tooltip {
    white-space: normal;
    max-width: 240px;
}
.study-tooltip .tooltip-header .ui-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
}
