:root {
            --sat: env(safe-area-inset-top, 0px);
            --sar: env(safe-area-inset-right, 0px);
            --sab: env(safe-area-inset-bottom, 0px);
            --sal: env(safe-area-inset-left, 0px);
        }
        body { margin: 0; overflow: hidden; background: #0f172a; font-family: sans-serif; color: white; user-select: none; }
        body.in-game { touch-action: none; }
        input, select, textarea { user-select: text; -webkit-user-select: text; touch-action: manipulation; }
        #lobbyScreen, #roomLobby { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
        #lobbyScreen button, #roomLobby button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
        #webIntro { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0f172a; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeOutWebIntro 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) 2.5s forwards; pointer-events: none; }
        .intro-title { font-size: 2.5rem; color: #ffcc00; letter-spacing: 6px; font-weight: 900; margin: 0; text-transform: uppercase; text-align: center; animation: pulseIntroText 1.2s ease-in-out infinite alternate; }
        .intro-sub { font-size: 1.2rem; color: #38bdf8; margin-top: 12px; letter-spacing: 3px; font-weight: bold; text-align: center; }
        @keyframes fadeOutWebIntro { 100% { opacity: 0; visibility: hidden; } }
        @keyframes pulseIntroText { 0% { transform: scale(0.97); opacity: 0.6; text-shadow: 0 0 10px rgba(255,204,0,0); } 100% { transform: scale(1.03); opacity: 1; text-shadow: 0 0 20px rgba(255,204,0,0.6); } }
        #lobbyScreen, #victoryScreen, #roomLobby { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: url('../assets/lobby-bg.jpg') no-repeat center center; background-size: cover; box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.65); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10000; }
        #gameOverScreen { display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background: url('../assets/endgame-bg.jpg') no-repeat center center; background-size: cover; box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.75); z-index:20000; flex-direction:column; align-items:center; justify-content:center; }
        #roomLobby { display: none; z-index: 9999; }
        .menu-panel { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 30px; border-radius: 15px; border: 2px solid #ffcc00; text-align: center; box-shadow: 0 0 40px rgba(255, 204, 0, 0.3); width: 320px; max-width: 90%; }
        input, select { padding: 12px; font-size: 1rem; width: 100%; box-sizing: border-box; text-align: center; border: 1px solid #555; border-radius: 6px; background: rgba(0,0,0,0.5); color: white; margin: 8px 0; display: block; }
        input:focus, select:focus { outline: none; border-color: #00bfff; }
        button { padding: 12px 25px; font-size: 1.1rem; background: #28a745; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 12px; width: 100%; box-sizing: border-box; transition: transform 0.1s; }
        button:active { transform: scale(0.95); }
        #playerList { background: rgba(0,0,0,0.5); padding: 15px; width: 100%; box-sizing: border-box; border-radius: 8px; text-align: left; max-height: 150px; overflow-y: auto; margin: 15px 0; border: 1px solid #555; }
        .hero-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; max-height: 220px; overflow-y: auto; }
        .hero-pick-btn { margin: 0; padding: 8px 6px; font-size: 0.82rem; background: rgba(15, 23, 42, 0.85); border: 1px solid #475569; color: #e2e8f0; line-height: 1.25; }
        .hero-pick-btn.active { border-color: #ffcc00; background: rgba(255, 204, 0, 0.18); color: #fff; box-shadow: 0 0 0 1px #ffcc00; }
        .hero-pick-btn .hero-name { display: block; color: #38bdf8; font-weight: 800; font-size: 0.95rem; margin-bottom: 2px; }
        .skin-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 8px; }
        .skin-pick-btn {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            padding: 8px 6px; border-radius: 10px; border: 1px solid #334155;
            background: rgba(15, 23, 42, 0.85); color: #e2e8f0; cursor: pointer; font-size: 0.72rem;
        }
        .skin-pick-btn .skin-emoji { font-size: 1.6rem; line-height: 1; }
        .skin-pick-btn.active { border-color: #38bdf8; box-shadow: 0 0 0 1px #38bdf8; }
        .hero-picker-hint { color: #94a3b8; font-size: 0.78rem; margin: 0 0 10px; min-height: 2.4em; line-height: 1.35; }
        #lobbyChatBox { width: 100%; box-sizing: border-box; margin-top: 12px; text-align: left; }
        .lobby-chat-title { color: #38bdf8; font-weight: bold; font-size: 0.95rem; margin-bottom: 6px; }
        #lobbyChatLog { background: rgba(0,0,0,0.5); border: 1px solid #555; border-radius: 8px; padding: 10px; height: 130px; overflow-y: auto; font-size: 0.9rem; line-height: 1.45; -webkit-overflow-scrolling: touch; }
        .lobby-chat-msg { margin-bottom: 4px; word-break: break-word; color: #e2e8f0; }
        .lobby-chat-msg.me { background: rgba(56, 189, 248, 0.12); border-radius: 6px; padding: 1px 5px; }
        .lobby-chat-msg.system { color: #94a3b8; font-style: italic; text-align: center; }
        .lobby-chat-msg .chat-name { font-weight: bold; }
        #lobbyTypingStatus { min-height: 18px; margin: 3px 2px -3px; color: #94a3b8; font-size: 0.78rem; font-style: italic; }
        .lobby-chat-input-row { display: flex; gap: 6px; align-items: stretch; margin-top: 8px; }
        .lobby-chat-input-row input { margin: 0; flex: 1; min-width: 0; }
        .lobby-chat-input-row button { margin: 0; width: auto; padding: 10px 16px; background: #38bdf8; color: #0f172a; white-space: nowrap; }
        #roomLobby { justify-content: flex-start; padding: max(16px, var(--sat)) max(16px, var(--sar)) max(16px, var(--sab)) max(16px, var(--sal)); box-sizing: border-box; }
        #roomLobby .room-lobby-panel { width: min(94vw, 900px); max-width: none; padding: 20px; box-sizing: border-box; }
        .room-lobby-panel > h2 { margin: 0 0 12px; }
        .room-lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
        .room-lobby-column { min-width: 0; }
        .room-lobby-activity h3 { color: white; margin: 0 0 10px; }
        #roomInviteSection { display: none; margin: 0 0 14px; padding: 10px; background: rgba(0,0,0,0.72); border: 1px solid #38bdf8; border-radius: 10px; box-sizing: border-box; }
        .room-invite-label { color: #38bdf8; }
        .room-invite-row { display: flex; gap: 6px; align-items: stretch; }
        #roomInviteLink { margin: 0; font-size: 0.82rem; text-align: left; flex: 1; min-width: 0; }
        #roomInviteCopyBtn { margin: 0; width: auto; padding: 10px 14px; background: #38bdf8; color: #0f172a; font-size: 0.9rem; white-space: nowrap; }
        #roomInviteShareBtn { margin-top: 8px; background: #0ea5e9; font-size: 0.95rem; }
        #roomLobby #playerList { margin: 8px 0 12px; max-height: 180px; }
        #roomLobby #lobbyChatBox { margin-top: 10px; }
        @media (max-width: 700px) {
            #roomLobby { padding: max(8px, var(--sat)) max(8px, var(--sar)) max(8px, var(--sab)) max(8px, var(--sal)); }
            #roomLobby .room-lobby-panel { width: 100%; padding: 12px; }
            .room-lobby-grid { grid-template-columns: 1fr; gap: 12px; }
            #roomInviteSection { position: sticky; top: max(8px, var(--sat)); z-index: 4; box-shadow: 0 6px 18px rgba(0,0,0,0.45); }
            .hero-picker { max-height: 190px; }
        }
        #gameUI { display: none; width: 100vw; height: 100vh; position: relative; touch-action: none; }
        #gameCanvas { display: block; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; touch-action: none; }
        #hud { position: fixed; top: max(15px, var(--sat)); left: max(15px, var(--sal)); background: rgba(0,0,0,0.6); padding: 12px; border-radius: 8px; font-weight: bold; font-size: 14px; border: 1px solid #555; pointer-events: none; z-index: 10; }
        #hud div { margin-bottom: 4px; }
        #leaderboard { position: fixed; top: max(15px, var(--sat)); right: max(15px, var(--sar)); background: rgba(0,0,0,0.6); padding: 12px; border-radius: 8px; border: 1px solid #555; min-width: 150px; font-size: 13px; pointer-events: none; z-index: 10; }
        .rank-item { display: flex; justify-content: space-between; margin-bottom: 3px; font-weight: bold; }
        #killFeedContainer { position: fixed; top: max(15px, var(--sat)); left: 50%; transform: translateX(-50%); max-width: 400px; text-align: center; pointer-events: none; z-index: 100; font-weight: bold; font-size: 14px; }
        .feed-item { background: rgba(220, 53, 69, 0.85); padding: 6px 15px; border-radius: 20px; border: 1px solid #ffcc00; margin-bottom: 5px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); animation: fadeInOut 4s forwards; }
        .feed-item.feed-ally { background: rgba(34, 197, 94, 0.88); border-color: #86efac; }
        .feed-item.feed-team { background: rgba(88, 28, 135, 0.85); border-color: #c084fc; }
        .feed-item.feed-bo { background: rgba(234, 88, 12, 0.88); border-color: #fdba74; }
        @keyframes fadeInOut { 0% { opacity: 0; transform: translateY(-10px); } 10% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-15px); } }
        #damageFlashOverlay { position: fixed; inset: 0; pointer-events: none; z-index: 9; background: radial-gradient(circle, rgba(239,68,68,0.55) 0%, rgba(127,29,29,0.15) 55%, transparent 75%); opacity: 0; transition: opacity 0.05s linear; }
        #announceBanner { display: none; position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%); z-index: 105; pointer-events: none; text-align: center; width: 92vw; }
        #announceBanner .ann-main { font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 900; color: #ffcc00; text-shadow: 0 0 18px rgba(255,204,0,0.7), 2px 2px 6px #000; letter-spacing: 2px; }
        #announceBanner .ann-sub { margin-top: 6px; font-size: clamp(0.9rem, 3vw, 1.3rem); font-weight: bold; color: #fff; text-shadow: 1px 1px 4px #000; }
        #announceBanner.ann-show { display: block; animation: annPop 0.5s ease-out; }
        @keyframes annPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
        #teamStatusPanel { position: fixed; top: max(15px, var(--sat)); right: max(15px, var(--sar)); margin-top: 0; background: rgba(0,0,0,0.72); padding: 10px 12px; border-radius: 10px; border: 1px solid #7c3aed; min-width: 168px; font-size: 12px; pointer-events: none; z-index: 11; box-shadow: 0 4px 18px rgba(0,0,0,0.35); }
        #teamStatusPanel #teamStatusTitle { color: #c4b5fd; font-weight: bold; font-size: 11px; letter-spacing: 0.5px; margin-bottom: 6px; text-align: center; }
        .team-status-row { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,0.06); }
        .team-status-row:last-child { border-bottom: none; }
        .team-status-row.mine { background: rgba(124, 58, 237, 0.18); border-radius: 6px; padding-left: 6px; padding-right: 6px; }
        .team-status-row.eliminated { opacity: 0.45; }
        .team-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .team-label { flex: 1; font-weight: bold; }
        .team-count { color: #ffcc00; font-weight: bold; min-width: 34px; text-align: right; }
        .team-offline { color: #fb923c; font-size: 10px; }
        .team-out { color: #ef4444; font-size: 10px; font-weight: bold; }
        .team-status-empty { color: #94a3b8; font-size: 11px; text-align: center; }
        #leaderboard.team-mode-offset { top: auto; bottom: calc(210px + var(--sab)); right: max(15px, var(--sar)); }
        #victoryConfetti { position: fixed; inset: 0; pointer-events: none; z-index: 20002; overflow: hidden; }
        .confetti-piece { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.9; animation: confettiFall linear forwards; }
        @keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }
        .victory-pop { animation: victoryPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1); }
        @keyframes victoryPop { 0% { transform: scale(0.82); opacity: 0.2; } 100% { transform: scale(1); opacity: 1; } }
        #puzzleBackdrop { display: none; position: fixed; inset: 0; z-index: 10005; pointer-events: none; background: #070b14 url('../assets/puzzle/puzzle-zone-bg.jpg') no-repeat center center; background-size: cover; }
        #puzzleBackdrop::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 42% 58% at 50% 48%, rgba(7,11,20,0.55) 0%, rgba(7,11,20,0.12) 52%, transparent 72%); }
        #puzzleOverlay { display:none; position:fixed; inset:0; margin:auto; height:fit-content; max-height:94vh; background:rgba(8,14,28,0.84); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding:14px; z-index:10010; border:3px solid #00ffff; border-radius: 12px; width: min(96vw, 546px); overflow-y: auto; touch-action: none; -webkit-overflow-scrolling: touch; box-sizing: border-box; pointer-events: auto; user-select: none; -webkit-user-select: none; box-shadow: 0 0 48px rgba(0,255,255,0.12), 0 24px 64px rgba(0,0,0,0.55); }
        /* height không !important — JS ép vuông (px) trước khi Chessground đo bounds */
        #board { width: min(96vw, calc(100vh - 200px), 494px) !important; height: auto; aspect-ratio: 1 / 1; margin: 0 auto; touch-action: none; cursor: pointer; position: relative; overflow: hidden; }
        #gameUI.puzzle-active > *:not(#puzzleOverlay):not(#puzzleBackdrop) { pointer-events: none !important; }
        .puzzle-mouse-hint { display: none; color: #94a3b8; font-size: 0.78rem; text-align: center; margin: 0 0 8px; }
        @media (hover: hover) and (pointer: fine) {
            .puzzle-mouse-hint { display: block; }
        }
        .puzzle-touch-hint { display: none; color: #94a3b8; font-size: 0.78rem; text-align: center; margin: 0 0 8px; }
        @media (pointer: coarse) {
            .puzzle-touch-hint { display: block; }
            #puzzleOverlay { touch-action: none; overflow-y: auto; }
        }
        #connectionStatus { display: none; position: fixed; top: max(10px, var(--sat)); left: 50%; transform: translateX(-50%); z-index: 10001; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; font-size: 0.76rem; font-weight: bold; pointer-events: none; white-space: nowrap; max-width: calc(92vw - var(--sal) - var(--sar)); box-sizing: border-box; }
        #connectionStatus .conn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        #connectionStatus.connection-connecting { display: flex; background: rgba(120,53,15,0.85); border: 1px solid #fbbf24; color: #fef3c7; }
        #connectionStatus.connection-connecting .conn-dot { background: #fbbf24; animation: connPulse 1.2s ease-in-out infinite; }
        #connectionStatus.connection-connected { display: flex; background: rgba(20,83,45,0.85); border: 1px solid #22c55e; color: #bbf7d0; }
        #connectionStatus.connection-connected .conn-dot { background: #22c55e; }
        #connectionStatus.connection-disconnected, #connectionStatus.connection-error { display: flex; background: rgba(127,29,29,0.88); border: 1px solid #f87171; color: #fee2e2; }
        #connectionStatus.connection-disconnected .conn-dot, #connectionStatus.connection-error .conn-dot { background: #f87171; animation: connPulse 0.9s ease-in-out infinite; }
        @keyframes connPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.85); } }
        #lobbyStep1NextBtn:disabled { opacity: 0.55; cursor: not-allowed; }
        #reconnectOverlay { display: none; position: fixed; inset: 0; z-index: 10030; background: rgba(15,23,42,0.94); align-items: center; justify-content: center; padding: max(20px, var(--sat)) max(20px, var(--sar)) max(20px, var(--sab)) max(20px, var(--sal)); box-sizing: border-box; }
        .reconnect-card { background: rgba(30,41,59,0.95); border: 2px solid #38bdf8; border-radius: 16px; padding: 28px 24px; max-width: min(92vw, 380px); text-align: center; box-shadow: 0 0 40px rgba(56,189,248,0.25); }
        .reconnect-spinner { width: 44px; height: 44px; margin: 0 auto 16px; border: 4px solid rgba(56,189,248,0.25); border-top-color: #38bdf8; border-radius: 50%; animation: reconnectSpin 0.9s linear infinite; }
        @keyframes reconnectSpin { to { transform: rotate(360deg); } }
        #reconnectTitle { margin: 0 0 10px; color: #38bdf8; font-size: 1.25rem; }
        #reconnectSub { margin: 0 0 16px; color: #94a3b8; font-size: 0.88rem; line-height: 1.5; }
        #reconnectLobbyBtn { margin: 0; background: #475569; touch-action: manipulation; }
        .reduced-motion .reconnect-spinner { animation: none; border-top-color: #38bdf8; opacity: 0.85; }
        .reduced-motion .confetti-piece, .perf-low .confetti-piece { display: none !important; }
        @media (prefers-reduced-motion: reduce) {
            .reconnect-spinner, .rotate-icon, .intro-title, .confetti-piece { animation: none !important; }
        }
        .stats-box { background: rgba(0,0,0,0.5); padding: 20px; border-radius: 10px; border: 2px solid #ffcc00; text-align: center; margin-bottom: 20px; width: 90%; max-width: 340px; box-sizing: border-box; }
        #audioToggle { position: fixed; bottom: max(15px, var(--sab)); right: max(15px, var(--sar)); padding: 8px; background: rgba(0,0,0,0.5); border: 1px solid #888; border-radius: 5px; cursor: pointer; font-size: 11px; z-index: 10; width: auto; touch-action: manipulation; }
        #mobileControls { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 998; }
        #mobileJoystickContainer, #mobileFireBtn, #mobileRocketBtn, #mobileSkillBtn { pointer-events: auto; touch-action: none; }
        #mobileJoystickContainer { position: fixed; bottom: max(24px, var(--sab)); left: max(20px, var(--sal)); width: 108px; height: 108px; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.22); border-radius: 50%; }
        #mobileJoystickHandle { position: absolute; top: 34px; left: 34px; width: 40px; height: 40px; background: #00bfff; border-radius: 50%; box-shadow: 0 0 15px #00bfff; }
        #mobileAimPadHint { position: fixed; right: max(18px, var(--sar)); top: 50%; transform: translateY(-50%); width: min(42vw, 220px); padding: 10px 12px; border: 1px dashed rgba(251,191,36,0.45); border-radius: 14px; background: rgba(15,23,42,0.18); color: rgba(226,232,240,0.8); font-size: 11px; line-height: 1.4; text-align: center; pointer-events: none; }
        #mobileRocketBtn { position: fixed; bottom: max(38px, var(--sab)); right: calc(102px + var(--sar)); width: 64px; height: 64px; border-radius: 50%; border: 2px solid #fdba74; background: radial-gradient(circle at 35% 35%, #fdba74, #ea580c 58%, #9a3412); color: #fff; font-size: 1.35rem; font-weight: 900; box-shadow: 0 0 18px rgba(234,88,12,0.5); padding: 0; margin: 0; }
        #mobileRocketBtn:active { transform: scale(0.92); }
        #mobileFireBtn { position: fixed; bottom: max(38px, var(--sab)); right: max(18px, var(--sar)); width: 72px; height: 72px; border-radius: 50%; border: 2px solid #fecaca; background: radial-gradient(circle at 35% 35%, #fca5a5, #dc2626 58%, #991b1b); color: #fff; font-size: 1.55rem; font-weight: 900; box-shadow: 0 0 22px rgba(239,68,68,0.55); padding: 0; margin: 0; }
        #mobileFireBtn:active { transform: scale(0.92); background: radial-gradient(circle at 35% 35%, #f87171, #b91c1c 60%, #7f1d1d); }
        #mobileSkillBtn { position: fixed; bottom: max(120px, calc(var(--sab) + 100px)); right: max(22px, var(--sar)); width: 58px; height: 58px; border-radius: 50%; border: 2px solid #93c5fd; background: radial-gradient(circle at 35% 35%, #7dd3fc, #0284c7 58%, #075985); color: #fff; font-size: 1.25rem; font-weight: 900; box-shadow: 0 0 18px rgba(14,165,233,0.45); padding: 0; margin: 0; display: none; }
        #mobileJoystickContainer, #mobileFireBtn, #mobileRocketBtn, #mobileSkillBtn { pointer-events: auto; touch-action: none; }
        #mobileRotateHint { display: none; position: fixed; inset: 0; z-index: 10020; background: rgba(15,23,42,0.96); color: #fff; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: max(24px, var(--sat)) max(24px, var(--sar)) max(24px, var(--sab)) max(24px, var(--sal)); }
        #mobileRotateHint .rotate-icon { font-size: 3.5rem; margin-bottom: 16px; animation: rotatePhone 2s ease-in-out infinite; }
        @keyframes rotatePhone { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(90deg); } }
        @media (pointer: coarse) {
            #hud { font-size: 12px; padding: 8px 10px; max-width: 42vw; }
            #leaderboard { font-size: 11px; padding: 8px 10px; min-width: 120px; max-width: 38vw; }
            #teamStatusPanel { top: auto; bottom: calc(118px + var(--sab)); right: max(8px, var(--sar)); min-width: 140px; font-size: 11px; }
            #leaderboard.team-mode-offset { bottom: calc(198px + var(--sab)); right: max(8px, var(--sar)); }
            #audioToggle { bottom: auto; top: max(8px, var(--sat)); right: max(8px, var(--sar)); font-size: 10px; padding: 6px 8px; z-index: 1002; }
            #puzzleOverlay { width: 96vw; max-width: 494px; padding: 10px; }
            #board { width: min(94vw, calc(100vh - 180px), 442px) !important; }
            #puzzleOverlay button { font-size: 0.88rem !important; padding: 8px !important; }
        }
        @media (pointer: coarse) and (orientation: portrait) {
            #mobileControls { display: none !important; }
            #puzzleOverlay { width: 96vw; max-height: 94vh; }
            #board { width: min(94vw, calc(100vh - 190px), 416px) !important; }
            #puzzlesLeftDisplay, #timerDisplay { font-size: 13px !important; }
        }
        @media (pointer: coarse) and (orientation: landscape) {
            #mobileJoystickContainer { bottom: max(18px, var(--sab)); left: max(16px, var(--sal)); width: 112px; height: 112px; }
            #mobileAimPadHint { right: calc(18px + var(--sar)); width: min(38vw, 210px); font-size: 10px; }
            #mobileRocketBtn { bottom: max(30px, var(--sab)); right: calc(102px + var(--sar)); width: 68px; height: 68px; }
            #mobileFireBtn { bottom: max(30px, var(--sab)); right: max(14px, var(--sar)); width: 76px; height: 76px; }
            #hud { font-size: 11px; padding: 7px 8px; max-width: 38vw; }
            #hudCombatStats div span[style*="font-size:10px"] { display: none; }
        }
        #matchEndScreen { display: none; position: fixed; inset: 0; z-index: 20005; background: url('../assets/lobby-bg.jpg') no-repeat center center; background-size: cover; box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.65); align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
        #matchEndConfetti { position: fixed; inset: 0; pointer-events: none; z-index: 20006; overflow: hidden; }
        .match-end-card { position: relative; z-index: 20007; background: linear-gradient(165deg, #1e293b 0%, #0f172a 42%, #1e1b4b 100%); border: 2px solid #fbbf24; border-radius: 18px; width: min(94vw, 440px); max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 50px rgba(251,191,36,0.22), 0 24px 60px rgba(0,0,0,0.45); }
        .match-end-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 88% 8%, rgba(56,189,248,0.12) 0%, transparent 42%), radial-gradient(circle at 12% 12%, rgba(251,191,36,0.1) 0%, transparent 38%); pointer-events: none; }
        .match-end-card.win { border-color: #22c55e; box-shadow: 0 0 55px rgba(34,197,94,0.32), 0 24px 60px rgba(0,0,0,0.45); }
        .match-end-card.hlv { border-color: #a855f7; box-shadow: 0 0 45px rgba(168,85,247,0.28), 0 24px 60px rgba(0,0,0,0.45); }
        .match-end-header { position: relative; padding: 18px 20px 10px; text-align: center; }
        .match-end-header h2 { margin: 0 0 6px; font-size: 1.45rem; color: #fbbf24; text-shadow: 0 0 18px rgba(251,191,36,0.35); }
        .match-end-card.win .match-end-header h2 { color: #4ade80; text-shadow: 0 0 18px rgba(74,222,128,0.35); }
        .match-end-header p { margin: 0; color: #94a3b8; font-size: 0.9rem; }
        .match-end-stats { position: relative; margin: 0 16px 12px; padding: 14px; border-radius: 12px; border: 1px solid rgba(56,189,248,0.35); background: linear-gradient(135deg, rgba(15,23,42,0.88), rgba(30,27,75,0.55)); text-align: center; font-size: 0.95rem; line-height: 1.65; }
        .match-end-stats span.val { color: #38bdf8; font-weight: bold; }
        .match-end-highlight { position: relative; margin: 0 16px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(168,85,247,0.45); background: linear-gradient(135deg, rgba(76,29,149,0.35), rgba(15,23,42,0.85)); text-align: center; }
        .match-end-highlight-badge { color: #e9d5ff; font-size: 0.72rem; letter-spacing: 0.08em; font-weight: 800; margin-bottom: 4px; }
        .match-end-highlight-label { color: #fbbf24; font-weight: 900; font-size: 1.05rem; margin-bottom: 4px; }
        .match-end-highlight-detail { color: #cbd5e1; font-size: 0.86rem; line-height: 1.45; }
        .match-share-preview-wrap { position: relative; margin: 0 16px 12px; text-align: center; }
        .match-share-preview-label { margin: 0 0 8px; color: #94a3b8; font-size: 0.78rem; letter-spacing: 0.02em; }
        #matchSharePreview { display: none; width: 100%; max-height: 180px; object-fit: cover; object-position: top center; border-radius: 12px; border: 2px solid rgba(251,191,36,0.45); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
        .match-end-standings-wrap { position: relative; padding: 0 16px; flex: 1; overflow-y: auto; min-height: 80px; max-height: min(42vh, 420px); }
        .match-end-standings-wrap h3 { margin: 0 0 8px; color: #e2e8f0; font-size: 0.95rem; text-align: center; }
        .match-end-actions { position: relative; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(71,85,105,0.65); background: rgba(15,23,42,0.45); }
        .match-end-actions button { margin: 0; }
        .match-end-share-hint { margin: 0; color: #64748b; font-size: 0.75rem; text-align: center; line-height: 1.4; }
        #matchResultsModal { display: none; }
        .match-rank-row { border-bottom: 1px solid rgba(71,85,105,0.55); padding: 10px 10px; font-size: 0.95rem; line-height: 1.45; border-radius: 10px; margin-bottom: 4px; }
        .match-rank-row.rank-1 { background: linear-gradient(90deg, rgba(251,191,36,0.16), transparent); border-left: 3px solid #fbbf24; }
        .match-rank-row.rank-2 { background: linear-gradient(90deg, rgba(203,213,225,0.12), transparent); border-left: 3px solid #cbd5e1; }
        .match-rank-row.rank-3 { background: linear-gradient(90deg, rgba(217,119,6,0.14), transparent); border-left: 3px solid #d97706; }
        .match-rank-row.you { color: #fde68a; font-weight: bold; box-shadow: inset 0 0 0 1px rgba(56,189,248,0.45); background: linear-gradient(90deg, rgba(56,189,248,0.14), transparent); border-left: 3px solid #38bdf8; }
        .emoji-picker-label { color: #a5b4fc; font-size: 0.92rem; margin: 6px 0 4px; font-weight: bold; }
        .emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 10px; max-height: 150px; overflow-y: auto; padding: 2px; }
        .emoji-option { width: 40px; height: 40px; font-size: 1.3rem; padding: 0; margin: 0; background: rgba(0,0,0,0.45); border: 2px solid #555; border-radius: 8px; cursor: pointer; line-height: 1; flex: 0 0 auto; }
        .emoji-option.selected { border-color: #ffcc00; box-shadow: 0 0 10px rgba(255,204,0,0.45); }
        .emoji-option:active { transform: scale(0.94); }
        #broadcasterHud { display: none; position: fixed; top: 15px; left: 15px; background: rgba(88, 28, 135, 0.85); padding: 12px 14px; border-radius: 8px; font-weight: bold; font-size: 13px; border: 2px solid #c084fc; pointer-events: none; z-index: 1010; max-width: 280px; line-height: 1.45; }
        #broadcasterHud .hlv-title { color: #f3e8ff; font-size: 15px; margin-bottom: 6px; }
        #broadcasterPlayerList { display: none; position: fixed; top: 15px; right: 15px; background: rgba(15, 23, 42, 0.88); padding: 10px; border-radius: 8px; border: 2px solid #a855f7; min-width: 160px; max-width: 220px; max-height: 45vh; overflow-y: auto; z-index: 1010; font-size: 12px; touch-action: manipulation; -webkit-overflow-scrolling: touch; }
        #broadcasterPlayerList h4 { margin: 0 0 8px; color: #e9d5ff; font-size: 13px; text-align: center; }
        .bc-follow-btn { display: block; width: 100%; margin: 4px 0; padding: 8px 10px; background: rgba(88, 28, 135, 0.5); border: 1px solid #7c3aed; border-radius: 6px; color: #fff; font-size: 12px; cursor: pointer; text-align: left; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
        .bc-follow-btn.active { background: #7c3aed; border-color: #e9d5ff; box-shadow: 0 0 8px rgba(168,85,247,0.6); }
        .bc-follow-btn:active { transform: scale(0.97); }
        #broadcasterPuzzlePanel { display: none; position: fixed; bottom: 16px; right: 16px; width: min(92vw, 300px); background: rgba(15, 23, 42, 0.95); border: 2px solid #a855f7; border-radius: 10px; padding: 10px; z-index: 1010; box-shadow: 0 8px 30px rgba(0,0,0,0.5); touch-action: manipulation; }
        #broadcasterPuzzlePanel .bc-puzzle-title { color: #e9d5ff; font-weight: bold; font-size: 13px; margin-bottom: 6px; }
        #broadcasterPuzzlePanel .bc-puzzle-meta { color: #c4b5fd; font-size: 11px; margin-bottom: 8px; }
        #broadcasterBoard { width: 100% !important; }
        #hudCombat { }
        .hlv-option { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; color: #e9d5ff; font-size: 0.92rem; justify-content: center; cursor: pointer; }
        .hlv-option input { width: auto; margin: 0; cursor: pointer; }
        #broadcasterKeyInput { display: none; }
        #modeHint { color: #94a3b8; font-size: 0.82rem; line-height: 1.45; margin: 8px 0 10px; text-align: left; padding: 8px 10px; background: rgba(0,0,0,0.35); border-radius: 8px; border: 1px solid #475569; }
        .lobby-step { width: 100%; }
        .lobby-step-hidden { display: none !important; }
        .lobby-step-label { color: #94a3b8; font-size: 0.78rem; margin: 0 0 14px; letter-spacing: 1px; }
        .lobby-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
        .lobby-mode-card { padding: 14px 8px; margin: 0; background: rgba(0,0,0,0.45); border: 2px solid #475569; border-radius: 10px; color: #e2e8f0; font-size: 0.92rem; font-weight: bold; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.1s; line-height: 1.35; }
        .lobby-mode-card .mode-icon { display: block; font-size: 1.6rem; margin-bottom: 4px; }
        .lobby-mode-card.selected { border-color: #ffcc00; background: rgba(255,204,0,0.12); box-shadow: 0 0 16px rgba(255,204,0,0.25); }
        .lobby-mode-card:active { transform: scale(0.97); }
        .lobby-mode-panel { display: none; text-align: left; }
        .lobby-mode-panel.active { display: block; }
        .lobby-mode-panel label.field-label { display: block; color: #94a3b8; font-size: 0.8rem; margin: 10px 0 4px; text-align: left; }
        .lobby-step2-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
        .lobby-back-btn { width: auto; margin: 0; padding: 8px 14px; font-size: 0.88rem; background: #475569; }
        .lobby-footer-icons { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
        .lobby-icon-btn { width: auto; margin: 0; padding: 8px 14px; font-size: 0.85rem; background: rgba(0,0,0,0.45); border: 1px solid #555; }
        a.lobby-icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: white; font-weight: bold; box-sizing: border-box; }
        .lobby-icon-btn.guide { border-color: #475569; }
        .lobby-icon-btn.leaderboard { border-color: #7c3aed; background: rgba(88,28,135,0.35); }
        .lobby-icon-btn.season { border-color: #f59e0b; background: rgba(180,83,9,0.35); }
        .lobby-icon-btn.ranks { border-color: #38bdf8; background: rgba(14,116,144,0.35); }
        .lobby-icon-btn.inventory { border-color: #eab308; background: rgba(161,98,7,0.35); }
        .lobby-icon-btn.cup { border-color: #ffcc00; background: rgba(180,83,9,0.4); }
        .lobby-icon-btn.cup-mail { border-color: #38bdf8; background: rgba(14,116,144,0.4); }
        #cupMailBadge { display: inline-block; min-width: 1.1em; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #dc3545; font-size: 0.75rem; }
        .cup-mail-row { border-bottom: 1px solid #444; padding: 6px 0; }

        .inventory-panel {
            background: linear-gradient(165deg, #1e293b 0%, #111827 55%, #0f172a 100%);
            padding: 20px 16px 14px;
            border-radius: 14px;
            border: 2px solid #eab308;
            width: min(94vw, 460px);
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            text-align: center;
            box-shadow: 0 0 40px rgba(234, 179, 8, 0.2), inset 0 1px 0 rgba(253, 230, 138, 0.12);
        }
        .inventory-panel h3 {
            color: #fde68a;
            margin: 0 0 4px;
            font-family: Georgia, 'Times New Roman', serif;
            letter-spacing: 0.06em;
        }
        .inventory-user { font-size: 0.85rem; color: #fde68a; margin-bottom: 4px; }
        .inventory-tip { font-size: 0.76rem; color: #94a3b8; margin: 0 0 8px; line-height: 1.45; }
        .inventory-section-title {
            color: #e2e8f0;
            font-size: 0.78rem;
            text-align: left;
            margin: 10px 0 6px;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .inventory-showcase {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 4px 2px 8px;
            text-align: left;
            scrollbar-width: thin;
        }
        .inv-showcase-card {
            flex: 0 0 86px;
            background: rgba(0,0,0,0.35);
            border: 1px solid rgba(234, 179, 8, 0.35);
            border-radius: 12px;
            padding: 8px 6px 7px;
            text-align: center;
        }
        .inv-showcase-card img {
            width: 64px;
            height: 64px;
            display: block;
            margin: 0 auto 4px;
            filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
        }
        .inv-showcase-label {
            color: #f8fafc;
            font-size: 0.68rem;
            font-weight: 700;
            line-height: 1.25;
        }
        .inv-showcase-blurb {
            color: #fbbf24;
            font-size: 0.62rem;
            margin-top: 2px;
        }
        .inventory-fragments, .inventory-list {
            text-align: left;
            overflow-y: auto;
            max-height: 18vh;
        }
        .inventory-list { max-height: 30vh; display: flex; flex-direction: column; gap: 8px; }
        .inv-frag-card {
            background: rgba(0,0,0,0.35);
            border: 1px solid rgba(234, 179, 8, 0.28);
            border-radius: 12px;
            padding: 10px;
            margin-bottom: 8px;
        }
        .inv-frag-card.is-ready {
            border-color: #fbbf24;
            box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
        }
        .inv-frag-head, .inv-item-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .inv-art {
            width: 52px;
            height: 52px;
            flex-shrink: 0;
            border-radius: 50%;
            object-fit: contain;
            display: block;
            background: rgba(15, 23, 42, 0.65);
            box-shadow: 0 2px 8px rgba(0,0,0,0.4);
        }
        .inv-art-lg { width: 58px; height: 58px; }
        .inv-art-sm { width: 28px; height: 28px; border-radius: 8px; }
        .inv-showcase-card img.inv-art {
            margin: 0 auto 6px;
        }
        .inv-frag-piece-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
        }
        .inv-icon { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
        .inv-name { color: #f8fafc; font-weight: 700; font-size: 0.9rem; }
        .inv-hint, .inv-muted { color: #94a3b8; font-size: 0.74rem; margin-top: 2px; }
        .inv-ready { color: #fbbf24; font-size: 0.74rem; font-weight: 600; }
        .inv-qty {
            margin-left: auto;
            color: #eab308;
            font-weight: 700;
            font-size: 0.95rem;
            flex-shrink: 0;
        }
        .inv-frag-bar {
            margin-top: 8px;
            height: 7px;
            border-radius: 99px;
            background: #334155;
            overflow: hidden;
        }
        .inv-frag-fill {
            height: 100%;
            background: linear-gradient(90deg, #92400e, #eab308, #fde68a);
            border-radius: 99px;
        }
        .inv-how {
            margin: 8px 0 0;
            font-size: 0.76rem;
            color: #cbd5e1;
            line-height: 1.45;
        }
        .inv-item {
            width: 100%;
            margin: 0;
            padding: 10px;
            background: rgba(0,0,0,0.35);
            border: 1px solid #444;
            border-radius: 12px;
            text-align: left;
            cursor: pointer;
        }
        .inv-item.inv-rarity-common { border-color: #64748b; }
        .inv-item.inv-rarity-rare { border-color: #38bdf8; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.15); }
        .inv-item.inv-rarity-epic { border-color: #f59e0b; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18); }
        .inv-item.inv-rarity-legendary {
            border-color: #fde68a;
            background: linear-gradient(135deg, rgba(180, 83, 9, 0.25), rgba(0,0,0,0.35));
            box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.2);
        }
        .inv-item:hover, .inv-item[aria-expanded="true"] {
            border-color: #eab308;
            background: rgba(161, 98, 7, 0.22);
        }
        .inv-item-text { flex: 1; min-width: 0; }
        .inv-empty {
            color: #94a3b8;
            font-size: 0.85rem;
            line-height: 1.5;
            padding: 16px 8px;
            text-align: center;
        }
        .inv-wait { color: #38bdf8; font-size: 0.74rem; font-weight: 600; }
        .inv-redeem-btn {
            width: 100%;
            margin: 10px 0 0;
            padding: 10px 12px;
            background: linear-gradient(135deg, #eab308, #b45309);
            color: #111;
            border: none;
            border-radius: 10px;
            font-weight: 800;
            font-size: 0.88rem;
            cursor: pointer;
        }
        .inv-redeem-btn:hover { filter: brightness(1.06); }
        .redeem-panel {
            background: linear-gradient(165deg, #1e293b, #0f172a);
            border: 2px solid #eab308;
            border-radius: 14px;
            padding: 20px 16px 16px;
            width: min(94vw, 400px);
            max-height: 90vh;
            overflow-y: auto;
            text-align: left;
            box-shadow: 0 0 40px rgba(234, 179, 8, 0.22);
        }
        .redeem-panel h3 {
            margin: 0 0 8px;
            color: #fde68a;
            text-align: center;
            font-family: Georgia, 'Times New Roman', serif;
        }
        .redeem-hint {
            font-size: 0.78rem;
            color: #94a3b8;
            line-height: 1.45;
            margin: 0 0 12px;
            text-align: center;
        }
        .redeem-panel input, .redeem-panel textarea {
            width: 100%;
            box-sizing: border-box;
            margin: 0 0 10px;
            padding: 10px 12px;
            border-radius: 8px;
            border: 1px solid #475569;
            background: rgba(0,0,0,0.35);
            color: #f8fafc;
            font-size: 0.92rem;
        }
        .redeem-panel textarea { resize: vertical; min-height: 72px; }
        .redeem-actions { display: flex; gap: 8px; margin-top: 6px; }
        .redeem-actions button { flex: 1; margin: 0; }
        .rank-tier { border-bottom: 1px solid #333; padding: 8px 4px; }
        .rank-tier .rt-head { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 1rem; }
        .rank-tier .rt-min { margin-left: auto; color: #94a3b8; font-size: 0.82rem; }
        .rank-tier .rt-divs { color: #94a3b8; font-size: 0.78rem; margin: 3px 0 0 26px; }
        .rank-shirt { color: #f472b6; font-size: 0.78rem; margin-left: 26px; }
        .season-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; border-bottom: 1px solid #333; }
        .season-row.qualified { background: rgba(245,158,11,0.12); border-bottom-color: rgba(245,158,11,0.35); }
        .season-row .s-rank { min-width: 34px; font-weight: bold; }
        .season-row .s-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .season-row .s-gp { color: #38bdf8; font-weight: bold; }
        #gpMyRank { display: none; text-align: left; margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid #38bdf8; background: rgba(14,116,144,0.22); font-size: 0.92rem; line-height: 1.5; }
        #gpMyRank .gp-my-title { color: #fbbf24; font-weight: bold; margin-bottom: 4px; }
        #gpMyRank .gp-my-rank { color: #38bdf8; font-weight: bold; font-size: 1.05rem; }
        #gpMyRank .gp-my-tier { font-size: 0.82rem; margin-top: 2px; }
        .season-cut { text-align: center; color: #f59e0b; font-size: 0.78rem; margin: 6px 0; border-top: 1px dashed #f59e0b; padding-top: 6px; }
        #seasonCountdown { color: #fbbf24; font-weight: bold; }
        .lobby-action-row { display: flex; gap: 8px; margin-top: 4px; }
        .lobby-action-row button { flex: 1; margin-top: 8px; }
        .lobby-welcome-name { color: #38bdf8; font-size: 0.9rem; margin: 0 0 12px; }
        #guideModal { display: none; position: fixed; inset: 0; z-index: 25000; background: rgba(0,0,0,0.88); align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
        .guide-panel { background: #1e293b; border: 2px solid #ffcc00; border-radius: 14px; width: min(92vw, 420px); max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(255,204,0,0.25); }
        .guide-panel h2 { color: #ffcc00; margin: 0; padding: 16px 18px 8px; font-size: 1.25rem; text-align: center; }
        .guide-body { padding: 0 18px 12px; overflow-y: auto; text-align: left; font-size: 0.92rem; line-height: 1.55; color: #e2e8f0; }
        .guide-body h3 { color: #38bdf8; font-size: 0.98rem; margin: 14px 0 6px; }
        .guide-body ul { margin: 0 0 8px; padding-left: 18px; }
        .guide-body li { margin-bottom: 5px; }
        .guide-actions { padding: 12px 18px 16px; border-top: 1px solid #475569; }
        #inGameTip { display: none; position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: min(92vw, 520px); background: rgba(15,23,42,0.92); border: 2px solid #38bdf8; color: #e0f2fe; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: bold; text-align: center; z-index: 1001; pointer-events: none; line-height: 1.45; box-shadow: 0 4px 20px rgba(0,0,0,0.45); transition: opacity 0.4s; }
        #helpFab { display: none; position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: max(14px, env(safe-area-inset-left)); width: 44px; height: 44px; border-radius: 50%; border: 2px solid #38bdf8; background: rgba(15,23,42,0.85); color: #38bdf8; font-size: 1.2rem; font-weight: 900; z-index: 1002; cursor: pointer; padding: 0; margin: 0; box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
        #helpFab:active { transform: scale(0.94); }
        #toastContainer { position: fixed; bottom: max(24px, var(--sab)); left: 50%; transform: translateX(-50%) translateY(120%); max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: bold; text-align: center; z-index: 30000; pointer-events: none; opacity: 0; transition: transform 0.28s ease, opacity 0.28s ease; box-shadow: 0 8px 28px rgba(0,0,0,0.45); line-height: 1.45; }
        #toastContainer.toast-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
        #toastContainer.toast-info { background: rgba(15,23,42,0.95); border: 2px solid #38bdf8; color: #e0f2fe; }
        #toastContainer.toast-warn { background: rgba(69,26,3,0.95); border: 2px solid #fbbf24; color: #fef3c7; }
        #toastContainer.toast-error { background: rgba(69,10,10,0.95); border: 2px solid #f87171; color: #fee2e2; }
        #privacyModal { display: none; position: fixed; inset: 0; z-index: 26000; background: rgba(0,0,0,0.88); align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
        .privacy-panel { background: #1e293b; border: 2px solid #94a3b8; border-radius: 14px; width: min(92vw, 440px); max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; }
        .privacy-panel h2 { color: #e2e8f0; margin: 0; padding: 16px 18px 8px; font-size: 1.15rem; text-align: center; }
        .privacy-body { padding: 0 18px 12px; overflow-y: auto; text-align: left; font-size: 0.88rem; line-height: 1.55; color: #cbd5e1; }
        .privacy-body h3 { color: #38bdf8; font-size: 0.95rem; margin: 12px 0 6px; }
        .privacy-actions { padding: 12px 18px 16px; border-top: 1px solid #475569; }
        .privacy-link { color: #94a3b8; font-size: 0.78rem; margin-top: 10px; cursor: pointer; text-decoration: underline; background: none; border: none; width: 100%; }
        @media (pointer: coarse) and (orientation: landscape) {
            #inGameTip { bottom: max(8px, var(--sab)); font-size: 11px; max-width: 55vw; }
            #helpFab { bottom: auto; top: max(8px, var(--sat)); left: auto; right: max(8px, var(--sar)); width: 38px; height: 38px; font-size: 1rem; }
        }
        .perf-low #damageFlashOverlay { display: none !important; }
        .perf-low #gameCanvas { image-rendering: optimizeSpeed; }
    