/* FPS Arena Panel - Morrhollow Terminal Style */
/* Matches Economy Hub V2 design essence: glowing, slick, semi-transparent */

:root {
    --fps-gap-xs: 3px;
    --fps-gap-sm: 4px;
    --fps-gap-md: 6px;
    --fps-gap-lg: 8px;
    --fps-pad-xs: 4px;
    --fps-pad-sm: 6px;
    --fps-pad-md: 8px;
    --fps-pad-lg: 12px;

    /* Morrhollow Terminal Colors - Combat theme (red/orange tint) */
    --fps-bg-dark: rgba(15, 15, 25, 0.95);
    --fps-bg-darker: rgba(8, 8, 15, 0.98);
    --fps-combat-glow: #ef4444;
    --fps-combat-accent: #dc2626;
    --fps-gold-accent: rgba(212, 175, 55, 0.9);
    --fps-gold-border: rgba(212, 175, 55, 0.4);
    --fps-green-glow: #4ade80;
}

.panel-fps-arena {
    position: fixed;
    top: 50px;
    left: 10px;
    width: min(1200px, calc(100vw - 20px));
    max-width: 1200px;
    height: calc(100vh - 100px);
    max-height: 800px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    /* Morrhollow-style multi-layer glow shadow (combat theme) */
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(239, 68, 68, 0.15),
        0 0 20px rgba(212, 175, 55, 0.1);
    border: 1px solid var(--fps-gold-border);
    font-family: 'RemiliaMincho', serif;
    font-size: 12px;
    color: #E5E7EB;
    user-select: none;
    background: transparent;
    animation: fps-panel-slide-in 0.3s ease-out;
    margin: 0;
    padding: 0;
}

/* CRITICAL: Remove padding from .panel-content wrapper */
.panel-fps-arena .panel-content {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Hide the auto-generated .panel-close button */
.panel-fps-arena .panel-close {
    display: none !important;
}

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

.panel-fps-arena::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        var(--fps-bg-dark) 0%,
        var(--fps-bg-darker) 50%,
        var(--fps-bg-dark) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* Header - Compact Single Row */
.fps-arena-header {
    background: linear-gradient(180deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(51, 65, 85, 0.98) 100%);
    min-height: 30px;
    max-height: 30px;
    border-bottom: 1px solid var(--fps-gold-border);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 10px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(239, 68, 68, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    gap: 8px;
}

.fps-arena-header h2 {
    font-size: 11px;
    color: var(--fps-gold-accent);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.9;
    white-space: nowrap;
    text-shadow:
        0 0 10px rgba(239, 68, 68, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

.fps-arena-header .wallet-actions {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Body - FIXED HEIGHT, NO SCROLL */
.fps-arena-body {
    flex: 1;
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== LAUNCHER VIEW ===== */

.fps-launcher {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--fps-pad-lg);
    overflow-y: auto;
    background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.05) 0%, transparent 70%);
}

.fps-launcher-content {
    max-width: 600px;
    width: 100%;
    background: linear-gradient(180deg,
        var(--fps-bg-dark) 0%,
        var(--fps-bg-darker) 100%);
    border: 1px solid var(--fps-gold-border);
    border-radius: 6px;
    padding: var(--fps-pad-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 20px rgba(239, 68, 68, 0.1);
}

/* Hero Section */
.fps-hero {
    text-align: center;
    padding-bottom: var(--fps-pad-lg);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: var(--fps-pad-lg);
}

.fps-hero h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--fps-gold-accent);
    margin: 0 0 var(--fps-gap-xs) 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.fps-subtitle {
    color: rgba(186, 166, 116, 0.6);
    margin: 0 0 var(--fps-pad-md) 0;
    font-size: 11px;
    line-height: 1.4;
}

.fps-player-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--fps-gap-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    padding: var(--fps-pad-sm) var(--fps-pad-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 8px rgba(239, 68, 68, 0.1);
}

.fps-player-badge .player-label {
    color: rgba(186, 166, 116, 0.7);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.fps-player-badge .player-name {
    color: var(--fps-combat-glow);
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    font-family: 'Courier New', monospace;
}

/* Form Section */
.fps-form {
    display: flex;
    flex-direction: column;
    gap: var(--fps-gap-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--fps-gap-xs);
}

.form-group label {
    color: var(--fps-gold-accent);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fps-select {
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    padding: var(--fps-pad-md);
    color: #ffffff;
    font-size: 12px;
    font-family: 'RemiliaMincho', serif;
    transition: all 0.2s ease;
    cursor: pointer;
}

.fps-select:focus {
    outline: none;
    border-color: var(--fps-combat-glow);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.fps-select option {
    background: rgba(10, 10, 30, 0.95);
    padding: var(--fps-pad-sm);
}

/* Primary Button - Large & Prominent */
.fps-btn {
    padding: var(--fps-pad-lg);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'RemiliaMincho', serif;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--fps-gap-md);
}

.fps-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(239, 68, 68, 0.2),
        transparent);
    transition: left 0.5s ease;
}

.fps-btn:hover::before {
    left: 100%;
}

.fps-btn-primary {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.3) 0%,
        rgba(239, 68, 68, 0.4) 100%);
    border: 1px solid var(--fps-combat-glow);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.fps-btn-primary:hover {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.4) 0%,
        rgba(239, 68, 68, 0.5) 100%);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.fps-btn .btn-icon {
    font-size: 16px;
}

.fps-btn .btn-text {
    font-size: 11px;
}

.fps-status {
    text-align: center;
    padding: var(--fps-pad-sm);
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
    min-height: 24px;
}

.fps-status-info {
    background: rgba(74, 222, 128, 0.1);
    color: var(--fps-green-glow);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.fps-status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--fps-combat-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.fps-status-success {
    background: rgba(74, 222, 128, 0.1);
    color: var(--fps-green-glow);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Controls Info - Compact Grid */
.fps-controls-info {
    margin-top: var(--fps-pad-lg);
    padding-top: var(--fps-pad-lg);
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.fps-controls-info h4 {
    color: var(--fps-gold-accent);
    margin: 0 0 var(--fps-gap-md) 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--fps-gap-sm);
    font-size: 9px;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--fps-pad-xs);
    background: rgba(30, 41, 59, 0.3);
    border-radius: 3px;
}

.control-item kbd {
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--fps-combat-glow);
    font-family: 'Courier New', monospace;
    font-size: 8px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.control-item span {
    color: rgba(186, 166, 116, 0.7);
    font-size: 8px;
}

/* ===== GAME VIEW ===== */

.fps-game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000000;
}

#fps-render-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* Exit Arena Button in Header */
.exit-arena-btn {
    animation: pulse-red 2s infinite;
}

.exit-arena-btn:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    }
}

