#mobile-controls {
    position: absolute;
    bottom: 1vh;
    padding: 0 3vh;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 50;
}

#mobile-controls.active {
    display: flex;
    pointer-events: none;
}

.action-controls {
    display: flex;
    gap: 14px;
    pointer-events: auto;
    flex-direction: row-reverse;
}

.action-controls button {
    width: clamp(60px, 12vh, 80px);
    height: clamp(60px, 12vh, 80px);
    border-radius: 50%;
    font-size: clamp(16px, 4vh, 28px);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid #ffb347;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-controls span {
    font-size: clamp(16px, 2.5vh, 20px);
    line-height: 1;
}

#joystick {
    width: clamp(80px, 15vh, 120px);
    height: clamp(80px, 15vh, 120px);
    pointer-events: auto;
    display: none;
}

#joystick.active {
    display: block;
}

#joystick-base {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid #ffb347;
}

#joystick-knob {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    background: #ff7b00;
    border-radius: 50%;
    position: absolute;
    transition: transform 0.05s linear;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

#rotate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-family: 'Inter', sans-serif;
    flex-direction: column;
    pointer-events: all;
}

.rotate-content {
    animation: fadeIn 0.3s ease;
}

.rotate-icon {
    font-size: 80px;
    display: inline-block;
    animation: rotate 1.5s infinite ease-in-out;
    margin-bottom: 20px;
}

#rotate-overlay h2 {
    font-family: 'Rye', cursive;
    font-size: 28px;
    margin: 16px 0;
    color: #ffb347;
}

#rotate-overlay p {
    font-size: 18px;
    opacity: 0.9;
}

#rotate-overlay .rotate-icon img {
    width: 80px;  
    filter: brightness(0) invert(62%) sepia(98%) saturate(548%) hue-rotate(341deg) brightness(100%) contrast(96%);
}

#game-container:fullscreen,
#game-container:-webkit-full-screen,
#game-container:-moz-full-screen,
#game-container:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative;
    margin: 0;
    padding: 0;
}

#game-container:fullscreen canvas,
#game-container:-webkit-full-screen canvas,
#game-container:-moz-full-screen canvas,
#game-container:-ms-fullscreen canvas {
    width: auto !important;
    height: auto !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;  
    display: block;
}

#game-container:fullscreen #ui,
#game-container:-webkit-full-screen #ui,
#game-container:-moz-full-screen #ui,
#game-container:-ms-fullscreen #ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#game-container:fullscreen .screen,
#game-container:-webkit-full-screen .screen,
#game-container:-moz-full-screen .screen,
#game-container:-ms-fullscreen .screen {
    pointer-events: all;
}

#game-container:fullscreen .bg-img,
#game-container:-webkit-full-screen .bg-img {
    object-fit: cover;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
    100% { transform: rotate(90deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
