/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #1e2a45;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a80;
    --accent: #00d4ff;
    --accent-hover: #00b8e6;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --border: #2a2a4a;
    --radius: 8px;
    --radius-lg: 12px;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ===== Navbar ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-brand a:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-badge {
    color: var(--accent);
    font-weight: 500;
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 60px - 60px);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #e8303e;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.btn-discord {
    background: #5865F2;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-discord:hover {
    background: #4752c4;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* ===== Input Fields ===== */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ===== Login Page ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.login-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--accent);
}

.login-step h2 {
    margin-bottom: 0.5rem;
}

.login-step p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-step .btn {
    width: 100%;
}

.error-text {
    color: var(--danger);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* ===== Dashboard ===== */
.dashboard h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.game-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.game-card-header.ut2004 {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 100%);
    border-bottom-color: #5a3d7a;
}

.game-card-header.cs2 {
    background: linear-gradient(135deg, #1a1a2e 0%, #1b2d3d 100%);
    border-bottom-color: #3d5a7a;
}

.game-card-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.game-card-body {
    padding: 1.25rem 1.5rem;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
}

.status-label {
    color: var(--text-secondary);
}

.game-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.game-card-footer .btn {
    width: 100%;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-online {
    background: rgba(46, 213, 115, 0.15);
    color: var(--success);
}

.status-offline {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

.status-starting {
    background: rgba(255, 165, 2, 0.15);
    color: var(--warning);
}

.status-unknown {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-muted);
}

/* ===== Recent Activity ===== */
.recent-activity h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.activity-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

/* ===== TOTP Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        gap: 1rem;
        padding-bottom: 0.25rem;
    }

    .main-content {
        padding: 1rem;
    }

    .game-cards {
        grid-template-columns: 1fr;
    }

    .server-panels {
        grid-template-columns: 1fr;
    }
}

/* ===== Server Page ===== */
.server-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.agent-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.agent-bar.agent-online {
    border-color: var(--success);
    background: rgba(46, 213, 115, 0.08);
}

.agent-bar.agent-offline {
    border-color: var(--danger);
    background: rgba(255, 71, 87, 0.08);
}

.server-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.server-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.server-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.server-panel-header.ut2004 {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 100%);
}

.server-panel-header.cs2 {
    background: linear-gradient(135deg, #1a1a2e 0%, #1b2d3d 100%);
}

.server-panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.server-panel-body {
    padding: 1.25rem 1.5rem;
}

.server-actions {
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.server-actions .btn {
    flex: 1;
}

.map-section,
.vote-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.map-section h3,
.vote-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.map-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ===== Game Type Selector ===== */
.gametype-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.gametype-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.6rem 0.5rem;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
    color: var(--text-primary);
}

.gametype-btn:hover {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.06);
}

.gametype-btn.active {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px var(--accent-glow);
}

.gametype-icon {
    font-size: 1.3rem;
}

.gametype-label {
    font-weight: 600;
    font-size: 0.8rem;
}

.gametype-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== Mutator Section ===== */
.mutator-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.mutator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.4rem;
}

.mutator-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.mutator-option:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: var(--border);
}

.mutator-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.mutator-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.mutator-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.map-row .input-field {
    flex: 1;
}

/* ===== Vote Results ===== */
.vote-results {
    margin-top: 0.75rem;
}

.vote-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.vote-map-name {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: right;
}

.vote-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #0098b3);
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 4px;
}

.vote-count {
    min-width: 24px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ===== Stats Table ===== */
.stats-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.stats-table thead {
    background: var(--bg-secondary);
}

.stats-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.stats-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.04);
}

.stats-table .col-rank {
    width: 50px;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
}

.stats-table .kd-value {
    font-weight: 700;
    color: var(--accent);
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: rgba(0, 212, 255, 0.08) !important;
}

.detail-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.text-muted {
    color: var(--text-muted);
}

/* ===== Rank Highlights ===== */
.rank-gold {
    background: rgba(255, 215, 0, 0.08) !important;
}

.rank-gold .col-rank {
    color: #ffd700 !important;
}

.rank-silver {
    background: rgba(192, 192, 192, 0.06) !important;
}

.rank-silver .col-rank {
    color: #c0c0c0 !important;
}

.rank-bronze {
    background: rgba(205, 127, 50, 0.06) !important;
}

.rank-bronze .col-rank {
    color: #cd7f32 !important;
}

/* ===== Podium ===== */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 120px;
}

.podium-medal {
    font-size: 2rem;
}

.podium-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
}

.podium-name:hover {
    color: var(--accent);
}

.podium-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.podium-bar {
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
}

.gold .podium-bar {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-bottom: none;
}

.silver .podium-bar {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.25) 0%, rgba(192, 192, 192, 0.08) 100%);
    border: 1px solid rgba(192, 192, 192, 0.25);
    border-bottom: none;
}

.bronze .podium-bar {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.25) 0%, rgba(205, 127, 50, 0.08) 100%);
    border: 1px solid rgba(205, 127, 50, 0.25);
    border-bottom: none;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Match Detail ===== */
.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-link a:hover {
    color: var(--accent);
}

