:root {
    --primary-glow: #a855f7;
    --secondary-glow: #eab308;
    --bg-dark: #09090b;
    --panel-bg: rgba(15, 23, 42, 0.75);
    --rarity-common: #94a3b8;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f97316;
    --rarity-mythic: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0; padding: 0;
    user-select: none;
    font-family: 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%; height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: #f4f4f5;
}

#orientation-overlay {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 99999;
    flex-direction: column; justify-content: center; align-items: center;
}

@media orientation: portrait {
    #orientation-overlay { display: flex; }
}

#canvas-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

.ui-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10; display: none; pointer-events: none;
}

.ui-screen.active { display: block; }

.clickable { pointer-events: auto; cursor: pointer; transition: all 0.2s ease; }
.clickable:hover { transform: scale(1.05); filter: brightness(1.2); }
.clickable:active { transform: scale(0.95); }

/* INTRO LOADING SCREEN */
#screen-intro {
    background: radial-gradient(circle, #1e1b4b 0%, #09090b 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center; pointer-events: auto;
}

.logo-container { text-align: center; animation: pulseGlow 3s infinite ease-in-out; }
.logo-main {
    font-size: 4rem; font-weight: 900; letter-spacing: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--primary-glow) 50%, var(--secondary-glow) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-transform: uppercase; text-shadow: 0 0 30px rgba(168,85,247,0.4);
}
.logo-sub { font-size: 1.2rem; letter-spacing: 12px; color: #94a3b8; text-transform: uppercase; margin-top: -5px;}

.loader-bar-container { width: 300px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-top: 40px; overflow: hidden; }
.loader-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow)); }
.loading-tip { margin-top: 15px; font-size: 0.85rem; color: #64748b; font-style: italic; }

/* LOBBY INTERFACE */
.hud-header { position: absolute; top: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; }
.player-card { background: var(--panel-bg); border-left: 4px solid var(--primary-glow); padding: 10px 20px; border-radius: 0 8px 8px 0; display: flex; align-items: center; gap: 15px; backdrop-filter: blur(10px); }
.player-avatar { width: 45px; height: 45px; background: #334155; border-radius: 50%; border: 2px solid #fff; }
.player-info .name { font-weight: bold; }
.player-info .rank { font-size: 0.8rem; color: var(--secondary-glow); }

.currency-container { display: flex; gap: 15px; }
.currency-box { background: var(--panel-bg); padding: 8px 15px; border-radius: 20px; display: flex; align-items: center; gap: 10px; backdrop-filter: blur(10px); }
.currency-box span.icon-gold { color: var(--secondary-glow); }
.currency-box span.icon-diamond { color: #22d3ee; }

.sidebar-left { position: absolute; left: 20px; top: 100px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-right { position: absolute; right: 20px; top: 100px; display: flex; flex-direction: column; gap: 12px; }
.btn-icon-label { background: var(--panel-bg); border: 1px solid rgba(255,255,255,0.1); padding: 12px; border-radius: 8px; color: #fff; display: flex; align-items: center; gap: 12px; width: 160px; backdrop-filter: blur(10px); }
.btn-icon-label .icon { width: 24px; height: 24px; background: rgba(255,255,255,0.1); border-radius: 4px; display: flex; justify-content: center; align-items: center; }

.hud-footer { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-end; }
.chat-preview { width: 320px; height: 90px; background: var(--panel-bg); border-radius: 8px; padding: 10px; backdrop-filter: blur(10px); font-size: 0.8rem; display: flex; flex-direction: column; gap: 5px; }
.chat-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-system { color: var(--secondary-glow); }

.matchmaker-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mode-selector { background: var(--panel-bg); padding: 10px 30px; border-radius: 6px; font-weight: bold; text-transform: uppercase; backdrop-filter: blur(10px); }
.btn-action-start { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); padding: 18px 60px; border-radius: 4px; font-size: 1.5rem; font-weight: 900; color: #fff; border: none; box-shadow: 0 0 25px rgba(239,68,68,0.5); text-transform: uppercase; }

/* MODALS LAYOUT */
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 8, 0.85); backdrop-filter: blur(15px); z-index: 100; display: none; justify-content: center; align-items: center; pointer-events: auto; }
.modal-container { width: 85%; height: 80%; background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(168,85,247,0.3); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 20px; background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.5rem; font-weight: bold; text-transform: uppercase; }
.btn-close { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 35px; height: 35px; border-radius: 50%; font-weight: bold; }
.modal-body { flex: 1; padding: 20px; display: flex; gap: 20px; overflow-y: auto; }

/* LUCKY REWARDS SPECIFICS */
.lucky-tabs { width: 220px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid rgba(255,255,255,0.05); padding-right: 15px; }
.lucky-tab-btn { padding: 12px 15px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; color: #94a3b8; text-align: left; }
.lucky-tab-btn.active { background: linear-gradient(90deg, rgba(168,85,247,0.2), transparent); border-color: var(--primary-glow); color: #fff; }
.lucky-display-panel { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.lucky-showcase { flex: 1; background: radial-gradient(circle at center, #2e1065 0%, transparent 70%); display: flex; justify-content: center; align-items: center; position: relative; }
.lucky-meter-container { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.4); padding: 8px 15px; border-radius: 20px; font-size: 0.8rem; }
.lucky-meter-bar { width: 120px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.lucky-meter-fill { width: 45%; height: 100%; background: var(--secondary-glow); }
.lucky-actions { display: flex; justify-content: center; gap: 20px; padding: 15px 0; background: rgba(0,0,0,0.2); }
.btn-spin { padding: 12px 35px; border-radius: 6px; font-weight: 800; border: none; color: #fff; text-transform: uppercase; }
.btn-spin-1 { background: #475569; border-bottom: 3px solid #1e293b; }
.btn-spin-10 { background: linear-gradient(135deg, var(--primary-glow), #7e22ce); border-bottom: 3px solid #581c87; }

/* IN GAME HUD SCREEN */
#screen-gameplay { pointer-events: none; }
.game-hud-top { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.5); padding: 8px 25px; border-radius: 4px; text-align: center; }
.game-hud-left { position: absolute; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 10px; }
.game-health-bar { width: 250px; height: 12px; background: rgba(0,0,0,0.5); border-radius: 3px; overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
.game-health-fill { width: 100%; height: 100%; background: #22c55e; transition: width 0.3s ease; }
.game-hud-right { position: absolute; bottom: 20px; right: 20px; background: rgba(0,0,0,0.6); padding: 15px; border-radius: 8px; text-align: right; }
.weapon-info-main { font-size: 1.8rem; font-weight: 900; }

/* REVEAL OVERLAY SYSTEM */
#reveal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: #000; z-index: 1000; display: none; flex-direction: column; justify-content: center; align-items: center; }
.reveal-card { width: 260px; height: 340px; background: radial-gradient(circle, #334155 0%, #0f172a 100%); border: 2px solid var(--rarity-common); border-radius: 16px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 25px; transform: scale(0.5); opacity: 0; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.reveal-card.animate { transform: scale(1); opacity: 1; }
.reveal-rarity-text { text-transform: uppercase; font-weight: 900; letter-spacing: 2px; }
.reveal-item-name { font-size: 1.4rem; font-weight: bold; text-align: center; }

.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; width: 100%; }
.item-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 15px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 15px rgba(168,85,247,0.2)); }
    50% { filter: drop-shadow(0 0 35px rgba(168,85,247,0.6)); }
}
