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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.game-container {
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    background: #000;
}

.game-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
    display: block;
    background: #000;
}

.game-ui {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    display: none; /* Hidden by default */
}

.game-ui.debug-visible {
    display: block;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

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



@media (max-width: 768px) {
    .game-ui {
        bottom: 10px;
        right: 10px;
        min-width: 150px;
        padding: 10px;
    }
}

/* Character animation styles */
.character-moving {
    animation: bounce 0.3s ease-in-out;
}

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

/* Debug Controls */
.debug-controls {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.debug-btn:hover {
    background: #357abd;
}

/* Interaction Prompt */
.interaction-prompt {
    position: absolute;
    transform: translate(-50%, 0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: bold;
    animation: pulse 2s infinite;
    z-index: 100;
    white-space: nowrap;
    pointer-events: none; /* Don't interfere with game clicks */
}

.interaction-prompt.hidden {
    display: none;
}

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

/* Chat Modal - Cartoon Game Style */
.chat-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 650px;
    height: 90%;
    max-height: 750px;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 25px;
    border: 4px solid #4a90e2;
    box-shadow: 
        0 0 0 3px #ffffff,
        0 15px 35px rgba(74, 144, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: modalBounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chat-modal.hidden {
    display: none;
}

@keyframes modalBounceIn {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.05) rotate(2deg); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
    }
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    border-bottom: 3px solid #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    min-height: 90px;
}



.npc-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.npc-avatar:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

.npc-info {
    flex-grow: 1;
}

.npc-info h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.npc-info p {
    margin: 8px 0 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.2);
    color: #ffffff;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.9;
    font-style: italic;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.close-btn {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    border: 3px solid #ffffff;
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 10px rgba(255, 71, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.close-btn:hover {
    background: linear-gradient(135deg, #ff3742 0%, #ff2d3a 100%);
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 
        0 6px 15px rgba(255, 71, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.message-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    background: linear-gradient(145deg, #f0f8ff 0%, #e6f3ff 100%);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(74, 144, 226, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 25px;
    word-wrap: break-word;
    white-space: pre-line;
    line-height: 1.5;
    font-weight: 500;
    animation: messageBounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes messageBounceIn {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.8); 
    }
    50% { 
        opacity: 1; 
        transform: translateY(-5px) scale(1.02); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: 3px solid #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.message.user::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-left-color: #4a90e2;
}

.message.assistant {
    align-self: flex-start;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    border: 3px solid #4a90e2;
    box-shadow: 
        0 4px 12px rgba(74, 144, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.message.assistant::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-right-color: #4a90e2;
}

/* Place name styling for chat messages */
.place-name {
    color: #4a90e2;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(74, 144, 226, 0.3);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

/* Google Maps links styling - matches place-name but with underline and hand cursor */
.maps-link {
    color: #4a90e2;
    font-weight: 600;
    text-decoration: underline;
    text-shadow: 0 1px 2px rgba(74, 144, 226, 0.3);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(74, 144, 226, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.maps-link:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(74, 144, 226, 0.1));
    border-color: rgba(74, 144, 226, 0.4);
    text-decoration: underline;
}

.loading-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.response-options {
    padding: 18px 25px;
    background: linear-gradient(145deg, #fff5f5 0%, #ffe6e6 100%);
    border-top: 3px solid #ffd93d;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.response-options.hidden {
    display: none;
}

.option-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffd93d 0%, #ffcd3c 100%);
    border: 3px solid #ffffff;
    border-radius: 25px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #2c3e50;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 10px rgba(255, 217, 61, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    flex: 0 1 auto;
    white-space: nowrap;
}

.option-btn:hover {
    background: linear-gradient(135deg, #ffcd3c 0%, #ffc107 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 15px rgba(255, 217, 61, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-input {
    display: flex;
    padding: 22px 25px;
    background: linear-gradient(145deg, #f0f8ff 0%, #e6f3ff 100%);
    border-top: 3px solid #4a90e2;
    border-radius: 0 0 20px 20px;
    gap: 15px;
}

#messageInput {
    flex-grow: 1;
    padding: 16px 22px;
    border: 3px solid #4a90e2;
    border-radius: 30px;
    outline: none;
    font-size: 1.05rem;
    font-weight: 500;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(74, 144, 226, 0.1);
    transition: all 0.2s ease;
    color: #2c3e50;
}

#messageInput:focus {
    border-color: #ffd93d;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(255, 217, 61, 0.3),
        0 4px 12px rgba(74, 144, 226, 0.2);
    transform: scale(1.02);
}

.send-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border: 3px solid #ffffff;
    padding: 16px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 12px rgba(255, 107, 107, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.send-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 18px rgba(255, 107, 107, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.send-btn:disabled {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Loading Overlay - Cartoon Style */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(74, 144, 226, 0.9) 0%, rgba(255, 107, 107, 0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
    backdrop-filter: blur(8px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    font-size: 4rem;
    animation: spinBounce 1.5s ease-in-out infinite;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.loading-overlay p {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spinBounce {
    0%, 100% { 
        transform: rotate(0deg) scale(1); 
    }
    25% { 
        transform: rotate(90deg) scale(1.1); 
    }
    50% { 
        transform: rotate(180deg) scale(1); 
    }
    75% { 
        transform: rotate(270deg) scale(1.1); 
    }
}