/* HUD Overlays - Works both in panel and fullscreen */
#fps-hud-overlay {
    font-family: 'Courier New', monospace;
    color: #fff;
}

.fps-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

.hud-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    gap: var(--fps-gap-md);
}

.hud-stats {
    background: var(--fps-bg-darker);
    padding: var(--fps-pad-sm) var(--fps-pad-md);
    border-radius: 4px;
    border: 1px solid var(--fps-gold-border);
    display: flex;
    gap: var(--fps-gap-lg);
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--fps-gold-accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 10px rgba(239, 68, 68, 0.1);
}

.hud-stats span {
    color: #ffffff;
    font-weight: 600;
}

.hud-position {
    background: var(--fps-bg-darker);
    padding: var(--fps-pad-sm) var(--fps-pad-md);
    border-radius: 4px;
    border: 1px solid var(--fps-gold-border);
    font-family: 'Courier New', monospace;
    font-size: 8px;
    color: rgba(186, 166, 116, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 10px rgba(239, 68, 68, 0.1);
}

.hud-bottom {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: min(400px, 80vw);
}

.health-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--fps-gold-border);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fps-green-glow), #10b981);
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

/* Kill Feed */
.kill-feed {
    position: absolute;
    top: 80px;
    right: 10px;
    width: min(300px, 40vw);
    pointer-events: none;
    z-index: 101;
}

.kill-feed-entry {
    background: var(--fps-bg-darker);
    padding: var(--fps-pad-xs) var(--fps-pad-sm);
    margin-bottom: var(--fps-gap-xs);
    border-radius: 3px;
    border-left: 2px solid var(--fps-combat-glow);
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: #ffffff;
    animation: slideInRight 0.3s ease;
    transition: opacity 0.3s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 8px rgba(239, 68, 68, 0.15);
}

.kill-feed-entry.fade-out {
    opacity: 0;
}

