        :root { --ui-color: #888888; --ui-shadow: #666666; --bg-color: #1a1a1a; --glass-bg: rgba(255,255,255,0.03); --glass-border: rgba(255,255,255,0.08); --glass-highlight: rgba(255,255,255,0.12); }
        * { box-sizing: border-box; }
        body { margin: 0; overflow: hidden; background-color: var(--bg-color); font-family: 'Segoe UI', system-ui, sans-serif; color: white; user-select: none; touch-action: none; }
        canvas { display: block; }
        
        /* Glass morphism base */
        .glass { background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 16px; }
        .glass-btn { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 12px; color: rgba(255,255,255,0.8); padding: 14px 28px; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); letter-spacing: 0.5px; }
        .glass-btn:hover { background: var(--glass-highlight); border-color: rgba(255,255,255,0.2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
        .glass-btn:active { transform: translateY(0); }
        .glass-input { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 10px; color: white; padding: 12px 16px; font-family: inherit; font-size: 16px; outline: none; transition: all 0.3s; }
        .glass-input:focus { border-color: var(--ui-color); box-shadow: 0 0 20px rgba(136,136,136,0.2); }
        
        /* Old container removed */
        #global-ui { display: none; } 
        
        /* 3D Button - Bottom Left */
        #toggle-3d-btn { position: absolute; bottom: 20px; left: 20px; z-index: 600; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 50%; color: white; font-size: 14px; width: 44px; height: 44px; cursor: pointer; display: flex; justify-content: center; align-items: center; opacity: 0.7; transition: all 0.3s; font-weight: bold; }
@media (max-width: 768px) { #toggle-3d-btn, #mouse-3d-btn { display: none !important; } }
        #toggle-3d-btn:hover { opacity: 1; transform: scale(1.1); }
        #toggle-3d-btn.active { background: rgba(100, 200, 255, 0.2); border-color: rgba(100, 200, 255, 0.5); color: #6bcfff; }
        
        #mouse-3d-btn { position: absolute; bottom: 20px; left: 70px; z-index: 600; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 50%; color: white; font-size: 16px; width: 44px; height: 44px; cursor: pointer; display: none; justify-content: center; align-items: center; opacity: 0.7; transition: all 0.3s; }
        #mouse-3d-btn:hover { opacity: 1; transform: scale(1.1); }
        #mouse-3d-btn.active { background: rgba(100, 200, 255, 0.2); border-color: rgba(100, 200, 255, 0.5); color: #6bcfff; }

        /* Pause Button - Top Left */
        #home-btn { position: absolute; top: 20px; left: 20px; z-index: 3000; pointer-events: auto; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 50%; color: white; font-size: 18px; width: 44px; height: 44px; cursor: pointer; display: none; justify-content: center; align-items: center; opacity: 0.7; transition: all 0.3s; }
        #home-btn:hover { opacity: 1; color: #ff6b6b; }
        #sandbox-back-btn:hover { opacity: 1; }
        
        #ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
        /* Timer at Top */
        .top-center-hud { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; pointer-events: none; z-index: 10; }
        .hud-stat { font-size: 32px; font-weight: 300; color: white; letter-spacing: 4px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); font-family: 'SF Mono', 'Fira Code', monospace; }

        /* Loot at Bottom */
        .bottom-center-hud { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; pointer-events: none; z-index: 10; }
@media (max-width: 768px) { 
    .bottom-center-hud { left: auto; right: 20px; bottom: 100px; transform: none; } 
    #item-bar { flex-wrap: wrap; justify-content: center; max-width: 370px; }
}
        .sub-stat-container { display: flex; gap: 16px; background: rgba(0,0,0,0.2); padding: 8px 16px; border-radius: 20px; backdrop-filter: blur(4px); }
        .sub-stat { font-size: 14px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: rgba(0,0,0,0.3); border-radius: 20px; }
        #item-bar { display: flex; flex-wrap: nowrap; position: fixed; z-index: 50; background: rgba(255,255,255,0.06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 14px; padding: 6px; border: 1px solid rgba(255,255,255,0.1); bottom: 12px; left: 50%; transform: translateX(-50%); gap: 4px; pointer-events: auto; }
        .item-slot { width: 56px; height: 56px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; position: relative; user-select: none; backdrop-filter: blur(4px); }
        .item-slot:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
        .item-slot.selected { border-color: #fff; background: rgba(255,255,255,0.18); box-shadow: 0 0 16px rgba(255,255,255,0.25), inset 0 0 12px rgba(255,255,255,0.05); transform: translateY(-3px); }
        .item-slot .item-icon { font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }
        .item-slot .item-count { font-size: 9px; color: rgba(255,255,255,0.8); position: absolute; bottom: 2px; right: 5px; font-weight: 600; }
        .item-slot .item-key { font-size: 8px; color: rgba(255,255,255,0.35); position: absolute; top: 2px; left: 5px; }
        .item-slot.dragging { opacity: 0.4; border-color: rgba(255,255,255,0.3); }
        .item-slot.drag-over { border-color: #ffd700; background: rgba(255,215,0,0.15); }

        .top-right-hud { position: absolute; top: 20px; right: 20px; text-align: right; }
        .best-score-label { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }
        .best-score-val { font-size: 16px; color: var(--ui-color); font-weight: 500; }
        
        /* Hunter tracker - Dropped down to bottom right */
#hunter-tracker { display: none !important; }
        .hunter-count { font-size: 14px; color: #ff6b6b; background: rgba(255,50,50,0.2); padding: 8px 16px; border-radius: 20px; border: 1px solid rgba(255,50,50,0.3); display: flex; align-items: center; gap: 8px; }
        .hunter-count-num { font-weight: bold; font-size: 18px; }
        
        /* Off-screen hunter arrows */
        .hunter-arrow { position: absolute; font-size: 24px; color: #ff6b6b; text-shadow: 0 0 10px rgba(255,50,50,0.8); pointer-events: none; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 2px; }
        .hunter-arrow-dist { font-size: 10px; background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 4px; }

        /* Finish Line Hint Arrow */
.finish-arrow { position: absolute; font-size: 24px; color: gold; text-shadow: 0 0 10px rgba(255,215,0,0.8); pointer-events: none; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.finish-arrow-dist { font-size: 10px; background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 4px; color: gold; }
.toggle-switch input:checked + span { background: var(--ui-color, #4ecdc4) !important; }
.toggle-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + span::before { transform: translateX(18px); }
        
        #mp-scoreboard { display: none; margin-top: 12px; }
.top-right-hud { position: absolute; top: 20px; right: 20px; text-align: right; z-index: 100; }
        .score-row { font-size: 13px; color: rgba(255,255,255,0.6); margin: 2px 0; }

#host-paused-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px) grayscale(100%);
    -webkit-backdrop-filter: blur(8px) grayscale(100%);
    z-index: 500;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.host-paused-content { text-align: center; }
#host-paused-name { font-size: 28px; color: white; font-weight: 600; letter-spacing: 2px; margin-bottom: 8px; }
.host-paused-text { font-size: 18px; color: rgba(255,255,255,0.8); margin-bottom: 16px; }
.host-paused-subtext { font-size: 12px; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
.host-away-indicator { display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
        #mp-room-code { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 8px; letter-spacing: 2px; }
        
        /* Changed background to semi-transparent black for dimming */
/* Added backdrop-filter for Blur and Black & White effect */
#start-screen { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(8px) grayscale(100%); 
    -webkit-backdrop-filter: blur(8px) grayscale(100%); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 300; 
    overflow-y: auto; 
    padding: 20px; 
}
/* New Grid Layout for Pause Menu */
#pause-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
    gap: 12px;
    width: 100%;
    max-width: 450px; /* Limits width so buttons aren't huge */
    margin-bottom: 20px;
}

#pause-menu-grid .glass-btn {
    width: 100%;
    margin: 0; /* Remove old margins */
    padding: 16px 8px; /* Taller touch targets */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Specific styling for the centered Login row */
.login-row {
    grid-column: 1 / -1; /* Spans all 3 columns */
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.login-btn {
    width: 50% !important; /* Half width for visual balance */
    border-color: rgba(100, 255, 100, 0.3) !important;
    color: #aaffaa !important;
}
@media (max-width: 768px) { #start-screen { padding: 10px; justify-content: center; align-items: center; padding-top: 0; } }
        #start-screen h1 { font-size: 48px; font-weight: 200; color: white; margin: 0 0 8px 0; letter-spacing: 12px; text-transform: uppercase; }
@media (max-width: 768px) { #start-screen h1 { font-size: 32px; letter-spacing: 6px; } }
        #start-screen .subtitle { font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 4px; margin-bottom: 40px; }
        
        .main-menu-btn { width: 220px; margin: 8px; text-transform: uppercase; letter-spacing: 2px; }
@media (max-width: 768px) { .main-menu-btn { width: 90%; max-width: 300px; padding: 16px 20px; font-size: 16px; } }
        
        #mp-setup-section { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0b0b0b; z-index: 400; overflow: hidden; }
.mp-split { display: flex; width: 100%; height: 100%; padding-top: 70px; }
.mp-sidebar { flex: 0 0 350px; max-width: 400px; margin: 20px; padding: 30px; display: flex; flex-direction: column; gap: 20px; background: rgba(255,255,255,0.03); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; max-height: calc(100vh - 130px); overflow-y: auto; }
.mp-gif-area { flex: 1; padding: 20px; overflow-y: auto; max-height: calc(100vh - 90px); }
.mp-sidebar .glass-btn { width: 100%; padding: 18px 24px; font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.mp-name-input { width: 100%; text-align: center; font-size: 24px; text-transform: uppercase; letter-spacing: 3px; padding: 16px; border-radius: 16px; background: rgba(0,0,0,0.4); border: 2px solid rgba(255,255,255,0.1); font-weight: 600; color: white; }
.mp-name-input:focus { border-color: rgba(100,200,255,0.5); box-shadow: 0 0 30px rgba(100,200,255,0.2); outline: none; }
.mp-section-label { color: rgba(255,255,255,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
@media (max-width: 768px) {
    .mp-split { flex-direction: column; padding-top: 60px; }
    .mp-sidebar { flex: none; max-width: none; margin: 10px; max-height: 40vh; }
    .mp-gif-area { flex: 1; max-height: 50vh; }
}
@media (max-width: 768px) { #mp-setup-section { padding: 10px; max-width: 95%; } }
        
        #profile-section { padding: 30px; margin-bottom: 30px; text-align: center; width: 100%; max-width: 500px; background: rgba(255,255,255,0.03); border-radius: 24px; border: 1px solid rgba(255,255,255,0.08); }
#profile-section h3 { font-size: 14px; margin-bottom: 20px; }
@media (max-width: 768px) { #profile-section { padding: 16px; margin-bottom: 16px; width: 95%; } }
        #profile-section h3 { margin: 0 0 16px 0; color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; }
        #player-name-input { width: 100%; text-align: center; margin-bottom: 20px; font-size: 28px; text-transform: uppercase; letter-spacing: 4px; padding: 20px; border-radius: 16px; background: rgba(0,0,0,0.4); border: 2px solid rgba(255,255,255,0.1); font-weight: 600; }
#player-name-input:focus { border-color: rgba(100,200,255,0.5); box-shadow: 0 0 30px rgba(100,200,255,0.2); }
        #custom-emoji-input { width: 64px; height: 64px; font-size: 32px; text-align: center; border-radius: 16px; overflow: visible; line-height: 64px; padding: 0; }
        
        #gif-selector { display: none; }
#gif-search-input { width: 100%; padding: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white; font-family: inherit; font-size: 14px; margin-bottom: 16px; }
#gif-search-input:focus { outline: none; border-color: var(--ui-color); }
#gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 16px; min-height: 200px; }
.gif-option { width: 100%; height: 100px; cursor: pointer; border: 2px solid rgba(255,255,255,0.1); border-radius: 8px; transition: all 0.3s; object-fit: cover; position: relative; }
.gif-option:hover { border-color: var(--ui-color); transform: scale(1.05); }
.gif-option.selected { border-color: #ffd700; box-shadow: 0 0 20px rgba(255,215,0,0.5); }
.favorite-btn { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); border: none; color: white; font-size: 16px; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }
.favorite-btn:hover { background: rgba(0,0,0,0.9); transform: scale(1.2); }
.gif-container { position: relative; }
#favorites-section { margin-bottom: 16px; }
#favorites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 8px; }
.section-title { color: rgba(255,255,255,0.5); font-size: 11px; margin: 12px 0 8px 0; text-transform: uppercase; letter-spacing: 1px; }
#themes-btn { position: absolute; top: 20px; right: 20px; padding: 10px 16px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; z-index: 405; }
        
        #theme-menu { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); backdrop-filter: blur(20px); z-index: 500; flex-direction: column; align-items: center; padding: 40px 20px; overflow-y: auto; }
        .theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; width: 100%; max-width: 700px; }
        .theme-card { padding: 12px; cursor: pointer; text-align: center; transition: all 0.3s; }
        .theme-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
        .theme-card.selected { border-color: var(--ui-color); box-shadow: 0 0 30px rgba(136,136,136,0.3); }
        .theme-preview { height: 28px; width: 100%; margin-top: 8px; display: flex; border-radius: 6px; overflow: hidden; }
        .preview-swatch { flex: 1; }
        #close-themes-btn { position: absolute; top: 20px; right: 20px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 28px; cursor: pointer; transition: all 0.3s; }
        #close-themes-btn:hover { color: white; transform: rotate(90deg); }
        
        #custom-theme-section { width: 100%; max-width: 500px; padding: 20px; margin: 20px 0; }
        #custom-theme-section h3 { margin: 0 0 16px 0; color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; }
        .color-row { display: flex; align-items: center; margin: 10px 0; gap: 12px; }
        .color-row label { flex: 1; color: rgba(255,255,255,0.5); font-size: 12px; }
        .color-row input[type="color"] { width: 48px; height: 32px; border: 1px solid var(--glass-border); border-radius: 8px; background: transparent; cursor: pointer; }
        .color-section-title { color: rgba(255,255,255,0.3); font-size: 10px; margin: 20px 0 8px 0; text-transform: uppercase; letter-spacing: 2px; }
        #save-custom-theme { width: 100%; margin-top: 20px; }
        
        .mp-controls { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; width: 100%; max-width: 500px; }
.mp-controls .glass-btn { width: 100%; padding: 24px 30px; font-size: 18px; font-weight: 600; letter-spacing: 2px; border-radius: 16px; }
        
        #mp-status-area { margin-top: 20px; font-size: 13px; color: rgba(255,255,255,0.5); min-height: 20px; text-align: center; }
        #join-input-container { display: none; margin-top: 20px; flex-direction: column; align-items: center; gap: 16px; }
        #join-code-input { width: 140px; text-align: center; font-size: 24px; letter-spacing: 8px; text-transform: uppercase; }
        #room-code-display { font-size: 36px; color: white; margin: 16px 0; letter-spacing: 8px; display: none; font-weight: 300; }
        
        #player-count-section { display: none; flex-direction: column; align-items: center; margin: 20px 0; }
        #player-count-section label { color: rgba(255,255,255,0.4); font-size: 11px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
        .player-count-btns { display: flex; gap: 8px; }
        .count-btn { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; font-weight: 500; }
        .count-btn.selected { background: rgba(100,255,100,0.15); border-color: rgba(100,255,100,0.4); color: #7fff7f; }
        
        #matchmaking-section { display: none; flex-direction: column; align-items: center; margin-top: 20px; }
        #stranger-count-btns { display: flex; gap: 8px; margin-top: 12px; }
        
        #waiting-room { display: none; flex-direction: column; align-items: center; margin-top: 20px; width: 100%; }
        #waiting-room-title { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 16px; }
        #player-list { width: 100%; }
        .player-slot { color: rgba(255,255,255,0.3); margin: 8px 0; padding: 12px 16px; border-radius: 10px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); transition: all 0.3s; display: flex; align-items: center; gap: 12px; }
        .player-slot.filled { color: rgba(255,255,255,0.8); background: rgba(100,255,100,0.05); border-color: rgba(100,255,100,0.2); }
        .player-slot-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 12px; }
        .player-slot.filled .player-slot-num { background: rgba(100,255,100,0.2); }
        
        /* Player left notification */
        #player-left-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255,100,100,0.9); backdrop-filter: blur(10px); padding: 20px 40px; border-radius: 16px; font-size: 16px; z-index: 1000; display: none; animation: toastIn 0.3s ease; }
        @keyframes toastIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
        
        #chat-container { position: absolute; bottom: 70px; left: 20px; width: 280px; max-height: 220px; z-index: 100; display: none; flex-direction: column; pointer-events: auto; }
#chat-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
        #chat-messages { padding: 12px; max-height: 160px; overflow-y: auto; font-size: 12px; border-radius: 12px 12px 0 0; }
        .chat-msg { margin: 4px 0; word-wrap: break-word; line-height: 1.4; }
        .chat-msg .sender { color: var(--ui-color); font-weight: 500; }
        .chat-msg.system { color: rgba(255,255,255,0.4); font-style: italic; }
        #chat-input-container { display: flex; }
        #chat-input { flex: 1; border-radius: 0 0 0 12px; border-top: none; }
        #chat-send { background: var(--glass-highlight); border: 1px solid var(--glass-border); border-left: none; border-radius: 0 0 12px 0; color: white; padding: 10px 16px; cursor: pointer; }
        #chat-toggle { position: absolute; bottom: 20px; left: 70px; z-index: 100; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 50%; color: white; font-size: 16px; width: 44px; height: 44px; padding: 0; cursor: pointer; display: none; justify-content: center; align-items: center; opacity: 0.7; transition: all 0.3s; pointer-events: auto; }
        #chat-toggle:hover { opacity: 1; transform: scale(1.1); }
        

        /* Liquid Glass Look - Positioned above the bottom HUD */
        #notification {
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%); 
            font-size: 14px; 
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: white; 
            
            /* Liquid Glass Effect */
            background: rgba(20, 20, 20, 0.4); 
            backdrop-filter: blur(16px) saturate(180%);
            -webkit-backdrop-filter: blur(16px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
            
            padding: 12px 30px; 
            border-radius: 50px; 
            opacity: 0; 
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            pointer-events: none; 
            z-index: 20; 
            white-space: nowrap;
        }
        #status-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 150; pointer-events: none; opacity: 0.3; }
        #blind-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 80; pointer-events: none; }
        
        #sniper-overlay { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 200; cursor: crosshair; pointer-events: auto; background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.3) 100%); }
        #sniper-timer { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); font-size: 48px; color: #ff6b6b; text-shadow: 0 0 20px rgba(255,100,100,0.8); font-weight: 200; }
        #sniper-instructions { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); font-size: 14px; color: rgba(255,255,255,0.7); background: rgba(0,0,0,0.6); padding: 12px 24px; border-radius: 30px; }
        #sniper-scope { position: absolute; width: 200px; height: 200px; border: 2px solid rgba(255,100,100,0.3); border-radius: 50%; pointer-events: none; transition: left 0.05s, top 0.05s; }
        #sniper-scope::before, #sniper-scope::after { content: ''; position: absolute; background: rgba(255,100,100,0.5); }
        #sniper-scope::before { width: 1px; height: 100%; left: 50%; }
        #sniper-scope::after { width: 100%; height: 1px; top: 50%; }
        
        #game-over-screen { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; flex-direction: column; justify-content: center; align-items: center; z-index: 200; backdrop-filter: blur(10px); }
        #game-over-screen h1 { font-size: 64px; font-weight: 200; margin: 0; text-shadow: 0 4px 30px rgba(0,0,0,0.5); letter-spacing: 8px; }
        #game-over-screen p { font-size: 16px; color: rgba(255,255,255,0.7); margin-top: 16px; text-align: center; white-space: pre-line; }
        #rematch-timer { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 20px; }
        
        #mobile-controls { position: absolute; bottom: 20px; right: 20px; display: none; gap: 12px; z-index: 100; pointer-events: auto; }
        .mobile-btn { width: 64px; height: 64px; border-radius: 50%; font-size: 24px; display: flex; justify-content: center; align-items: center; }
        
        #joystick-knob { position: absolute; width: 50px; height: 50px; background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; display: none; z-index: 90; }
        #joystick-base { position: absolute; width: 120px; height: 120px; border: 2px solid rgba(255,255,255,0.1); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; display: none; z-index: 89; background: rgba(0,0,0,0.2); }
        
        #boot-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; }
        #boot-text { font-size: 18px; color: #fff; margin-bottom: 20px; letter-spacing: 4px; font-weight: 300; }
        #boot-sub { font-size: 11px; color: #444; }
        
        .back-btn { background: none; border: none; color: rgba(255,255,255,0.3); font-size: 12px; font-family: inherit; margin-top: 24px; cursor: pointer; transition: all 0.3s; }
        .back-btn:hover { color: white; }
        
        .controls-help { position: absolute; bottom: 20px; right: 20px; font-size: 10px; color: rgba(255,255,255,0.2); text-align: right; pointer-events: none; line-height: 1.6; display: none; }
/* Removed to keep instructions in pause menu only */
        
        #pc-instructions { margin-top: 30px; color: rgba(255,255,255,0.2); font-size: 11px; letter-spacing: 1px; display: none; }
@media (min-width: 768px) { #pc-instructions { display: block; } }
        
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .pulse { animation: pulse 2s infinite; }
        
        /* 3D Canvas */
        #three-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; z-index: 4; }
        #gameCanvas { z-index: 5; position: relative; }
        
        /* 3D mode indicator */
        #view-mode-indicator { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); font-size: 12px; color: rgba(255,255,255,0.5); background: rgba(0,0,0,0.5); padding: 6px 16px; border-radius: 20px; z-index: 100; display: none; pointer-events: none; }
        
        /* Skin tone picker */
        .skin-tone-picker { display: flex; gap: 4px; }
        .skin-tone { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
        .skin-tone:hover { transform: scale(1.15); }
        .skin-tone.selected { border-color: white; box-shadow: 0 0 10px rgba(255,255,255,0.5); }
        
        /* Hex input */
        .hex-input { width: 70px; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 6px; color: white; padding: 4px 8px; font-family: 'SF Mono', monospace; font-size: 11px; text-transform: uppercase; margin-left: 8px; }
        .hex-input:focus { outline: none; border-color: var(--ui-color); }
        
        /* 3D crosshair */
        #crosshair-3d { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; pointer-events: none; z-index: 100; display: none; }
        #crosshair-3d::before, #crosshair-3d::after { content: ''; position: absolute; background: rgba(255,255,255,0.5); }
        #crosshair-3d::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
        #crosshair-3d::after { width: 100%; height: 2px; top: 50%; transform: translateY(-50%); }

        /* FULL SCREEN MENU LAYOUTS */
.fs-menu { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0b0b0b; z-index: 2000; overflow: hidden; }
.fs-menu-header { position: absolute; top: 0; left: 0; width: 100%; padding: 30px; display: flex; align-items: center; z-index: 10; pointer-events: none; }
.fs-back-btn { pointer-events: auto; background: none; border: none; color: white; font-size: 32px; cursor: pointer; opacity: 0.7; transition: transform 0.2s; }
.fs-back-btn:hover { transform: translateX(-5px); opacity: 1; }
.fs-title { flex: 1; text-align: center; font-size: 14px; letter-spacing: 4px; color: rgba(255,255,255,0.4); text-transform: uppercase; }

/* LORE SCREEN STYLES */
        #lore-screen { 
            position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
            background: #000; z-index: 1900; 
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            padding: 40px;
        }
        .lore-content { max-width: 600px; width: 100%; animation: fadeIn 2s ease; }
        .lore-title { 
            font-size: 32px; letter-spacing: 8px; color: gold; margin-bottom: 40px; 
            text-align: center; text-transform: uppercase; font-weight: 200;
            border-bottom: 1px solid rgba(255,215,0,0.3); padding-bottom: 20px;
        }
        .lore-dialogue p { 
            font-size: 16px; line-height: 1.6; color: #ccc; margin-bottom: 20px; 
            background: rgba(255,255,255,0.05); padding: 15px; border-left: 2px solid #444;
        }
        .lore-name { color: #6bcfff; font-weight: bold; letter-spacing: 1px; margin-right: 10px; text-transform: uppercase; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* CHARACTER MENU SPLIT LAYOUT */
.char-split { display: flex; width: 100%; min-height: 100%; padding-top: 80px; }
.char-controls { flex: 0 0 400px; max-width: 450px; margin: 20px; padding: 30px; padding-bottom: 100px; display: flex; flex-direction: column; gap: 30px; overflow-y: auto; max-height: calc(100vh - 120px); background: rgba(255,255,255,0.03); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; position: relative; }
.char-preview-container { flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0f 70%); position: relative; min-height: 500px; min-width: 300px; }
#char-preview-canvas { display: block; width: 100%; height: 100%; min-height: 500px; }

/* Desktop: Sticky preview on the right */
@media (min-width: 769px) {
    .char-preview-container { position: sticky; top: 0; height: 100vh; }
}

/* Mobile: Stack vertical */
@media (max-width: 768px) {
    .char-split { flex-direction: column; padding-top: 60px; overflow-y: auto; height: 100%; }
    .char-preview-container { height: 220px; min-height: 220px; width: 100%; padding-top: 0; flex-shrink: 0; background: #0d0d12; position: sticky; top: 60px; z-index: 5; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .char-preview-container #char-preview-canvas { display: block !important; width: 100% !important; height: 100% !important; }
    .char-preview-container #see-original-btn { display: none; }
    .char-controls { flex: 1; width: calc(100% - 16px); max-width: none; margin: 8px; padding: 16px; padding-bottom: 100px; max-height: none; border-radius: 16px; overflow-y: auto; }
    .char-controls .shop-item { padding: 14px 16px; min-height: 56px; }
    .char-controls .shop-item-icon { width: 44px; height: 44px; font-size: 20px; }
    .char-controls .color-picker-mini { width: 44px !important; height: 44px !important; min-width: 44px; }
    .char-controls .get-btn { padding: 10px 20px; font-size: 15px; }
    .char-controls select.glass-input { padding: 10px 12px !important; font-size: 15px; }
    .char-controls .shop-item-right { gap: 10px; display: flex; align-items: center; }
    .char-controls #char-hat-toggle { width: 28px !important; height: 28px !important; }
    #char-checkout-btn { position: fixed !important; bottom: 16px; left: 50%; transform: translateX(-50%); width: 72px !important; height: 72px !important; z-index: 2001; box-shadow: 0 4px 20px rgba(34,197,94,0.4); }
    #theme-checkout-btn { width: 72px !important; height: 72px !important; margin: 20px auto 40px; box-shadow: 0 4px 20px rgba(34,197,94,0.4); }
    .fs-menu-header { padding: 15px; position: fixed; top: 0; left: 0; right: 0; background: rgba(11,11,11,0.95); z-index: 10; }
    .item-row { padding: 15px; flex-wrap: wrap; gap: 10px; }
    .item-label { font-size: 14px; min-width: 100px; }
    .done-section { position: fixed; bottom: 0; left: 0; right: 0; border-radius: 0; margin: 0; padding: 15px; }
}
@media (min-width: 769px) {
    .done-fab { left: 25%; } /* Left quarter of screen on desktop */
}
/* BIG INPUTS */
.big-section-label { color: rgba(255,255,255,0.3); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; }
.skin-grid { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 20px; }
.big-skin-opt { width: 60px; height: 60px; border-radius: 18px; cursor: pointer; transition: transform 0.2s; border: 2px solid transparent; }
.big-skin-opt:hover { transform: scale(1.1); }
.big-skin-opt.selected { border-color: white; box-shadow: 0 0 20px rgba(255,255,255,0.3); transform: scale(1.1); }

.item-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); padding: 20px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); transition: all 0.2s; }
.item-row:hover { background: rgba(255,255,255,0.06); }
/* SHOP STYLE SYSTEM */
.shop-section { margin-bottom: 30px; }
.shop-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; padding: 0 5px; }
.shop-section-title { color: rgba(255,255,255,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 3px; font-weight: 600; }
.shop-section-subtitle { color: rgba(255,255,255,0.3); font-size: 10px; }

.shop-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%); 
    padding: 16px 20px; 
    border-radius: 16px; 
    border: 1px solid rgba(255,255,255,0.08); 
    margin-bottom: 10px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    overflow: hidden;
}
.shop-item:hover { 
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%); 
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.shop-item.locked { opacity: 0.7; }
.shop-item.locked::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
}
.shop-item.owned { border-color: rgba(100,255,100,0.3); }
.shop-item.owned::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    color: #4ade80;
    font-size: 14px;
    font-weight: bold;
}

.shop-item-left { display: flex; align-items: center; gap: 15px; flex: 1; }
.shop-item-icon { 
    width: 50px; 
    height: 50px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 24px;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}
.shop-item-info { display: flex; flex-direction: column; gap: 4px; }
.shop-item-name { color: white; font-size: 14px; font-weight: 500; }
.shop-item-desc { color: rgba(255,255,255,0.4); font-size: 11px; }

.shop-item-right { display: flex; align-items: center; gap: 12px; }

/* iOS App Store style GET button */
.get-btn {
    background: rgba(0, 122, 255, 0.15);
    border: none;
    border-radius: 15px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #007AFF;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.get-btn:hover {
    background: rgba(0, 122, 255, 0.25);
}
.get-btn:active {
    transform: scale(0.95);
}
.get-btn.owned {
    background: rgba(100,100,100,0.15);
    color: rgba(255,255,255,0.4);
    cursor: default;
}
.get-btn.owned:hover {
    background: rgba(100,100,100,0.15);
}

/* Purchase popup */
.purchase-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.purchase-popup.active {
    opacity: 1;
    pointer-events: auto;
}
.purchase-popup-content {
    background: rgba(30,30,30,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
}
.purchase-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}
.purchase-popup-price {
    font-size: 24px;
    color: #007AFF;
    margin-bottom: 20px;
}
.purchase-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.purchase-popup-btn {
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.purchase-popup-btn.confirm {
    background: #007AFF;
    color: white;
}
.purchase-popup-btn.confirm:hover {
    background: #0056b3;
}
.purchase-popup-btn.cancel {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}
.purchase-popup-btn.cancel:hover {
    background: rgba(255,255,255,0.2);
}

.color-picker-mini {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}
.color-picker-mini:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.15);
}

.skin-grid-shop {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.skin-opt-shop {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.skin-opt-shop:hover { transform: scale(1.1); }
.skin-opt-shop.selected { border-color: #007AFF; box-shadow: 0 0 15px rgba(0,122,255,0.5); }
.skin-opt-shop.locked { 
    opacity: 0.5;
    cursor: pointer;
}
.skin-opt-shop.locked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.shop-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    margin: 25px 0;
}

.inventory-bar {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.inventory-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.checkout-btn {
    width: 70px;
    height: 70px;
    padding: 0;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    color: #22c55e;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.checkout-btn:hover {
    transform: scale(1.1);
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 30px rgba(34,197,94,0.3);
}
.checkout-btn::after {
    content: '✓';
}
.item-label { font-size: 16px; font-weight: 500; color: rgba(255,255,255,0.9); }
.item-input-group { display: flex; align-items: center; gap: 10px; }
.big-color-input { width: 50px; height: 50px; border: none; border-radius: 12px; cursor: pointer; background: none; }
.big-hex { background: transparent; border: none; color: rgba(255,255,255,0.5); font-family: monospace; text-transform: uppercase; width: 70px; text-align: right; font-size: 14px; }

.done-section { position: fixed; bottom: 20px; left: 20px; width: calc(400px + 20px); max-width: calc(450px + 20px); background: rgba(100,255,100,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(100,255,100,0.3); border-radius: 16px; padding: 20px 30px; text-align: center; cursor: pointer; transition: all 0.3s; z-index: 2001; }
.done-section:hover { background: rgba(100,255,100,0.2); border-color: rgba(100,255,100,0.5); transform: translateY(-2px); }
@media (max-width: 768px) {
    .done-section { left: 10px; right: 10px; width: auto; max-width: none; bottom: 10px; }
    .desktop-done { display: none; }
    .mobile-done { display: inline; }
}
.done-text { font-size: 14px; color: rgba(100,255,100,0.8); letter-spacing: 1px; text-transform: uppercase; transition: color 0.3s; font-weight: 500; }
.done-section:hover .done-text { color: rgba(100,255,100,1); }
.mobile-done { display: none; }

/* Theme Grid Update */
.big-theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; width: 100%; padding: 0 40px; margin-top: 80px; padding-bottom: 100px; }
.big-theme-card { aspect-ratio: 16/9; border-radius: 20px; position: relative; overflow: hidden; cursor: pointer; border: 2px solid rgba(255,255,255,0.1); transition: all 0.3s; }
.big-theme-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.5); }
.big-theme-card.selected { border-color: var(--ui-color); box-shadow: 0 0 30px rgba(136,136,136,0.2); }

/* MULTIPLAYER SPLIT LAYOUT */
.mp-split { display: flex; width: 100%; height: 100%; padding-top: 80px; gap: 20px; }
.mp-sidebar { 
    flex: 0 0 320px; 
    margin-left: 30px; 
    margin-bottom: 30px;
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    background: rgba(255,255,255,0.03); 
    backdrop-filter: blur(20px); 
    border: 1px solid rgba(255,255,255,0.08); 
    border-radius: 24px; 
    max-height: calc(100vh - 120px); 
    overflow-y: auto; 
}

.mp-gif-area { 
    flex: 1; 
    margin-right: 30px;
    margin-bottom: 30px;
    padding: 20px; 
    background: rgba(0,0,0,0.2);
    border-radius: 24px;
    overflow-y: auto; 
    max-height: calc(100vh - 120px); 
}

/* Override existing GIF selector styles for embedded view */
#gif-selector { display: block !important; background: none !important; border: none !important; padding: 0 !important; width: 100% !important; max-width: none !important; position: static !important; }
#gif-grid, #favorites-grid, #recents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 8px; }

/* MP Specific Inputs */
.mp-name-input { 
    width: 100%; 
    text-align: center; 
    font-size: 20px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    padding: 16px; 
    border-radius: 12px; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255,255,255,0.1); 
    color: white; 
    font-weight: 600;
}
.mp-name-input:focus { border-color: var(--ui-color); outline: none; }
.mp-section-title { color: rgba(255,255,255,0.4); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 15px 0 5px 0; text-align: center; width: 100%; }
#join-input-container { flex-direction: column; align-items: center; gap: 16px; width: 100%; }

@media (max-width: 768px) {
    .mp-split { flex-direction: column; padding-top: 70px; overflow-y: auto; height: 100vh; gap: 10px; }
    .mp-sidebar { width: calc(100% - 20px); margin: 0 10px; flex: none; max-height: none; padding: 20px; border-radius: 16px; }
    .mp-gif-area { width: calc(100% - 20px); margin: 0 10px 20px 10px; flex: none; height: auto; min-height: 300px; max-height: 400px; border-radius: 16px; }
    .mp-controls .glass-btn { padding: 18px 20px; font-size: 16px; }
    .mp-name-input { font-size: 18px; padding: 14px; }
    #player-count-section { padding: 10px 0; }
    .player-count-btns { flex-wrap: wrap; justify-content: center; }
    .count-btn { width: 44px; height: 44px; }
    #waiting-room { padding: 10px 0; }
    .player-slot { padding: 10px 12px; font-size: 14px; }
}

/* CINEMATIC LORE STYLES */
#lore-screen { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #000; z-index: 2000; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer;
}
#lore-text-container {
    max-width: 600px; width: 80%; text-align: center;
}
#lore-speaker {
    color: #6bcfff; font-size: 14px; letter-spacing: 4px; font-weight: bold;
    margin-bottom: 20px; text-transform: uppercase;
}
#lore-text { 
    font-family: 'Courier New', monospace; font-size: 24px; line-height: 1.5; 
    color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5);
    min-height: 120px; /* Prevents layout jumping */
    animation: textFadeIn 0.5s ease-out;
}
#lore-sub {
    margin-top: 40px; color: #444; font-size: 10px; letter-spacing: 2px; animation: pulse 2s infinite;
}
#lore-skip-btn {
    position: absolute; bottom: 30px; right: 30px;
    background: transparent; border: 1px solid #333; color: #666;
    padding: 10px 20px; border-radius: 20px; cursor: pointer;
    font-size: 10px; letter-spacing: 1px; transition: all 0.3s;
}
#lore-skip-btn:hover { border-color: #fff; color: #fff; }

@keyframes textFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* Google Ads Container */
#ad-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    background: black;
}

