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

body {
    background: linear-gradient(135deg, #0a0015 0%, #1a0533 30%, #2d0a4a 60%, #0a0820 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 4/3;
    background: #000;
    border: 6px solid transparent;
    border-image: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff) 1;
    box-shadow: 
        0 0 40px #ff00ff,
        0 0 80px rgba(255, 0, 255, 0.3),
        inset 0 0 30px rgba(255, 0, 255, 0.2);
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: 10px;
}

#title {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    color: #ffd700;
    text-shadow: 
        3px 3px 0 #ff0066,
        -2px -2px 0 #00ffff,
        0 0 20px #ffd700;
    letter-spacing: 4px;
    transform: rotate(-3deg) skewX(-5deg);
    animation: titleWobble 3s ease-in-out infinite;
}

@keyframes titleWobble {
    0%, 100% { transform: rotate(-3deg) skewX(-5deg); }
    50% { transform: rotate(2deg) skewX(3deg); }
}

#level-container {
    position: absolute;
    top: 40px;
    left: 10px;
    color: #ff69b4;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 10px;
    border-radius: 4px;
    border: 2px solid #ff69b4;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

#hearts-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #ff4444;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

#rupees-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #00ff00;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#debt-container {
    position: absolute;
    bottom: 45px;
    left: 10px;
    color: #ffaa00;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 10px;
    border-radius: 4px;
    border: 2px solid #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

#progress-container {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff00ff;
    font-size: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

#progress-bar {
    width: 80px;
    height: 12px;
    background: #222;
    border-radius: 6px;
    margin-top: 5px;
    overflow: hidden;
    border: 1px solid #444;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

#weapon-container {
    position: absolute;
    top: 55px;
    right: 10px;
    color: #00ffff;
    font-size: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 6px 10px;
    border-radius: 4px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#inventory {
    position: absolute;
    top: 70px;
    left: 10px;
    display: flex;
    gap: 5px;
}

.inv-item {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.inv-item.selected {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    transform: scale(1.1);
}

.inv-item:hover {
    transform: scale(1.1);
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 0, 100, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.3) 0%, transparent 50%),
        linear-gradient(180deg, #0a0015 0%, #1a0533 50%, #0a0820 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 30px;
    z-index: 100;
    cursor: pointer;
    overflow-y: auto;
}

#start-title {
    font-size: 56px;
    color: #ffd700;
    text-shadow: 
        5px 5px 0 #ff0066,
        -3px -3px 0 #00ffff,
        0 0 40px #ffd700,
        0 0 80px #ff00ff;
    margin-bottom: 10px;
    animation: titleCrazy 2s ease-in-out infinite;
    letter-spacing: 8px;
}

@keyframes titleCrazy {
    0%, 100% { 
        transform: scale(1) rotate(-2deg) skewX(-3deg);
        filter: hue-rotate(0deg);
    }
    25% { transform: scale(1.02) rotate(1deg) skewX(2deg); }
    50% { 
        transform: scale(1.05) rotate(3deg) skewX(-2deg);
        filter: hue-rotate(20deg);
    }
    75% { transform: scale(1.02) rotate(-1deg) skewX(1deg); }
}

#start-subtitle {
    font-size: 14px;
    color: #ff69b4;
    margin-bottom: 20px;
    text-shadow: 0 0 15px #ff69b4;
    animation: subtitlePulse 1.5s ease-in-out infinite;
}

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

#start-princess {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ff69b4 0%, #ff1493 100%);
    border-radius: 50%;
    margin-bottom: 20px;
    position: relative;
    animation: princessFloat 2s ease-in-out infinite;
    box-shadow: 0 0 30px #ff69b4, 0 0 60px rgba(255, 105, 180, 0.5);
}

#start-princess::before {
    content: '👸';
    font-size: 36px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleX(-1);
    filter: drop-shadow(0 0 10px #fff);
}

@keyframes princessFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

#start-prompt {
    font-size: 12px;
    color: #00ffff;
    animation: blinkCrazy 0.8s steps(2) infinite;
    text-shadow: 0 0 15px #00ffff;
    margin-bottom: 15px;
}

#mobile-start {
    display: none;
    font-size: 10px;
    color: #ff69b4;
    margin-bottom: 15px;
}