.kill-feed-entry.headshot {
    border-left-color: var(--fps-gold-accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 12px rgba(212, 175, 55, 0.3);
}

.kill-feed-entry .killer {
    color: var(--fps-gold-accent);
    font-weight: 600;
}

.kill-feed-entry .victim {
    color: var(--fps-combat-glow);
}

.kill-feed-entry .weapon {
    color: rgba(186, 166, 116, 0.6);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Match Timer */
.match-timer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fps-bg-darker);
    padding: var(--fps-pad-sm) var(--fps-pad-lg);
    border-radius: 4px;
    border: 1px solid var(--fps-gold-border);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--fps-gold-accent);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    z-index: 102;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 10px rgba(239, 68, 68, 0.1);
}

.match-timer.ending-soon {
    border-color: var(--fps-combat-glow);
    color: var(--fps-combat-glow);
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 0 15px rgba(239, 68, 68, 0.3);
    }
    50% {
        opacity: 0.7;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 0 25px rgba(239, 68, 68, 0.5);
    }
}

/* Match Messages */
.match-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 700;
    color: var(--fps-gold-accent);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    z-index: 103;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    font-family: 'RemiliaMincho', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match-message.visible {
    opacity: 1;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Pickup Notifications */
.pickup-notifications {
    position: absolute;
    bottom: 80px;
    right: 10px;
    width: min(200px, 30vw);
    pointer-events: none;
    z-index: 101;
}

.pickup-notification {
    background: rgba(74, 222, 128, 0.2);
    padding: var(--fps-pad-xs) var(--fps-pad-sm);
    margin-bottom: var(--fps-gap-xs);
    border-radius: 3px;
    border: 1px solid var(--fps-green-glow);
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--fps-green-glow);
    animation: slideUp 0.3s ease, fadeOut 2s ease 1.7s;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Respawn Screen */
.respawn-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.respawn-screen.visible {
    opacity: 1;
    pointer-events: all;
}

.respawn-content {
    text-align: center;
    background: var(--fps-bg-dark);
    padding: calc(var(--fps-pad-lg) * 3);
    border-radius: 6px;
    border: 1px solid var(--fps-combat-accent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 30px rgba(239, 68, 68, 0.3);
}

.respawn-content h2 {
    font-size: 24px;
    color: var(--fps-combat-glow);
    margin: 0 0 var(--fps-pad-lg) 0;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.respawn-timer-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--fps-gold-accent);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Debug Info */
.debug-info {
    position: absolute;
    top: 80px;
    left: 10px;
    background: var(--fps-bg-darker);
    padding: var(--fps-pad-sm) var(--fps-pad-md);
    border-radius: 4px;
    border: 1px solid var(--fps-gold-border);
    font-family: 'Courier New', monospace;
    font-size: 8px;
    color: rgba(186, 166, 116, 0.7);
    line-height: 1.5;
    z-index: 104;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 10px rgba(239, 68, 68, 0.1);
}

/* Disconnect Button */
.fps-disconnect-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--fps-bg-darker);
    border: 1px solid var(--fps-combat-accent);
    color: var(--fps-combat-glow);
    padding: var(--fps-pad-xs) var(--fps-pad-md);
    border-radius: 4px;
    font-weight: 600;
    font-size: 9px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    z-index: 105;
    font-family: 'RemiliaMincho', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 8px rgba(239, 68, 68, 0.1);
}

.fps-disconnect-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--fps-combat-glow);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Header Action Buttons */
.help-btn,
.close-btn {
    padding: 2px 6px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 3px;
    color: rgba(186, 166, 116, 0.7);
    font-family: 'RemiliaMincho', serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.help-btn:hover,
.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--fps-combat-glow);
    color: var(--fps-combat-glow);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* ===== SCROLLBAR STYLING ===== */

.fps-launcher::-webkit-scrollbar {
    width: 6px;
}

.fps-launcher::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.fps-launcher::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.3);
    border-radius: 3px;
}

.fps-launcher::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
    .panel-fps-arena {
        width: min(95vw, 1000px);
    }
}

@media (max-width: 768px) {
    .panel-fps-arena {
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 70px);
    }

    .fps-launcher-content {
        padding: var(--fps-pad-md);
    }

    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hud-top {
        flex-direction: column;
        gap: var(--fps-gap-xs);
    }

    .hud-stats {
        font-size: 8px;
        gap: var(--fps-gap-sm);
    }

    .hud-bottom {
        width: calc(100% - 20px);
        bottom: 20px;
    }

    .kill-feed {
        width: min(250px, 50vw);
        top: 60px;
    }

    .match-message {
        font-size: 20px;
    }

    .respawn-content h2 {
        font-size: 18px;
    }

    .respawn-timer-display {
        font-size: 36px;
    }
}

