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

body {
    font-family: 'Fredoka', sans-serif;
    overflow-x: hidden;
    background: #87CEEB;
}

/* Main Map Container */
.map-container {
    width: 100vw;
    height: 100vh;
    background-image: url('images/emotion map.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* Banner Overlay */
.banner-overlay {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    animation: bannerAppear 1s ease-out;
    pointer-events: none;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner-overlay img {
    width: 800px;
    height: auto;
    max-width: 90vw;
    min-width: 320px;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5));
    animation: float 4s ease-in-out infinite;
    display: block;
    /* Preserve PNG transparency while enhancing visibility */
    background: none;
}

@keyframes bannerAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Character Guide */
.character-guide {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    animation: characterFloat 3s ease-in-out infinite;
}

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

@keyframes characterFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

.character-guide img {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.speech-bubble {
    background: white;
    border-radius: 20px;
    padding: 15px 20px;
    position: relative;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: fadeIn 1s ease-out;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -20px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid white;
    transform: rotate(-30deg);
}

.speech-bubble p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* Region Cards */
.region-card {
    position: absolute;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(255, 255, 255, 0.92) 50%,
        rgba(245, 245, 255, 0.88) 100%);
    border-radius: 15px;
    padding: 10px;
    width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.08),
        0 8px 20px rgba(100, 100, 200, 0.15),
        0 12px 30px rgba(150, 100, 255, 0.1),
        inset 0 1px 2px rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.region-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 100%);
    border-radius: 15px 15px 0 0;
    pointer-events: none;
}

.region-card:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.1),
        0 12px 28px rgba(100, 100, 200, 0.2),
        0 18px 40px rgba(150, 100, 255, 0.15),
        inset 0 1px 2px rgba(255,255,255,0.9);
    z-index: 50;
}

.region-card.playing-audio::after {
    content: '🔊';
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #FFD93D 0%, #FFB931 100%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    animation: audioPulse 1s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(255, 185, 49, 0.5);
}

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

/* Position each region card on the map */
#angry-volcano {
    top: calc(35% - 100px);
    right: calc(25% - 205px);
}

#sadness-swamp {
    bottom: 25%;
    right: 15%;
}

#fear-forest {
    top: 20%;
    left: 15%;
}

#happiness-hills {
    top: 15%;
    left: 45%;
}

#excitement-rapids {
    bottom: 15%;
    left: 40%;
}

#tenderness-cove {
    top: 60%;
    left: 20%;
}

.region-image-container {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 10px;
}

.region-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.region-card:hover .region-image-container img {
    transform: scale(1.1);
}

.pulse-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255,255,255,0.8), transparent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.region-card.active .pulse-indicator {
    animation: pulse 2s infinite;
    opacity: 1;
}

@keyframes pulse {
    0% {
        width: 20px;
        height: 20px;
        opacity: 0.8;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

.region-card h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
    text-align: center;
    font-weight: 600;
}

.region-card p {
    color: #666;
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
}

/* Explorer's Log */
#explorers-log {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

#explorers-log h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

#charm-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.charm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: charmAppear 0.5s ease-out;
}

@keyframes charmAppear {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* Game Screen */
.game-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 2000;
}

.game-screen.hidden {
    display: none;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Fredoka', sans-serif;
}

.back-btn:hover {
    background: #5a67d8;
    transform: translateX(-5px);
}

/* Emotion Meter */
.emotion-meter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.emotion-meter label {
    font-weight: 600;
    color: #333;
}