#instructions-box {
    background: rgba(0, 0, 0, 0.85);
    border: 3px solid #00ffff;
    border-radius: 12px;
    padding: 15px 20px;
    max-width: 350px;
    text-align: left;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

#instructions-title {
    font-size: 12px;
    color: #ffd700;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 10px #ffd700;
}

#instructions-content {
    font-size: 8px;
    color: #fff;
    line-height: 2;
}

#instructions-content p {
    margin-bottom: 5px;
}

#instructions-content strong {
    color: #00ffff;
}

#instructions-content hr {
    border: none;
    border-top: 1px solid #ff69b4;
    margin: 10px 0;
}

@keyframes blinkCrazy {
    0%, 100% { opacity: 1; color: #00ffff; }
    50% { opacity: 0.3; color: #ff00ff; }
}

.hidden {
    display: none !important;
}

/* CHATBOT STYLES */
#chatbot-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 100, 200, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(100, 255, 200, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #0d0020 0%, #1a0040 50%, #0a0025 100%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#chatbot-container {
    width: 100%;
    max-width: 600px;
    height: 100%;
    max-height: 500px;
    background: rgba(10, 0, 30, 0.95);
    border: 4px solid #ff69b4;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 0 40px rgba(255, 105, 180, 0.5),
        inset 0 0 20px rgba(255, 105, 180, 0.1);
    overflow: hidden;
}

#chatbot-header {
    background: linear-gradient(90deg, #ff0066, #ff69b4, #ff00ff);
    padding: 15px;
    text-align: center;
}

#chatbot-title {
    font-size: 14px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 5px;
}

#chatbot-subtitle {
    font-size: 8px;
    color: #ffd700;
    text-shadow: 1px 1px 0 #000;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 9px;
    line-height: 1.6;
    animation: messageAppear 0.3s ease-out;
}

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

.chat-message.bot {
    align-self: flex-start;
    background: linear-gradient(135deg, #2a0050 0%, #1a0030 100%);
    border: 2px solid #ff00ff;
    color: #fff;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #004040 0%, #002020 100%);
    border: 2px solid #00ffff;
    color: #00ffff;
}

.chat-message.system {
    align-self: center;
    background: linear-gradient(135deg, #403000 0%, #302000 100%);
    border: 2px solid #ffd700;
    color: #ffd700;
    text-align: center;
    font-size: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #ff69b4;
    border-radius: 50%;
    animation: typingBounce 1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

#chat-input-container {
    display: flex;
    padding: 10px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid #ff69b4;
}

#chat-input {
    flex: 1;
    background: rgba(20, 0, 40, 0.8);
    border: 2px solid #ff00ff;
    border-radius: 8px;
    padding: 10px 15px;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    outline: none;
    transition: all 0.3s;
}

#chat-input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

#chat-input::placeholder {
    color: #666;
}

#chat-send {
    background: linear-gradient(180deg, #ff0066 0%, #aa0044 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #660022;
}

#chat-send:hover {
    background: linear-gradient(180deg, #00ffff 0%, #00aaaa 100%);
    box-shadow: 0 3px 0 #006666;
}

#chat-send:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #660022;
}

#sprite-preview {
    background: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #ffd700;
    padding: 15px;
}

#sprite-preview-title {
    font-size: 10px;
    color: #ffd700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #ffd700;
}

#sprite-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.sprite-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.sprite-item img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    border: 2px solid #ff00ff;
    border-radius: 8px;
    background: #1a0030;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.sprite-item img.loading {
    opacity: 0.5;
    animation: spritePulse 1s infinite;
}

@keyframes spritePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.sprite-item span {
    font-size: 6px;
    color: #aaa;
    text-transform: uppercase;
}

#start-game-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #ffd700 0%, #cc9900 100%);
    border: none;
    border-radius: 8px;
    padding: 15px;
    color: #000;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #886600, 0 0 20px rgba(255, 215, 0, 0.5);
    animation: doorPulse 1s infinite;
}

@keyframes doorPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 0 #886600, 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.02); box-shadow: 0 4px 0 #886600, 0 0 40px rgba(255, 215, 0, 0.8); }
}