/* ===== UTILITY CLASSES ===== */

.panel-fps-arena.dragging {
    cursor: move !important;
    user-select: none !important;
}

/* Loading spinner for game initialization */
.fps-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--fps-gold-accent);
    text-align: center;
    font-family: 'RemiliaMincho', serif;
}

.fps-loading::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* =================================================================
   LOADOUT SYSTEM - FPS Arena Combat Theme
   ================================================================= */

.fps-loadout-section {
    margin: var(--fps-pad-lg) 0;
    padding: var(--fps-pad-lg);
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.95) 0%, rgba(30, 20, 25, 0.9) 100%);
    border: 1px solid var(--fps-gold-border);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.fps-loadout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--fps-pad-lg);
    padding-bottom: var(--fps-pad-md);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.fps-loadout-header h3 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
    color: var(--fps-combat-glow);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loadout-subtitle {
    font-size: 9px;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.energy-display-fps {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.energy-display-fps .energy-icon {
    font-size: 16px;
}

.energy-display-fps .energy-value {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
}

.energy-display-fps .energy-label {
    font-size: 8px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fps-loadout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fps-loadout-slot {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 20, 35, 0.8) 0%, rgba(15, 15, 25, 0.9) 100%);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.fps-loadout-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(212, 175, 55, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 6px;
}

.fps-loadout-slot:hover {
    border-color: var(--fps-combat-glow);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.fps-loadout-slot:hover::before {
    opacity: 1;
}

.fps-loadout-slot.weapon-slot {
    border-color: rgba(239, 68, 68, 0.3);
}

.fps-loadout-slot.weapon-slot:hover {
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.fps-loadout-slot.ability-slot {
    border-color: rgba(168, 85, 247, 0.3);
}

.fps-loadout-slot.ability-slot:hover {
    border-color: #a855f7;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.fps-loadout-slot .slot-keybind {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    border: 1px solid rgba(251, 191, 36, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slot-content-fps {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slot-icon-fps {
    font-size: 32px;
    min-width: 32px;
    text-align: center;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

.slot-details-fps {
    flex: 1;
    min-width: 0;
}

.slot-name-fps {
    font-size: 11px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 2px;
    text-shadow: 0 0 6px rgba(229, 231, 235, 0.3);
}

.slot-type-fps,
.slot-effect-fps {
    font-size: 9px;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.slot-stats-fps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.slot-stats-fps > span {
    font-size: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    color: #cbd5e1;
    font-weight: 600;
}

/* Ability Selection Modal - Unified System Style */
.fps-ability-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-fade-in 0.3s ease;
}

.fps-modal-content {
    position: relative;
    width: min(700px, calc(100vw - 40px));
    max-height: 80vh;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    box-shadow:
        rgba(212, 175, 55, 0.3) 0 0 40px,
        rgba(212, 175, 55, 0.2) 0 0 20px,
        rgba(212, 175, 55, 0.1) 1px 1px 3px inset,
        rgba(0, 0, 0, 0.7) 0 12px 40px;
    overflow: hidden;
    animation: modal-slide-in 0.4s ease-out;
    display: flex;
    flex-direction: column;
    font-family: 'RemiliaMincho', serif;
}

.fps-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(51, 65, 85, 0.98) 50%,
        rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
    pointer-events: none;
}

.fps-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    height: 2.25rem;
    background: linear-gradient(0deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.98));
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    position: relative;
    z-index: 20;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.fps-modal-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(212, 175, 55, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.fps-modal-close {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: rgba(212, 175, 55, 0.7);
    font-size: 14px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.fps-modal-close:hover {
    background: linear-gradient(180deg, rgba(51, 65, 85, 0.95) 0%, rgba(71, 85, 105, 0.98) 100%);
    border-color: rgba(212, 175, 55, 0.6);
    color: rgba(212, 175, 55, 1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 8px rgba(212, 175, 55, 0.3);
}

.fps-modal-body {
    max-height: calc(80vh - 80px);
    overflow-y: auto;
    padding: var(--fps-pad-lg);
}

.fps-ability-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.fps-ability-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 20, 35, 0.9);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fps-ability-card:hover {
    border-color: var(--fps-combat-glow);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.fps-ability-card.weapon:hover {
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.fps-ability-card.ability:hover {
    border-color: #a855f7;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.fps-ability-card .ability-icon-fps {
    font-size: 40px;
    min-width: 40px;
    text-align: center;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.ability-info-fps {
    flex: 1;
    min-width: 0;
}

.ability-name-fps {
    font-size: 12px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.ability-type-fps,
.ability-effect-fps {
    font-size: 9px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ability-stats-fps {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ability-stats-fps > span {
    font-size: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    color: #cbd5e1;
    font-weight: 600;
}

.ability-desc-fps {
    font-size: 9px;
    color: #64748b;
    line-height: 1.3;
}

/* Modal animations - Unified System Style */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fps-loadout-grid {
        grid-template-columns: 1fr;
    }

    .fps-ability-grid {
        grid-template-columns: 1fr;
    }

    .fps-loadout-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ========================================
   TAB SYSTEM & EVENT FEED
   ======================================== */

/* Tab Navigation */
.fps-arena-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0 var(--fps-pad-md);
    gap: var(--fps-gap-sm);
}

.fps-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: var(--fps-pad-md) var(--fps-pad-lg);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    font-family: 'RemiliaMincho', serif;
    letter-spacing: 0.3px;
}

.fps-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(212, 175, 55, 0.05);
}

.fps-tab.active {
    color: var(--fps-gold-accent);
    border-bottom-color: var(--fps-gold-accent);
    font-weight: 600;
    background: rgba(212, 175, 55, 0.08);
}

/* Events Container */
.fps-events-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.events-header {
    padding: var(--fps-pad-lg);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.events-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--fps-gold-accent);
    margin: 0 0 var(--fps-pad-md) 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Event Filters */
.event-filters {
    display: flex;
    gap: var(--fps-gap-sm);
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--fps-pad-xs) var(--fps-pad-md);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'RemiliaMincho', serif;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: var(--fps-gold-accent);
    color: rgba(0, 0, 0, 0.9);
    border-color: var(--fps-gold-accent);
    font-weight: 600;
}

/* Event Stream */
.event-stream {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--fps-pad-md);
    background: var(--fps-bg-darker);
}

/* Custom scrollbar for event stream */
.event-stream::-webkit-scrollbar {
    width: 8px;
}

.event-stream::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.event-stream::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.event-stream::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Event Loading */
.event-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--fps-gold-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--fps-pad-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.event-loading p {
    font-size: 11px;
    margin: 0;
}

/* No Events */
.no-events {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.no-events p {
    font-size: 13px;
    margin: 0 0 var(--fps-pad-sm) 0;
}

.no-events small {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
}

/* Event Items */
.event-item {
    display: flex;
    gap: var(--fps-pad-md);
    padding: var(--fps-pad-md);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: var(--fps-gap-md);
    border-left: 3px solid transparent;
    animation: event-slide-in 0.3s ease;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(2px);
}

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

/* Event type colors */
.event-item.event-kills {
    border-left-color: #ef4444;
}

.event-item[data-event-type="fps_streak"] {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.event-item.event-players {
    border-left-color: #3b82f6;
}

.event-item.event-loot {
    border-left-color: #10b981;
}

.event-item.event-match {
    border-left-color: #8b5cf6;
}

/* Event Icon */
.event-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

/* Event Content */
.event-content {
    flex: 1;
    min-width: 0;
}

.event-message {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--fps-gap-xs);
    word-wrap: break-word;
}

.event-meta {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
}

/* Stats Container */
.fps-stats-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.stats-header {
    padding: var(--fps-pad-lg);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.stats-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--fps-gold-accent);
    margin: 0 0 var(--fps-gap-sm) 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.stats-subtitle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Stats Placeholder */
.stats-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: var(--fps-bg-darker);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: var(--fps-pad-lg);
    opacity: 0.3;
}

.stats-placeholder p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--fps-pad-lg);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--fps-gap-md);
}

.feature-list li {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    padding: var(--fps-pad-sm) var(--fps-pad-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 2px solid rgba(212, 175, 55, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fps-arena-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fps-tab {
        flex-shrink: 0;
        padding: var(--fps-pad-sm) var(--fps-pad-md);
        font-size: 10px;
    }

    .event-filters {
        gap: var(--fps-gap-xs);
    }

    .filter-btn {
        font-size: 9px;
        padding: 3px var(--fps-pad-sm);
    }

    .event-item {
        padding: var(--fps-pad-sm);
        gap: var(--fps-pad-sm);
    }

    .event-message {
        font-size: 10px;
    }

    .event-meta {
        font-size: 8px;
    }
}