.purchase-popup-btn.confirm:disabled {
    background: rgba(100,100,100,0.3);
    color: rgba(255,255,255,0.4);
    cursor: not-allowed;
}
.purchase-popup-btn.confirm:disabled:hover {
    background: rgba(100,100,100,0.3);
}
.purchase-popup-insufficient {
    color: #ff6b6b;
    font-size: 12px;
    margin-bottom: 15px;
}

/* Sandbox Editor */
.sandbox-tool-btn { padding:6px 12px; font-size:12px; font-family:inherit; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.2); border-radius:6px; color:rgba(255,255,255,0.7); cursor:pointer; transition:all 0.15s; letter-spacing:1px; text-transform:uppercase; }
.sandbox-tool-btn:hover { background:rgba(255,255,255,0.15); color:white; }
.sandbox-tool-btn.active { background:rgba(255,255,255,0.15); border-color:rgba(255,255,255,0.6); color:white; }
.sandbox-size-btn.selected { background:rgba(255,159,67,0.15); border-color:#ff9f43; color:#ff9f43; }
#sandbox-box-dropdown::-webkit-scrollbar { width:4px; }
#sandbox-box-dropdown::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.2); border-radius:4px; }
.sandbox-box-item { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:6px; cursor:pointer; color:rgba(255,255,255,0.7); font-size:12px; font-family:inherit; background:none; border:none; width:100%; text-align:left; transition:background 0.1s; }
.sandbox-box-item:hover { background:rgba(255,255,255,0.1); }
.sandbox-box-item.active { background:rgba(255,255,255,0.15); color:white; }
@media (max-width: 768px) {
    .sandbox-tool-btn { padding:4px 8px; font-size:10px; letter-spacing:0.5px; }
    #sandbox-toolbar { padding:6px 8px !important; bottom:8px !important; }
    #sandbox-topbar { padding:6px 10px !important; }
    #sandbox-topbar .glass-btn { padding:4px 10px !important; font-size:11px !important; }
    #sandbox-map-title { width:120px !important; font-size:12px !important; }
}