#start-game-btn:hover {
    background: linear-gradient(180deg, #00ff88 0%, #00aa55 100%);
    box-shadow: 0 4px 0 #006633, 0 0 30px rgba(0, 255, 136, 0.8);
}

/* STORE STYLES */
#store-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, #0a0020 0%, #150030 50%, #0a0015 100%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#store-container {
    width: 100%;
    max-width: 500px;
    background: rgba(10, 0, 30, 0.95);
    border: 4px solid #ffd700;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

#store-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd700;
}

#store-title {
    font-size: 18px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #ff6600, 0 0 20px #ffd700;
    margin-bottom: 10px;
}

#store-subtitle {
    font-size: 10px;
    color: #ff69b4;
}

#store-rupees-display {
    font-size: 14px;
    color: #00ff00;
    margin-top: 10px;
}

#store-credits-display {
    font-size: 12px;
    color: #00ffff;
    margin-top: 5px;
}

#store-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.store-item {
    background: linear-gradient(135deg, #1a0040 0%, #0a0020 100%);
    border: 2px solid #ff00ff;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.store-item:hover {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateX(5px);
}

.store-item.maxed {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.store-item.cant-afford {
    opacity: 0.6;
    cursor: not-allowed;
}

.store-item-name {
    font-size: 10px;
    color: #fff;
    width: 50%;
}

.store-item-desc {
    font-size: 7px;
    color: #aaa;
    width: 100%;
    margin-top: 5px;
}

.store-item-level {
    font-size: 8px;
    color: #00ff00;
}

.store-item-cost {
    font-size: 10px;
    color: #ffd700;
}

.store-item-credit {
    font-size: 8px;
    color: #00ffff;
    width: 100%;
    margin-top: 5px;
    text-align: center;
    animation: creditPulse 1s infinite;
}

@keyframes creditPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#watch-ad-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #ff6600 0%, #cc4400 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #883300, 0 0 15px rgba(255, 102, 0, 0.5);
    margin-bottom: 10px;
}

#watch-ad-btn:hover {
    background: linear-gradient(180deg, #ff8800 0%, #ee5500 100%);
    box-shadow: 0 4px 0 #994400, 0 0 25px rgba(255, 136, 0, 0.8);
}

#store-close-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #00ff88 0%, #00aa55 100%);
    border: none;
    border-radius: 8px;
    padding: 15px;
    color: #000;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #006633, 0 0 20px rgba(0, 255, 136, 0.5);
}

#store-close-btn:hover {
    background: linear-gradient(180deg, #ffd700 0%, #cc9900 100%);
    box-shadow: 0 4px 0 #886600, 0 0 30px rgba(255, 215, 0, 0.8);
}

/* AD SCREEN STYLES */
#ad-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #0d1b2a 0%, #1b263b 50%, #0d1b2a 100%);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#ad-container {
    width: 100%;
    max-width: 550px;
    max-height: 95%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 4px solid #4cc9f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        0 0 40px rgba(76, 201, 240, 0.4),
        inset 0 0 20px rgba(76, 201, 240, 0.1);
    overflow-y: auto;
}

#ad-header {
    font-size: 12px;
    color: #4cc9f0;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #4cc9f0;
}

#ad-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#ad-logo-link {
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

#ad-logo-link:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 0 20px rgba(114, 9, 183, 0.8));
}

#ad-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    border: 3px solid #7209b7;
    box-shadow: 0 0 20px rgba(114, 9, 183, 0.5);
}

#ad-text {
    font-size: 8px;
    color: #e0e0e0;
    line-height: 1.8;
    text-align: center;
}

#ad-text p {
    margin-bottom: 10px;
}

#ad-text strong {
    color: #4cc9f0;
}

.ad-cta {
    font-size: 10px !important;
    color: #f72585 !important;
    text-shadow: 0 0 10px #f72585;
}

/* Late 90s Video Game Typewriter Effect */
.retro-typewriter {
    font-size: 7px !important;
    color: #00ff88 !important;
    text-shadow: 
        0 0 5px #00ff88,
        2px 2px 0 #004422;
    background: linear-gradient(180deg, rgba(0, 40, 20, 0.9) 0%, rgba(0, 20, 10, 0.95) 100%);
    border: 3px solid #00ff88;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    animation: crtFlicker 0.1s infinite alternate, scanlines 0.05s linear infinite;
    text-align: left;
    line-height: 2;
    letter-spacing: 0.5px;
}

