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

#rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.rotate-content {
    text-align: center;
    color: #00ffff;
}

.rotate-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate-hint 2s infinite ease-in-out;
}

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

.rotate-content p {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
}

.rotate-sub {
    color: #666;
    font-size: 14px !important;
    margin-top: 10px;
}

@media (orientation: portrait) and (max-width: 900px) {
    #rotate-overlay {
        display: flex;
    }
    #game-container {
        display: none;
    }
}

body {
    background: #0a0a0a;
    background-image: url('./assets/images/bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    color: #fff;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: 800 / 600;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#object-picker {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 5px;
    pointer-events: auto;
}

.object-slot {
    width: 50px;
    height: 60px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.object-slot:hover:not(.disabled) {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.object-slot.selected {
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
    background: rgba(0, 255, 255, 0.1);
}

.object-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.object-slot .icon {
    width: 30px;
    height: 30px;
    margin-bottom: 3px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
}

.object-slot .icon.ball {
    background-image: url('./assets/images/ball.png');
    filter: drop-shadow(0 0 8px #00ffff);
}

.object-slot .icon.domino {
    background-image: url('./assets/images/domino.png');
    filter: drop-shadow(0 0 8px #ff00ff);
}

.object-slot .icon.bomb {
    background-image: url('./assets/images/bomb.png');
    filter: drop-shadow(0 0 8px #ffff00);
}

.object-slot .count {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

#level-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #888;
    background: rgba(20, 20, 20, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #333;
}

#level-number {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

#hud {
    position: absolute;
    top: 20px;
    left: 300px;
    display: flex;
    gap: 6px;
    pointer-events: auto;
    align-items: center;
    height: 60px;
}

.hud-item {
    background: rgba(20, 20, 20, 0.9);
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #333;
    font-size: 11px;
    white-space: nowrap;
}

#menu-button {
    position: absolute;
    bottom: 15px;
    left: 15px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    background: transparent;
    color: #ff00ff;
    border: 2px solid #ff00ff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    z-index: 10;
}

#menu-button:hover {
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.5);
}

#start-button {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 50px;
    font-size: 20px;
    font-weight: bold;
    background: transparent;
    color: #00ffff;
    border: 3px solid #00ffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3),
                inset 0 0 20px rgba(0, 255, 255, 0.1);
}

#start-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5),
                inset 0 0 30px rgba(0, 255, 255, 0.2);
    transform: translateX(-50%) scale(1.05);
}

#start-button:active {
    transform: translateX(-50%) scale(0.98);
}

#start-button.hidden {
    display: none;
}

#restart-button {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 10px 25px;
    font-size: 14px;
    font-weight: bold;
    background: transparent;
    color: #ff6600;
    border: 2px solid #ff6600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

#restart-button:hover {
    background: rgba(255, 102, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
}

#restart-button.hidden {
    display: none;
}

#bonus-ad-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(100px);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b00, #ffaa00);
    color: #000;
    border: 2px solid #ffcc00;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: rewardPulse 2s ease-in-out infinite;
    z-index: 10;
}

#bonus-ad-button:hover {
    background: linear-gradient(135deg, #ff8800, #ffcc00);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
    transform: translateX(100px) scale(1.1);
}

#bonus-ad-button.hidden {
    display: none;
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.95);
    padding: 50px 80px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    border: 3px solid #333;
}

.modal.hidden {
    display: none;
}

#win-screen {
    border-color: #00ff00;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.3);
}

#win-screen h1 {
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
    font-size: 36px;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

#lose-screen {
    border-color: #ff0000;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
}

#lose-screen h1 {
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    font-size: 36px;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

#next-level-button,
#retry-button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: transparent;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#next-level-button {
    color: #00ff00;
    border-color: #00ff00;
}

#next-level-button:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

#retry-button {
    color: #ff6600;
    border-color: #ff6600;
}

#retry-button:hover {
    background: rgba(255, 102, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.instructions {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 14px;
    text-align: center;
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px currentColor; }
    50% { box-shadow: 0 0 25px currentColor; }
}

/* ============================================
   TUTORIAL & WELCOME SCREEN STYLES
   ============================================ */

/* Welcome Screen */
#welcome-screen {
    border-color: #00ffff;
    box-shadow: 0 0 60px rgba(0, 255, 255, 0.4);
    padding: 40px 60px;
    max-width: 500px;
}

#welcome-screen h1 {
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    font-size: 32px;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.welcome-subtitle {
    color: #888;
    font-size: 16px;
    margin-bottom: 30px;
}

.how-to-play {
    text-align: left;
    margin: 30px 0;
}

