:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;

    --accent-orange: #e89948;
    --accent-orange-dim: #c97a2e;
    --accent-glow: rgba(232, 153, 72, 0.15);

    --text-primary: #e0e0e0;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --border-color: #2a2a2a;
    --border-active: #404040;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 14px;
    /* Scaled down base size */
}

/* Background Effects */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(232, 153, 72, 0.03) 0%, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    z-index: -2;
    pointer-events: none;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.1) 51%);
    background-size: 100% 4px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

/* Layout */
.container {
    max-width: 95%;
    /* Full width utilization */
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--border-color);
    /* Stronger border */
    margin-bottom: 3rem;
    /* More space below header */
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    color: var(--accent-orange);
    font-size: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--success);
    margin: 0;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        opacity: 0.7;
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Auth Buttons */
.btn-steam {
    background: rgba(27, 40, 56, 0.8);
    border: 1px solid #2a475e;
    color: #fff;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    white-space: nowrap;
}

.btn-steam:hover {
    background: #2a475e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent-orange);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.user-info {
    font-family: var(--font-heading);
    line-height: 1.2;
}

.user-name {
    color: var(--accent-orange);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--accent-orange);
    letter-spacing: 0.05em;
}

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    border-left: 1px solid var(--border-color);
    padding-left: 0.75rem;
    margin-left: 0.5rem;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    /* Increased spacing */
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

/* Tactical Corners */
.stat-card::before,
.stat-card::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--accent-orange);
    transition: all 0.3s ease;
}

.stat-card::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.stat-card::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.stat-card:hover {
    border-color: var(--accent-orange-dim);
    background: var(--bg-card-hover);
}

.stat-icon {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Mission Control */
.mission-control {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-orange);
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    clip-path: polygon(0 0,
            100% 0,
            100% calc(100% - 20px),
            calc(100% - 20px) 100%,
            0 100%);
    /* Cut corner bottom right */
}

/* Add a "tech" corner visual */
.mission-control::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--accent-orange);
}

.card-header h3 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.25rem;
    margin: 0;
}

.mission-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#activeMissionControls,
#inactiveMissionControls {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.mission-status {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-right: auto;
}

/* Form Elements */
.form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    min-width: 300px;
    transition: all 0.2s;
    border-radius: 0;
    /* Square look */
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(232, 153, 72, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.btn-danger,
.btn-success {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 0.6rem 2rem;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.btn-success:hover {
    background: var(--success);
    color: #000;
}

/* Online Players & Scoreboard */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title h2 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.25rem;
    margin: 0;
}

.player-count-badge {
    background: rgba(232, 153, 72, 0.1);
    color: var(--accent-orange);
    padding: 0.1rem 0.6rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

.players-section {
    margin-bottom: 4rem;
    /* Increased spacing between players and feed */
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--border-color);
    /* Visible separator */
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Compact grid */
    gap: 0.75rem;
}

.player-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.player-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--success);
    opacity: 0;
    transition: opacity 0.2s;
}

.player-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.player-item:hover::before {
    opacity: 1;
}

.player-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.player-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Event Feed */
.feed-section {
    margin-top: 2rem;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.feed-title h2 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.25rem;
}

.event-feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-item {
    background: rgba(17, 17, 17, 0.6);
    border-left: 2px solid;
    padding: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.event-item.kill {
    border-color: var(--danger);
}

.event-item.connect {
    border-color: var(--success);
}

.event-item.disconnect {
    border-color: var(--text-muted);
}

.event-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 0.8;
    width: 100px;
}

.event-message {
    flex: 1;
    font-family: 'Inter', monospace;
    /* Monospace for alignment */
}

.player-tag {
    color: var(--text-primary);
    font-weight: 600;
}

.player-tag.victim-tag {
    color: var(--text-secondary);
}

.player-tag.ai-tag {
    color: var(--accent-orange);
}

.weapon-tag {
    color: var(--text-muted);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
}

/* Scoreboard Table */
.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
}

.scoreboard-table th {
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    padding: 0.75rem;
}

.scoreboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.scoreboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-actions {
        display: none;
        /* Simplify for mobile, or better: stack it */
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--accent-orange);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    clip-path: polygon(0 0,
            100% 0,
            100% calc(100% - 15px),
            calc(100% - 15px) 100%,
            0 100%);
    /* Tech corner style */
}

/* Tech corner pseudo-element */
.cookie-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, transparent 50%, var(--accent-orange) 50%);
    pointer-events: none;
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cookie-icon {
    font-size: 2rem;
    color: var(--accent-orange);
}

.cookie-text h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 1.1rem;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.cookie-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.cookie-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cookie {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-cookie:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-cookie.accept {
    background: rgba(232, 153, 72, 0.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.btn-cookie.accept:hover {
    background: var(--accent-orange);
    color: #000;
}

/* Tactical Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.tactical-modal {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--accent-orange);
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    animation: scaleIn 0.2s forwards;
}

.tactical-modal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 20%;
    height: 2px;
    background: var(--accent-orange);
    box-shadow: 0 0 10px var(--accent-orange);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    text-transform: uppercase;
    color: var(--accent-orange);
    letter-spacing: 0.1em;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.btn-modal {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-modal:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-modal.confirm {
    background: rgba(232, 153, 72, 0.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.btn-modal.confirm:hover {
    background: var(--accent-orange);
    color: #000;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

/* Clear Button */
.clear-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.clear-btn .material-icons {
    font-size: 1.1rem;
}

/* Admin Panel & Tabs */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    margin-top: -1rem;
    /* Pull up closer to header */
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #000;
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(232, 153, 72, 0.3);
}

/* Animated Fade */
.animated-fade {
    animation: fadeIn 0.3s ease-out;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Role Select */
.role-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.role-select:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.invite-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
}

.btn-icon.delete:hover {
    color: var(--danger);
}