* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Menu Screens */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-out;
}

.menu-screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #2a0a3e 100%);
    overflow: hidden;
}

.animated-bg {
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 51, 102, 0.1) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-10%, -10%) rotate(5deg);
    }
}

.menu-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.menu-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.game-title {
    margin-bottom: 60px;
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.title-text {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b35 0%, #ff3366 50%, #8a2be2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.5);
    letter-spacing: 8px;
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 107, 53, 0.9));
    }
}

.subtitle {
    font-size: 20px;
    color: #aaa;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.menu-btn {
    padding: 18px 40px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.menu-btn:hover::before {
    width: 300px;
    height: 300px;
}

.primary-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff3366 100%);
    color: #fff;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
}

.primary-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.6);
}

.secondary-btn {
    background: linear-gradient(135deg, rgba(42, 26, 62, 0.8) 0%, rgba(26, 10, 46, 0.8) 100%);
    color: #ff6b35;
    border: 2px solid #ff6b35;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.2);
}

.secondary-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 51, 102, 0.2) 100%);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
}

.back-btn {
    background: linear-gradient(135deg, rgba(42, 26, 62, 0.9) 0%, rgba(26, 10, 46, 0.9) 100%);
    color: #fff;
    border: 2px solid #ff6b35;
    margin-top: 30px;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
}

.btn-icon {
    font-size: 24px;
    position: relative;
    z-index: 1;
}

.menu-btn span {
    position: relative;
    z-index: 1;
}

.menu-footer {
    color: #666;
    font-size: 14px;
}

.version {
    margin-top: 10px;
    font-size: 12px;
}

/* Instructions Screen */
.instructions-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    background: rgba(10, 10, 30, 0.9);
    border: 3px solid #ff6b35;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.3);
}

.instructions-title {
    font-size: 48px;
    text-align: center;
    background: linear-gradient(135deg, #ff6b35 0%, #ff3366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.instruction-card {
    background: linear-gradient(135deg, rgba(42, 26, 62, 0.6) 0%, rgba(26, 10, 46, 0.6) 100%);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
}

.instruction-card:hover {
    transform: translateY(-5px);
    border-color: #ff6b35;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.card-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.instruction-card h3 {
    color: #ff6b35;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.instruction-card p {
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 8px;
    font-size: 14px;
}

.control-list p {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-list strong {
    color: #ff6b35;
}

.mobile-controls {
    display: none;
}

/* Settings Screen */
.settings-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 90%;
    padding: 40px;
    background: rgba(10, 10, 30, 0.9);
    border: 3px solid #ff6b35;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.3);
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    color: #ff6b35;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-item select,
.setting-item input[type="range"] {
    padding: 12px;
    background: rgba(42, 26, 62, 0.6);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item select:hover,
.setting-item select:focus {
    border-color: #ff6b35;
    outline: none;
}

.setting-item input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: rgba(255, 107, 53, 0.2);
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ff6b35;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff6b35;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
    border: none;
}

#speed-value {
    color: #ff6b35;
    font-weight: bold;
    text-align: center;
}

.checkbox-item {
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.checkbox-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #ff6b35;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
}

#game-container.hidden {
    display: none;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

#hud {
    background: linear-gradient(180deg, rgba(20, 10, 30, 0.95) 0%, rgba(10, 5, 15, 0.95) 100%);
    border-bottom: 3px solid #ff6b35;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    z-index: 10;
}

.player-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 300px;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-size: 16px;
    min-width: 60px;
    font-weight: bold;
}

.bar {
    position: relative;
    width: 200px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: width 0.3s ease;
}