.retro-typewriter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.03) 2px,
        rgba(0, 255, 136, 0.03) 4px
    );
    pointer-events: none;
}

.retro-typewriter::after {
    content: '▌';
    animation: blink90s 0.7s step-end infinite;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

@keyframes crtFlicker {
    0% { opacity: 0.97; }
    100% { opacity: 1; }
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

@keyframes blink90s {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.ad-tagline {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#ad-back-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(180deg, #4cc9f0 0%, #3a9fc0 100%);
    border: none;
    border-radius: 8px;
    padding: 15px;
    color: #000;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #2a7a90, 0 0 20px rgba(76, 201, 240, 0.5);
}

#ad-back-btn:hover {
    background: linear-gradient(180deg, #7209b7 0%, #560bad 100%);
    box-shadow: 0 4px 0 #3c0663, 0 0 30px rgba(114, 9, 183, 0.8);
}

#intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at center, rgba(100, 0, 150, 0.4) 0%, transparent 70%),
        linear-gradient(180deg, #0a0015 0%, #1a0533 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    padding: 20px;
}

#intro-title {
    font-size: 24px;
    color: #ffd700;
    text-shadow: 3px 3px 0 #ff0066, 0 0 20px #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

#intro-image {
    width: 256px;
    height: 192px;
    background: #1a0a2e;
    border: 4px solid #ff00ff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
    image-rendering: pixelated;
}

#intro-image canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#intro-text {
    font-size: 12px;
    color: #fff;
    text-align: center;
    max-width: 400px;
    line-height: 1.8;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

#intro-progress {
    font-size: 10px;
    color: #888;
    margin-bottom: 10px;
}

#intro-prompt {
    font-size: 10px;
    color: #00ffff;
    animation: blinkCrazy 1s steps(2) infinite;
}

#level-complete-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: 
        radial-gradient(circle, rgba(0, 255, 100, 0.2) 0%, transparent 70%),
        rgba(0, 0, 0, 0.95);
    border: 4px solid #00ff00;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    z-index: 200;
    box-shadow: 0 0 40px #00ff00, 0 0 80px rgba(0, 255, 0, 0.3);
    animation: levelCompleteAppear 0.5s ease-out;
}

@keyframes levelCompleteAppear {
    from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#level-complete-title {
    font-size: 24px;
    color: #00ff00;
    text-shadow: 3px 3px 0 #008800, 0 0 20px #00ff00;
    margin-bottom: 20px;
    animation: levelTitlePulse 0.5s ease-in-out infinite;
}

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

#level-complete-stats {
    font-size: 12px;
    color: #88ff88;
    line-height: 2;
    margin-bottom: 20px;
}

#level-story {
    font-size: 10px;
    color: #ff69b4;
    margin-top: 10px;
    font-style: italic;
}

#level-complete-prompt {
    font-size: 10px;
    color: #ffff00;
    animation: blinkCrazy 1s steps(2) infinite;
}

#pause-menu,
#victory-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: 
        radial-gradient(circle, rgba(255, 0, 255, 0.2) 0%, transparent 70%),
        rgba(0, 0, 0, 0.95);
    border: 4px solid #ff00ff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    z-index: 200;
    box-shadow: 0 0 40px #ff00ff, 0 0 80px rgba(255, 0, 255, 0.3);
}

#pause-title,
#victory-title {
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #ff0066, 0 0 20px #ffd700;
}

#pause-menu button,
#victory-screen button {
    display: block;
    width: 100%;
    padding: 14px 28px;
    margin: 12px 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    background: linear-gradient(180deg, #ff0066 0%, #aa0044 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 0 4px 0 #660022, 0 0 15px rgba(255, 0, 102, 0.5);
}

#pause-menu button:hover,
#victory-screen button:hover {
    background: linear-gradient(180deg, #00ffff 0%, #00aaaa 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #006666, 0 0 20px rgba(0, 255, 255, 0.5);
}

#pause-menu button:active,
#victory-screen button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #660022;
}