.match-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.match-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.match-meta strong {
    color: var(--accent);
}

.detail-section {
    margin-bottom: 1.5rem;
}

/* ===== Kill Feed ===== */
.kill-feed {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    max-height: 500px;
    overflow-y: auto;
}

.kill-entry {
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
    font-size: 0.9rem;
}

.kill-entry:last-child {
    border-bottom: none;
}

.kill-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: monospace;
}

.kill-attacker {
    color: var(--success);
    font-weight: 600;
}

.kill-victim {
    color: var(--danger);
    font-weight: 600;
}

.kill-weapon {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.hs-badge {
    display: inline-block;
    background: var(--warning);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    vertical-align: middle;
}

.round-label {
    display: inline-block;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.3rem;
}

/* ===== Weapon Stats Bars ===== */
.weapon-stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.weapon-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
}

.weapon-name {
    min-width: 140px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: right;
}

.weapon-bar-track {
    flex: 1;
    height: 18px;
    background: var(--bg-input);
    border-radius: 9px;
    overflow: hidden;
}

.weapon-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #0098b3);
    border-radius: 9px;
    transition: width 0.3s ease;
    min-width: 4px;
}

.weapon-count {
    min-width: 55px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: right;
}

.weapon-hs {
    min-width: 50px;
    font-size: 0.8rem;
    color: var(--warning);
    font-weight: 600;
}

/* ===== Player Profile ===== */
.player-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.player-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

/* ===== Stat Cards ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.stat-card.accent {
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.06);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.stat-card.accent .stat-value {
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Leaderboard & Matches Page ===== */
.leaderboard-page h1,
.matches-page h1,
.match-detail-page h1,
.player-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.game-icon {
    font-size: 1rem;
}

/* ===== Responsive (Stats pages) ===== */
@media (max-width: 768px) {
    .podium {
        gap: 0.5rem;
    }

    .podium-slot {
        min-width: 90px;
    }

    .podium-bar {
        height: 60px !important;
    }

    .gold .podium-bar {
        height: 90px !important;
    }

    .stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .weapon-name {
        min-width: 100px;
        font-size: 0.8rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .input-field {
        max-width: 100% !important;
    }

    .tab-bar {
        overflow-x: auto;
    }
}

/* ===== Live Log ===== */
.livelog-page h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.livelog-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.livelog-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.livelog-feed {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    height: 450px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.livelog-feed::-webkit-scrollbar {
    width: 8px;
}

.livelog-feed::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.livelog-feed::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.2rem 0.75rem;
    border-bottom: 1px solid rgba(42, 42, 74, 0.3);
    transition: background 0.1s;
}

.log-entry:hover {
    background: rgba(0, 212, 255, 0.04);
}

.log-entry.log-kill {
    border-left: 3px solid var(--danger);
}

.log-entry.log-playerconnect {
    border-left: 3px solid var(--success);
}

.log-entry.log-playerdisconnect {
    border-left: 3px solid var(--warning);
}

.log-entry.log-maploaded {
    border-left: 3px solid var(--accent);
    background: rgba(0, 212, 255, 0.04);
}

.log-entry.log-matchend {
    border-left: 3px solid #ffd700;
    background: rgba(255, 215, 0, 0.04);
}

.log-entry.log-roundend,
.log-entry.log-roundstart {
    border-left: 3px solid #9b59b6;
}

.log-entry.log-bombplanted,
.log-entry.log-bombdefused {
    border-left: 3px solid #e67e22;
}

.log-game-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.log-game-tag.ut2004 {
    background: rgba(93, 61, 122, 0.4);
    color: #c39bd3;
}

.log-game-tag.cs2 {
    background: rgba(61, 90, 122, 0.4);
    color: #85c1e9;
}

.log-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: 65px;
}

.log-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.log-text {
    color: var(--text-primary);
    word-break: break-word;
}

.log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 0.25rem;
}

.livelog-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.conn-dot.connected {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.conn-dot.reconnecting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.conn-dot.offline {
    background: var(--danger);
}

.conn-dot.warning {
    background: var(--warning);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.log-counter {
    margin-left: auto;
    color: var(--text-muted);
}

/* ===== History Section ===== */
.history-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.history-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.history-results {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.history-results .log-entry .log-time {
    min-width: 130px;
}

/* ===== Quick Links ===== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.quick-link-icon {
    font-size: 1.8rem;
}

.quick-link-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ===== Activity Items ===== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.4);
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: monospace;
    flex-shrink: 0;
    min-width: 65px;
}

.activity-game {
    flex-shrink: 0;
}

.activity-icon {
    flex-shrink: 0;
}

.activity-text {
    color: var(--text-primary);
    word-break: break-word;
}

/* ===== Responsive (Fas 8) ===== */
@media (max-width: 768px) {
    .livelog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .livelog-actions {
        flex-wrap: wrap;
    }

    .livelog-actions .input-field {
        max-width: 100% !important;
    }

    .livelog-feed {
        height: 350px;
    }

    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .history-controls .input-field {
        max-width: 100% !important;
    }

    .quick-links {
        grid-template-columns: repeat(2, 1fr);
    }
}