.health-bar .bar-fill {
    background: linear-gradient(90deg, #ff3366 0%, #ff6b35 100%);
}

.mana-bar .bar-fill {
    background: linear-gradient(90deg, #3366ff 0%, #6b35ff 100%);
}

.xp-bar .bar-fill {
    background: linear-gradient(90deg, #ffaa00 0%, #ffdd00 100%);
}

.bar-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    z-index: 1;
}

.player-info {
    display: flex;
    gap: 20px;
    font-size: 18px;
}

.info-item {
    display: flex;
    gap: 8px;
}

.info-item .label {
    color: #888;
}

.equipment {
    display: flex;
    gap: 10px;
}

.equip-slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid #ff6b35;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
}

.equip-slot:hover {
    background: rgba(255, 107, 53, 0.2);
    transform: scale(1.05);
}

#gameCanvas {
    flex: 1;
    background: #000;
    cursor: none;
    image-rendering: pixelated;
}

#controls {
    background: linear-gradient(0deg, rgba(20, 10, 30, 0.95) 0%, rgba(10, 5, 15, 0.95) 100%);
    border-top: 3px solid #ff6b35;
    padding: 15px 20px;
    display: flex;
    gap: 30px;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(255, 107, 53, 0.4);
    z-index: 10;
}

.control-section h3 {
    font-size: 14px;
    color: #ff6b35;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.control-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #aaa;
}

.abilities {
    display: flex;
    gap: 15px;
}

.ability-btn {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2a1a3e 0%, #1a0a2e 100%);
    border: 3px solid #ff6b35;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
}

.ability-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a2a4e 0%, #2a1a3e 100%);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
    transform: translateY(-3px);
}

.ability-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ability-btn small {
    font-size: 9px;
    color: #888;
    margin-top: 5px;
}

#message-log {
    position: absolute;
    bottom: 120px;
    left: 20px;
    width: 400px;
    max-height: 200px;
    overflow-y: auto;
    pointer-events: none;
    z-index: 5;
}

.message {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.8);
    border-left: 4px solid #ff6b35;
    border-radius: 4px;
    font-size: 14px;
    animation: slideInLeft 0.3s ease-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.message.damage {
    border-left-color: #ff3366;
    color: #ff3366;
}

.message.heal {
    border-left-color: #00ff88;
    color: #00ff88;
}

.message.loot {
    border-left-color: #ffaa00;
    color: #ffaa00;
}

.message.info {
    border-left-color: #3366ff;
    color: #3366ff;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #2a1a3e 0%, #1a0a2e 100%);
    border: 4px solid #ff6b35;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.6);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #ff6b35;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff6b35;
}

.modal-content p {
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #ff3366;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #ff6b35;
    transform: rotate(90deg);
}

#restart-btn, #next-floor-btn {
    margin-top: 20px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff3366 100%);
    border: none;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#restart-btn:hover, #next-floor-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.8);
}

.inventory-content {
    max-width: 800px;
    width: 90%;
    position: relative;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.inventory-slot {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.inventory-slot:hover {
    background: rgba(255, 107, 53, 0.2);
    border-color: #ff6b35;
    transform: scale(1.05);
}

.inventory-slot.has-item {
    border-color: #ff6b35;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

.inventory-stats {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    text-align: left;
}

.inventory-stats h3 {
    color: #ff6b35;
    margin-bottom: 15px;
}

#stat-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 14px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 4px;
}

.victory-content {
    border-color: #00ff88;
}

.victory-content h2 {
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff3366;
}

/* Mobile Controls */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

#mobile-controls {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 120px;
    height: 120px;
    pointer-events: all;
}

#joystick-base {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3) 0%, rgba(255, 107, 53, 0.1) 100%);
    border: 3px solid rgba(255, 107, 53, 0.5);
    border-radius: 50%;
}

#joystick-stick {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.9) 0%, rgba(255, 107, 53, 0.6) 100%);
    border: 3px solid #ff6b35;
    border-radius: 50%;
    top: 35px;
    left: 35px;
    transition: all 0.1s ease-out;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

#mobile-buttons {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    pointer-events: all;
}