.meter-container {
    width: 200px;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #44ff44 100%);
    width: 10%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.meter-label {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

#current-emotion {
    color: #ff4444;
    font-weight: 600;
}

/* Game Area */
#game-area {
    height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Dialogue Box - Now draggable and positioned on left */
.dialogue-box {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(245, 245, 255, 0.95) 100%);
    border-radius: 20px;
    padding: 20px 20px 20px 80px;
    width: 320px;
    box-shadow: 
        0 8px 30px rgba(100, 100, 200, 0.3),
        0 12px 40px rgba(150, 100, 255, 0.2),
        inset 0 1px 2px rgba(255,255,255,0.9);
    cursor: move;
    transition: box-shadow 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.dialogue-box:hover {
    box-shadow: 
        0 10px 35px rgba(100, 100, 200, 0.4),
        0 15px 45px rgba(150, 100, 255, 0.3),
        inset 0 1px 2px rgba(255,255,255,0.9);
}

.dialogue-box.dragging {
    cursor: grabbing;
    box-shadow: 
        0 15px 40px rgba(100, 100, 200, 0.5),
        0 20px 50px rgba(150, 100, 255, 0.4),
        inset 0 1px 2px rgba(255,255,255,0.9);
}

.dialogue-box.hidden {
    display: none;
}

.dialogue-character {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.dialogue-character img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background: white;
}

.dialogue-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#dialogue-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 5px;
}

.icon-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-end;
}

.icon-btn:hover {
    background: #5a67d8;
    transform: scale(1.1);
}

.dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.dialogue-option {
    background: #f0f0f0;
    border: 2px solid transparent;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Fredoka', sans-serif;
    font-size: 13px;
    text-align: left;
}

.dialogue-option:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Breathing Game Styles */
.breathing-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.volcano-container {
    width: 400px;
    height: 400px;
    position: relative;
}

.volcano {
    width: 100%;
    height: 100%;
    background: conic-gradient(from 180deg at 50% 100%, #8b4513 0%, #a0522d 50%, #8b4513 100%);
    clip-path: polygon(20% 100%, 50% 0%, 80% 100%);
    position: relative;
}

.lava {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(180deg, #ff4444, #ff8800);
    transition: height 0.5s ease;
    opacity: 0.9;
    animation: bubble 2s infinite;
}

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

.breathing-circle {
    width: 150px;
    height: 150px;
    border: 4px solid #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
    transition: transform 4s ease-in-out;
}

.breathing-circle.inhale {
    transform: scale(1.3);
}

.breathing-circle.exhale {
    transform: scale(0.8);
}

/* Start Journey Button */
.start-journey-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        0 8px 25px rgba(118, 75, 162, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.start-journey-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.start-journey-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 15px 35px rgba(118, 75, 162, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #7c8ef0 0%, #8659b8 100%);
}

.start-journey-btn:hover::before {
    left: 100%;
}

.start-journey-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.start-journey-btn:focus {
    outline: none;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.5),
        0 15px 35px rgba(118, 75, 162, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 0 0 4px rgba(102, 126, 234, 0.3);
}

/* Add sparkle animation for extra magic */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.start-journey-btn::after {
    content: '✨';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    animation: sparkle 2s infinite;
    animation-delay: 1s;
}

/* Large Screen Optimization */
@media (min-width: 1200px) {
    .banner-overlay img {
        width: 900px;
        max-width: 80vw;
    }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1199px) {
    .banner-overlay img {
        width: 750px;
        max-width: 85vw;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .region-card {
        width: 120px;
    }
    
    .region-card h3 {
        font-size: 14px;
    }
    
    .region-card p {
        font-size: 11px;
    }
    
    .character-guide {
        flex-direction: column;
        align-items: center;
    }
    
    .speech-bubble {
        max-width: 250px;
    }
    
    .speech-bubble::before {
        left: 50%;
        transform: translateX(-50%) rotate(0deg);
    }
    
    .start-journey-btn {
        padding: 12px 25px;
        font-size: 16px;
        margin-top: 15px;
    }
    
    .start-journey-btn::after {
        right: 12px;
        font-size: 14px;
    }
    
    .banner-overlay {
        top: 10px;
    }
    
    .banner-overlay img {
        width: 600px;
        max-width: 95vw;
        min-width: 280px;
    }
}

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