#victory-stats {
    font-size: 10px;
    color: #00ffff;
    line-height: 2;
    margin-bottom: 20px;
    text-align: left;
}

#dialogue-box {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: 
        linear-gradient(180deg, rgba(20, 0, 40, 0.95) 0%, rgba(0, 0, 0, 0.95) 100%);
    border: 3px solid #ffd700;
    border-radius: 8px;
    padding: 15px 25px;
    max-width: 80%;
    z-index: 50;
    animation: dialogueAppear 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

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

#dialogue-text {
    font-size: 10px;
    color: #fff;
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

#mobile-controls {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    pointer-events: none;
    z-index: 60;
}

#dpad {
    position: absolute;
    left: 20px;
    bottom: 20px;
    width: 100px;
    height: 100px;
    pointer-events: auto;
}

.dpad-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, rgba(255, 0, 255, 0.7) 0%, rgba(150, 0, 150, 0.7) 100%);
    border: 2px solid #ff00ff;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 3px 0 #660066, 0 0 10px rgba(255, 0, 255, 0.5);
    text-shadow: 0 0 5px #fff;
}

.dpad-btn:active {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.9) 0%, rgba(0, 150, 150, 0.9) 100%);
    transform: translateY(2px);
    box-shadow: 0 1px 0 #006666;
}

#btn-up { top: 0; left: 50%; transform: translateX(-50%); }
#btn-down { bottom: 0; left: 50%; transform: translateX(-50%); }
#btn-left { left: 0; top: 50%; transform: translateY(-50%); }
#btn-right { right: 0; top: 50%; transform: translateY(-50%); }

#action-buttons {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.action-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.8) 0%, rgba(200, 150, 0, 0.8) 100%);
    border: 3px solid #ffd700;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 0 #997700, 0 0 15px rgba(255, 215, 0, 0.5);
    text-shadow: 0 0 5px #fff;
}

.action-btn:active {
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.9) 0%, rgba(0, 200, 200, 0.9) 100%);
    border-color: #00ffff;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #006666;
}

#footer {
    margin-top: 20px;
    padding: 10px;
}

#footer a {
    color: #ff69b4;
    text-decoration: none;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    transition: all 0.3s;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5);
}

#footer a:hover {
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #game-container {
        border-width: 4px;
    }
    
    #title {
        font-size: 16px;
    }
    
    #level-container,
    #hearts-container,
    #rupees-container,
    #debt-container,
    #progress-container,
    #weapon-container {
        font-size: 8px;
        padding: 5px 8px;
    }
    
    #progress-bar {
        width: 60px;
    }
    
    .inv-item {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    #start-title {
        font-size: 36px;
    }
    
    #start-prompt {
        display: none;
    }
    
    #mobile-start {
        display: block;
    }
    
    #mobile-controls {
        display: block;
    }
    
    #dialogue-box {
        bottom: 140px;
    }
    
    #footer {
        margin-top: 10px;
    }
    
    #footer a {
        font-size: 8px;
    }
    
    #intro-title {
        font-size: 18px;
    }
    
    #intro-text {
        font-size: 10px;
    }
    
    #intro-image {
        width: 192px;
        height: 144px;
    }
    
    #chatbot-container {
        max-height: 90%;
    }
    
    #chatbot-title {
        font-size: 11px;
    }
    
    .sprite-item img {
        width: 48px;
        height: 48px;
    }
    
    #store-container {
        padding: 15px;
    }
    
    #store-title {
        font-size: 14px;
    }
    
    .store-item-name {
        font-size: 8px;
    }
    
    #instructions-box {
        max-width: 280px;
        padding: 10px 15px;
    }
    
    #instructions-title {
        font-size: 10px;
    }
    
    #instructions-content {
        font-size: 7px;
    }
    
    .retro-typewriter {
        font-size: 6px !important;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #dpad {
        width: 80px;
        height: 80px;
        left: 10px;
        bottom: 10px;
    }
    
    .dpad-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    #action-buttons {
        right: 10px;
        bottom: 15px;
        gap: 10px;
    }
    
    .action-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .retro-typewriter {
        font-size: 5px !important;
        padding: 8px;
        line-height: 1.8;
    }
}