/**
 * Tronx In-Game Roblox HUD Styles
 */

#game-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #000;
    overflow: hidden;
    user-select: none;
}

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

/* In-game Red Screen Flash on Damage / Death */
#game-damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.9);
    background: rgba(239, 68, 68, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    z-index: 1005;
}
#game-damage-overlay.active {
    opacity: 1;
}

/* Crosshair for shooting games */
#game-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 1004;
    display: none;
}
#game-crosshair::before, #game-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 4px #00F0FF;
}
#game-crosshair::before {
    top: 11px; left: 0; width: 24px; height: 2px;
}
#game-crosshair::after {
    left: 11px; top: 0; width: 2px; height: 24px;
}

/* In-Game Top Bar */
.game-topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1010;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-topbar-left, .game-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    border: none;
    font-size: 18px;
    transition: all 0.15s ease;
}
.game-topbar-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}
.game-topbar-btn.active {
    background: #FF6B00;
    color: #fff;
}

.game-logo-btn {
    padding: 4px;
    width: 38px;
    height: 38px;
}
.game-logo-btn img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.game-title-badge {
    font-size: 15px;
    font-weight: 700;
    color: #F3F4F6;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-stats-pill {
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* In-Game Notifications Banner */
#game-toast {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 107, 0, 0.4);
    border: 1px solid rgba(255, 107, 0, 0.5);
    z-index: 1015;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#game-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* In-Game Chat Overlay */
.game-chat-container {
    position: absolute;
    top: 56px;
    left: 16px;
    width: 320px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 10px;
    z-index: 1010;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}
.game-chat-container.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.game-chat-messages {
    height: 140px;
    overflow-y: auto;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}
.game-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.game-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chat-msg {
    line-height: 1.35;
    word-break: break-word;
}
.chat-sender {
    font-weight: 700;
    color: #60A5FA;
}
.chat-sender.system {
    color: #F59E0B;
}
.chat-sender.vip {
    color: #FBBF24;
}
.chat-body {
    color: #F3F4F6;
    margin-left: 4px;
}

.game-chat-input-wrapper {
    margin-top: 8px;
    position: relative;
}
.game-chat-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border 0.15s ease;
}
.game-chat-input:focus {
    border-color: #FF6B00;
}

/* In-Game Leaderboard (Top Right) */
.game-leaderboard {
    position: absolute;
    top: 56px;
    right: 16px;
    width: 260px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 1010;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}
.game-leaderboard.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9CA3AF;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #fff;
}
.leaderboard-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}
.badge-admin { background: #DC2626; color: #fff; }
.badge-vip { background: #D97706; color: #fff; }
.badge-pro { background: #7C3AED; color: #fff; }
.leaderboard-score {
    font-weight: 700;
    color: #FBBF24;
}

/* In-Game Hotbar / Backpack (Bottom Center) */
.game-hotbar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1010;
}

.hotbar-slot {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: #fff;
    transition: all 0.15s ease;
}
.hotbar-slot:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
}
.hotbar-slot.active {
    border-color: #FF6B00;
    background: rgba(255, 107, 0, 0.2);
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.5);
}

.slot-num {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 10px;
    font-weight: 800;
    color: #9CA3AF;
}
.slot-icon {
    font-size: 24px;
}
.slot-name {
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px;
}

/* Mobile Virtual Joystick & Jump Button */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 1012;
}

.virtual-joystick-base {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    pointer-events: auto;
    touch-action: none;
}
.virtual-joystick-stick {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FF6B00;
    position: absolute;
    top: 33px;
    left: 33px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.6);
}

.virtual-jump-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.virtual-jump-btn:active {
    background: #FF6B00;
    transform: scale(0.92);
}

/* Roblox Pause / Esc Menu Modal */
#game-esc-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1020;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#game-esc-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.esc-modal-box {
    width: 480px;
    background: #191B1F;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.esc-modal-header {
    background: #232527;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.esc-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.esc-modal-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.esc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #D1D5DB;
    font-size: 14px;
}
.esc-setting-row input[type="range"] {
    width: 180px;
    accent-color: #FF6B00;
}

.esc-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.esc-btn {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.esc-btn-resume {
    background: #10B981;
    color: #fff;
}
.esc-btn-resume:hover {
    background: #059669;
}
.esc-btn-reset {
    background: #EF4444;
    color: #fff;
}
.esc-btn-reset:hover {
    background: #DC2626;
}
.esc-btn-leave {
    background: #374151;
    color: #fff;
}
.esc-btn-leave:hover {
    background: #4B5563;
}