.how-to-play .step {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.step-number {
    width: 30px;
    height: 30px;
    background: #00ffff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.step-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-icon.ball-icon {
    width: 24px;
    height: 24px;
    background: #00ffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffff;
}

.step-icon.place-icon {
    color: #00ffff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px #00ffff;
}

.step-icon.start-icon {
    color: #00ff00;
    font-size: 20px;
    text-shadow: 0 0 10px #00ff00;
}

.step-text {
    color: #ccc;
    font-size: 14px;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.primary-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: #00ffff;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.primary-btn:hover {
    background: #00cccc;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    transform: scale(1.02);
}

.reward-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b00, #ffaa00);
    color: #000;
    border: 2px solid #ffcc00;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: rewardPulse 2s ease-in-out infinite;
}

.reward-btn:hover {
    background: linear-gradient(135deg, #ff8800, #ffcc00);
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.6);
    transform: scale(1.05);
}

.reward-btn.hidden {
    display: none;
}

@keyframes rewardPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 170, 0, 0.6); }
}

.secondary-btn {
    padding: 10px 30px;
    font-size: 14px;
    background: transparent;
    color: #666;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    color: #888;
    border-color: #666;
}

/* Tutorial Highlight Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 1), 0 0 60px rgba(0, 255, 255, 0.5);
        transform: scale(1.1);
    }
}

.tutorial-highlight {
    animation: pulse-glow 1.2s infinite ease-in-out !important;
    position: relative;
    z-index: 100;
}

/* Tutorial Message */
.tutorial-message {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ffff;
    padding: 15px 30px;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.tutorial-message.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tutorial-icon {
    font-size: 24px;
}

.tutorial-text {
    color: #00ffff;
}

/* Tutorial Arrow */
.tutorial-arrow {
    position: fixed;
    font-size: 40px;
    z-index: 999;
    pointer-events: none;
    animation: bounce-arrow 0.8s infinite ease-in-out;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
}

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

/* Inactivity Hint */
.inactivity-hint {
    position: fixed;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid rgba(0, 255, 255, 0.5);
    padding: 12px 25px;
    border-radius: 25px;
    color: #00ffff;
    font-size: 16px;
    z-index: 400;
    animation: hint-pulse 2s infinite;
}

.inactivity-hint.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes hint-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    }
}

/* ============================================
   STAR RATING & WIN SCREEN
   ============================================ */

.star-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.star-display .star {
    font-size: 50px;
    color: #333;
    text-shadow: none;
    transition: all 0.3s ease;
}

.star-display .star.earned {
    color: #FFD700;
    text-shadow: 0 0 20px #FFD700, 0 0 40px #FFA500;
    animation: star-pop 0.5s ease;
}

@keyframes star-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.level-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0 25px 0;
    color: #888;
    font-size: 14px;
}

.stat {
    display: flex;
    gap: 8px;
}

.stat-label {
    color: #666;
}

.stat span:last-child {
    color: #00ffff;
    font-weight: bold;
}

.win-buttons, .lose-buttons, .pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.lose-hint {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
}

.shop-section {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-section.hidden {
    display: none;
}

.shop-divider {
    height: 1px;
    background: #333;
    margin: 5px 0;
}

.shop-btn {
    padding: 10px 20px;
    font-size: 13px;
    background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
    color: #ffcc00;
    border: 1px solid #ffcc00;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-btn:hover {
    background: linear-gradient(135deg, #2a2a5e, #3a3a7e);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

/* ============================================
   LEVEL SELECT SCREEN
   ============================================ */

#level-select-screen {
    border-color: #00ffff;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
    padding: 30px 40px;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

#level-select-screen h1 {
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff;
    font-size: 28px;
    margin-bottom: 20px;
}

.progress-bar-container {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #00ff00);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px #00ffff;
}

.progress-text {
    font-size: 12px;
    color: #666;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.level-btn {
    width: 55px;
    height: 65px;
    background: rgba(30, 30, 30, 0.9);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.level-btn:hover:not(.locked) {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.level-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.level-btn.locked::after {
    content: '🔒';
    position: absolute;
    font-size: 16px;
}

.level-btn.completed {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.level-btn .level-num {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.level-btn.locked .level-num {
    visibility: hidden;
}

.level-btn .level-stars {
    display: flex;
    gap: 2px;
    font-size: 10px;
}

.level-btn .level-stars .star {
    color: #333;
}

.level-btn .level-stars .star.earned {
    color: #FFD700;
}

.total-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 18px;
    color: #FFD700;
}

.total-stars .star-icon {
    font-size: 24px;
    text-shadow: 0 0 10px #FFD700;
}

/* ============================================
   PAUSE MENU
   ============================================ */

#pause-menu {
    border-color: #ff6600;
    box-shadow: 0 0 50px rgba(255, 102, 0, 0.3);
}

#pause-menu h1 {
    color: #ff6600;
    text-shadow: 0 0 15px #ff6600;
    font-size: 32px;
    margin-bottom: 30px;
}

/* ============================================
   NEW OBJECT ICONS
   ============================================ */

.object-slot .icon.cannon {
    background-image: url('./assets/images/cannon.png');
    filter: drop-shadow(0 0 8px #9900ff);
}

.object-slot .icon.ramp {
    background-image: url('./assets/images/ramp.png');
    filter: drop-shadow(0 0 8px #00ff88);
}

/* ============================================
   GRAVITY ROTATION HUD (UNIQUE MECHANIC)
   ============================================ */

.gravity-hud {
    background: rgba(0, 30, 40, 0.95) !important;
    border: 2px solid #00ffff !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    padding: 5px 10px !important;
    border-radius: 6px !important;
    position: relative;
    animation: gravity-glow 2s infinite ease-in-out;
}

@keyframes gravity-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    }
}

#gravity-arrow {
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

#gravity-count {
    transition: color 0.2s ease;
}

/* Combo Text Animation */
@keyframes combo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Slow Motion Overlay Effect */
.slow-motion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 100, 150, 0.15) 100%);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.slow-motion-overlay.active {
    opacity: 1;
}