.mobile-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(42, 26, 62, 0.95) 0%, rgba(26, 10, 46, 0.95) 100%);
    border: 3px solid #ff6b35;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    -webkit-tap-highlight-color: transparent;
}

.mobile-btn:active {
    transform: scale(0.9);
    box-shadow: 0 0 25px rgba(255, 107, 53, 0.8);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.8) 0%, rgba(255, 51, 102, 0.8) 100%);
}

.mobile-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.attack-btn {
    grid-column: span 2;
    width: 100%;
    border-radius: 15px;
}

.interact-btn {
    position: absolute;
    top: -90px;
    right: 0;
    font-size: 24px;
    font-weight: bold;
}

.inventory-btn {
    position: absolute;
    top: -90px;
    left: 0;
    font-size: 28px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .title-text {
        font-size: 48px;
        letter-spacing: 4px;
    }
    
    .subtitle {
        font-size: 16px;
        letter-spacing: 2px;
    }
    
    .menu-content {
        padding: 20px;
    }
    
    .menu-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
    
    .btn-icon {
        font-size: 20px;
    }
    
    .instructions-content {
        padding: 20px;
        max-height: 85vh;
    }
    
    .instructions-title {
        font-size: 32px;
        margin-bottom: 25px;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .instruction-card {
        padding: 20px;
    }
    
    .card-icon {
        font-size: 36px;
    }
    
    .instruction-card h3 {
        font-size: 20px;
    }
    
    .instruction-card p {
        font-size: 13px;
    }
    
    .settings-content {
        padding: 20px;
    }
    
    #hud {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .player-stats {
        min-width: 100%;
    }
    
    .stat-bar {
        gap: 5px;
    }
    
    .stat-label {
        font-size: 14px;
        min-width: 50px;
    }
    
    .bar {
        width: 100%;
        height: 20px;
    }
    
    .player-info {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 14px;
    }
    
    .equipment {
        gap: 8px;
    }
    
    .equip-slot {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    #message-log {
        bottom: 180px;
        left: 10px;
        width: calc(100% - 20px);
        max-height: 150px;
        font-size: 12px;
    }
    
    .message {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .modal-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    #restart-btn, #next-floor-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #joystick-container {
        width: 100px;
        height: 100px;
        bottom: 20px;
        left: 20px;
    }
    
    #joystick-base {
        width: 100px;
        height: 100px;
    }
    
    #joystick-stick {
        width: 40px;
        height: 40px;
        top: 30px;
        left: 30px;
    }
    
    #mobile-buttons {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    
    .mobile-btn {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .interact-btn {
        top: -75px;
    }
    
    .inventory-btn {
        top: -75px;
    }
    
    #hud {
        padding: 8px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .bar {
        height: 18px;
    }
    
    .bar-text {
        font-size: 10px;
    }
    
    .player-info {
        font-size: 12px;
    }
    
    .equip-slot {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Landscape mobile */
@media (max-width: 900px) and (orientation: landscape) {
    #hud {
        flex-direction: row;
        padding: 8px 10px;
    }
    
    .player-stats {
        min-width: 250px;
    }
    
    .stat-bar {
        gap: 5px;
    }
    
    .bar {
        width: 150px;
        height: 18px;
    }
    
    .player-info {
        font-size: 12px;
        gap: 10px;
    }
    
    .equipment {
        gap: 5px;
    }
    
    .equip-slot {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    #joystick-container {
        width: 90px;
        height: 90px;
        bottom: 15px;
        left: 15px;
    }
    
    #joystick-base {
        width: 90px;
        height: 90px;
    }
    
    #joystick-stick {
        width: 35px;
        height: 35px;
        top: 27px;
        left: 27px;
    }
    
    #mobile-buttons {
        bottom: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .mobile-btn {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
    
    .interact-btn {
        top: -70px;
    }
    
    .inventory-btn {
        top: -70px;
    }
    
    #message-log {
        bottom: 120px;
        max-height: 100px;
    }
}