/* Gravity Tutorial Hint */
.gravity-tutorial-hint {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 50, 70, 0.95), rgba(0, 30, 50, 0.95));
    border: 2px solid #00ffff;
    padding: 15px 25px;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    animation: hint-slide-in 0.5s ease-out;
}

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

.gravity-tutorial-hint .key-hint {
    display: inline-flex;
    gap: 5px;
}

.gravity-tutorial-hint .key {
    display: inline-block;
    background: #00ffff;
    color: #000;
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 0 #008888;
}

/* Flash effect on gravity rotation */
@keyframes gravity-flash {
    0% { opacity: 0.4; }
    100% { opacity: 0; }
}

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 200, 0, 0.95), rgba(255, 150, 0, 0.95));
    border: 2px solid #FFD700;
    padding: 15px 25px;
    border-radius: 10px;
    color: #000;
    font-weight: bold;
    font-size: 16px;
    z-index: 600;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: achievement-slide-in 0.5s ease-out, achievement-slide-out 0.5s ease-in 2.5s forwards;
}

@keyframes achievement-slide-in {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes achievement-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

/* ============================================
   MOBILE LANDSCAPE RESPONSIVE
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    #object-picker {
        top: 5px;
        left: 5px;
        gap: 3px;
    }

    .object-slot {
        width: 36px;
        height: 44px;
        border-radius: 5px;
        border-width: 1px;
    }

    .object-slot .icon {
        width: 22px;
        height: 22px;
        margin-bottom: 1px;
    }

    .object-slot .count {
        font-size: 10px;
    }

    #hud {
        top: 5px;
        left: 200px;
        gap: 4px;
        height: 44px;
    }

    .hud-item {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
    }

    .gravity-hud {
        padding: 3px 6px !important;
        border-radius: 4px !important;
        border-width: 1px !important;
        box-shadow: none !important;
        animation: none !important;
        background: rgba(20, 20, 20, 0.9) !important;
        border-color: #333 !important;
    }

    /* Hide [Q/E] hint on mobile */
    .gravity-hud > span:last-child {
        display: none !important;
    }

    #gravity-arrow {
        font-size: 12px !important;
        margin-left: 2px !important;
    }

    #level-display {
        top: 5px;
        right: 5px;
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 5px;
    }

    #menu-button {
        bottom: 5px;
        left: 5px;
        padding: 5px 10px;
        font-size: 10px;
        letter-spacing: 1px;
    }

    #start-button {
        bottom: 5px;
        padding: 8px 30px;
        font-size: 14px;
        letter-spacing: 2px;
        border-width: 2px;
    }

    #restart-button {
        bottom: 5px;
        right: 5px;
        padding: 5px 12px;
        font-size: 11px;
    }

    /* Modals smaller on mobile */
    .modal {
        padding: 20px 30px;
        border-radius: 10px;
    }

    #welcome-screen {
        padding: 15px 25px;
        max-width: 90vw;
    }

    #welcome-screen h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .welcome-subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .how-to-play {
        margin: 10px 0;
    }

    .how-to-play .step {
        margin-bottom: 8px;
        padding: 6px;
        gap: 8px;
    }

    .step-number {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .step-text {
        font-size: 11px;
    }

    .welcome-buttons {
        margin-top: 10px;
        gap: 6px;
    }

    .primary-btn {
        padding: 8px 20px;
        font-size: 14px;
    }

    .secondary-btn {
        padding: 6px 15px;
        font-size: 11px;
    }

    /* Win/Lose screens */
    #win-screen h1,
    #lose-screen h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .star-display .star {
        font-size: 30px;
    }

    .star-display {
        gap: 8px;
        margin: 10px 0;
    }

    .level-stats {
        margin: 8px 0 12px 0;
        font-size: 12px;
    }

    /* Level select */
    #level-select-screen {
        padding: 15px 20px;
        max-width: 85vw;
        max-height: 85vh;
    }

    #level-select-screen h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .level-btn {
        width: 40px;
        height: 48px;
    }

    .level-btn .level-num {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .level-btn .level-stars {
        font-size: 8px;
    }

    /* Pause menu */
    #pause-menu h1 {
        font-size: 22px;
        margin-bottom: 15px;
    }
}
