/* Live AI Training Page - Battlefield Style */

:root {
    --bf-orange: #ff6a00;
    --bf-orange-bright: #ff8c00;
    --bf-orange-dim: #cc5500;
    --bf-red: #ff3d00;
    --bf-dark: #0d0d0d;
    --bf-darker: #080808;
    --bf-panel: rgba(20, 20, 20, 0.92);
    --bf-panel-border: rgba(255, 106, 0, 0.3);
    --bf-text: #e8e8e8;
    --bf-text-dim: #888888;
    --bf-gold: #ffcc00;
    --bf-green: #00ff88;
}

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

body {
    font-family: 'Segoe UI', 'Roboto', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bf-darker) 0%, #0f0a05 50%, var(--bf-darker) 100%);
    color: var(--bf-text);
    min-height: 100vh;
    overflow: hidden;
}

/* Fire Particles */
.fire-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ember {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--bf-orange);
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 106, 0, 0.6);
    animation: ember-rise linear infinite;
    opacity: 0;
}

.ember:nth-child(1) { left: 5%; animation-duration: 10s; animation-delay: 0s; }
.ember:nth-child(2) { left: 20%; animation-duration: 14s; animation-delay: 2s; }
.ember:nth-child(3) { left: 35%; animation-duration: 12s; animation-delay: 1s; }
.ember:nth-child(4) { left: 50%; animation-duration: 11s; animation-delay: 3s; }
.ember:nth-child(5) { left: 65%; animation-duration: 13s; animation-delay: 0.5s; }
.ember:nth-child(6) { left: 80%; animation-duration: 9s; animation-delay: 2.5s; }
.ember:nth-child(7) { left: 90%; animation-duration: 15s; animation-delay: 1.5s; }
.ember:nth-child(8) { left: 10%; animation-duration: 11s; animation-delay: 4s; }

@keyframes ember-rise {
    0% { bottom: -10px; opacity: 0; transform: translateX(0) scale(1); }
    10% { opacity: 0.6; }
    50% { opacity: 0.4; transform: translateX(20px) scale(0.8); }
    100% { bottom: 110%; opacity: 0; transform: translateX(-10px) scale(0.4); }
}

.fire-glow {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(255, 80, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Main Container */
#live-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================ */
/* SNAPSHOTS & TIMELINE SECTION                 */
/* ============================================ */

.snapshots-section {
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.snapshot-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bf-panel-border);
    padding-bottom: 8px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--bf-text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 600;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--bf-orange);
    color: var(--bf-text);
}

.tab-btn.active {
    background: var(--bf-orange);
    border-color: var(--bf-orange);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 136, 0, 0.3);
}

.tab-icon {
    font-size: 16px;
}

.tab-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.tab-btn.active .tab-badge {
    background: rgba(0, 0, 0, 0.4);
}

.snapshot-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 450px;
}

.snapshot-content.active {
    display: block;
}

/* Hetzner-Style Snapshot List */
.snapshot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.snapshot-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--bf-orange);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.snapshot-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--bf-orange);
    transform: translateX(2px);
}

.snapshot-item.auto {
    border-left-color: #4a9eff;
}

.snapshot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.snapshot-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--bf-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.snapshot-type-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.snapshot-type-badge.auto {
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
}

.snapshot-type-badge.manual {
    background: rgba(255, 136, 0, 0.2);
    color: var(--bf-orange);
}

.snapshot-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.snapshot-stat {
    display: flex;
    flex-direction: column;
}

.snapshot-stat-label {
    font-size: 10px;
    color: var(--bf-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.snapshot-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--bf-orange);
}

.snapshot-timestamp {
    font-size: 11px;
    color: var(--bf-text-dim);
    margin-top: 4px;
}

.snapshot-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.snapshot-btn {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--bf-text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.snapshot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--bf-orange);
    color: var(--bf-orange);
}

.snapshot-btn.danger:hover {
    border-color: #ff4444;
    color: #ff4444;
}

/* Cypress-Style Screenshot Timeline */
.screenshot-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.screenshot-item {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    border-color: var(--bf-orange);
    box-shadow: 0 4px 20px rgba(255, 136, 0, 0.2);
    transform: translateY(-2px);
}

.screenshot-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.screenshot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshot-item:hover .screenshot-preview img {
    transform: scale(1.05);
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screenshot-item:hover .screenshot-overlay {
    opacity: 1;
}

.screenshot-info {
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
}

.screenshot-wave {
    font-size: 12px;
    font-weight: 700;
    color: var(--bf-orange);
    margin-bottom: 4px;
}

.screenshot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--bf-text-dim);
}

.screenshot-stats {
    display: flex;
    gap: 12px;
}

.screenshot-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.screenshot-time {
    font-size: 10px;
}

.snapshot-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--bf-text-dim);
}

.snapshot-placeholder .placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.snapshot-placeholder p {
    margin: 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.snapshot-placeholder small {
    font-size: 11px;
    opacity: 0.7;
}

/* Screenshot Modal */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.screenshot-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screenshot-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    background: var(--bf-orange);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10001;
}

.screenshot-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.screenshot-modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.screenshot-modal-info {
    margin-top: 20px;
    text-align: center;
    color: var(--bf-text);
}

.screenshot-modal-info h3 {
    margin: 0 0 8px 0;
    color: var(--bf-orange);
}

.screenshot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bf-text-dim);
    font-size: 12px;
}

/* ============================================ */
/* ANALYSIS LOG SECTION                         */
/* ============================================ */

#analysis-log-section {
    background: var(--bf-panel);
    border-top: 1px solid var(--bf-panel-border);
    padding: 12px 20px;
    position: relative;
    z-index: 50;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

#analysis-log-section.collapsed {
    padding: 8px 20px;
}

#analysis-log-section.collapsed #log-container-collapsible {
    max-height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
    margin: 0;
    padding: 0;
    opacity: 0;
    border: none;
}

.log-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#analysis-log-section.collapsed .log-section-header {
    margin-bottom: 0;
}

.log-section-header:hover {
    opacity: 0.8;
}

.collapse-icon {
    font-size: 12px;
    color: var(--bf-orange);
    transition: transform 0.3s ease;
    user-select: none;
}

.log-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-section-title .icon {
    font-size: 20px;
}

.log-section-title h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bf-orange);
    margin: 0;
}

.log-badge {
    padding: 4px 10px;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--bf-green);
}

.log-badge.capturing {
    background: rgba(255, 170, 0, 0.15);
    border-color: rgba(255, 170, 0, 0.3);
    color: #ffaa00;
    animation: pulse 1s infinite;
}

.log-badge.captured {
    background: rgba(255, 106, 0, 0.15);
    border-color: var(--bf-panel-border);
    color: var(--bf-orange);
}

.log-section-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.snapshot-selector {
    padding: 10px 40px 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--bf-panel-border);
    border-radius: 8px;
    color: var(--bf-orange);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    outline: none;
    appearance: none;
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff6a00' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.3s ease;
}

.snapshot-selector:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.2);
}

.snapshot-selector:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.snapshot-selector option {
    background: var(--bf-dark);
    color: var(--bf-text);
    padding: 12px;
}

.log-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 106, 0, 0.1);
    border: 1px solid var(--bf-panel-border);
    border-radius: 8px;
    color: var(--bf-text);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.log-btn:hover:not(:disabled) {
    background: rgba(255, 106, 0, 0.2);
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.2);
    transform: translateY(-1px);
}

.log-btn:active:not(:disabled) {
    transform: translateY(0);
}

.log-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.log-btn.capture {
    border-color: var(--bf-orange);
    color: var(--bf-orange);
}

.log-btn.copy {
    border-color: var(--bf-green);
    color: var(--bf-green);
}

.log-btn.clear {
    border-color: #ff4444;
    color: #ff4444;
}

.log-btn .btn-icon {
    font-size: 14px;
}

.log-container {
    position: relative;
    min-height: 200px;
    max-height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 106, 0, 0.15);
    overflow: hidden;
}

.log-content {
    width: 100%;
    height: 100%;
    max-height: 400px;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: var(--bf-text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 106, 0, 0.3);
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.5);
}

.log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--bf-text-dim);
    text-align: center;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-text p {
    margin: 6px 0;
    font-family: 'Segoe UI', sans-serif;
}

.placeholder-text strong {
    color: var(--bf-orange);
}

/* Log Section Headers */
.log-section {
    margin: 20px 0;
    padding: 12px;
    background: rgba(255, 106, 0, 0.05);
    border-left: 3px solid var(--bf-orange);
    border-radius: 4px;
}

.log-section-heading {
    font-weight: 700;
    color: var(--bf-orange);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-key {
    color: var(--bf-gold);
    font-weight: 600;
}

.log-value {
    color: var(--bf-green);
}

.log-warning {
    color: #ffaa00;
}

.log-error {
    color: #ff4444;
}

.log-timestamp {
    color: var(--bf-text-dim);
    font-size: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
    #analysis-log-section {
        padding: 10px 14px;
    }

    .log-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .log-container {
        min-height: 150px;
        max-height: 300px;
    }

    .log-section-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .log-btn {
        flex: 1;
        min-width: 100px;
    }
}

/* Top Bar */
/* ============================================ */
/* PROFESSIONAL NAVBAR REDESIGN                 */
/* ============================================ */

#top-bar {
    background: linear-gradient(180deg, rgba(10, 8, 6, 0.98) 0%, rgba(15, 12, 8, 0.95) 100%);
    border-bottom: 2px solid var(--bf-orange);
    box-shadow: 0 8px 40px rgba(255, 106, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 100;
    position: relative;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    gap: 20px;
    max-width: 2400px;
    margin: 0 auto;
}

/* Brand Section */
.navbar-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.brand-link:hover {
    opacity: 0.8;
}

.brand-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.6));
    transition: transform 0.3s ease;
}

.brand-link:hover .brand-logo {
    transform: scale(1.05);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--bf-orange) 0%, var(--bf-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bf-text-dim);
    opacity: 0.7;
}

/* Center Section - Model Selector & Stats */
.navbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.model-selector-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 106, 0, 0.05);
    border: 1px solid rgba(255, 106, 0, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
    backdrop-filter: blur(5px);
}

.selector-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.selector-icon {
    font-size: 16px;
}

.selector-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bf-text-dim);
    white-space: nowrap;
}

.model-select-pro {
    min-width: 200px;
    padding: 8px 12px;
    padding-right: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 106, 0, 0.4);
    border-radius: 6px;
    color: var(--bf-orange);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff6a00' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.3s ease;
}

.model-select-pro:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.2);
}

.model-select-pro:focus {
    border-color: var(--bf-orange-bright);
    box-shadow: 0 0 25px rgba(255, 106, 0, 0.3);
}

.model-select-pro option {
    background: var(--bf-dark);
    color: var(--bf-text);
    padding: 12px;
}

/* Training Stats Bar */
.training-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 18px;
    opacity: 0.9;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-content .stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--bf-orange);
    line-height: 1;
}

.stat-content .stat-label {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bf-text-dim);
    opacity: 0.7;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Right Section - Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--bf-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 106, 0, 0.1);
    border-color: var(--bf-orange);
    color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.2);
}

.nav-btn svg {
    transition: transform 0.3s ease;
}

.nav-btn:hover svg {
    transform: translateX(-3px);
}

/* Status Indicator Pro */
.status-indicator-pro {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.status-dot-pro {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    box-shadow: 0 0 10px rgba(102, 102, 102, 0.5);
    animation: pulse-status 2s ease-in-out infinite;
}

.status-text-pro {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bf-text-dim);
}

/* Status States */
#status-indicator.online .status-dot-pro {
    background: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

#status-indicator.online .status-text-pro {
    color: #00ff88;
}

#status-indicator.training .status-dot-pro {
    background: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.6);
    animation: pulse-training 1s ease-in-out infinite;
}

#status-indicator.training .status-text-pro {
    color: var(--bf-orange);
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

@keyframes pulse-training {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 20px rgba(255, 106, 0, 0.6); }
    50% { opacity: 0.8; transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 106, 0, 0.8); }
}

/* Responsive */
@media (max-width: 1400px) {
    .navbar-container {
        grid-template-columns: auto 1fr auto;
        gap: 20px;
    }

    .training-stats-bar {
        gap: 12px;
        padding: 8px 16px;
    }

    .stat-content .stat-value {
        font-size: 14px;
    }
}

@media (max-width: 1024px) {
    .navbar-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px 20px;
    }

    .navbar-brand {
        justify-content: center;
    }

    .navbar-center {
        order: 3;
    }

    .navbar-actions {
        justify-content: center;
    }

    .brand-subtitle {
        display: none;
    }
}

/* Old styles (kept for backwards compatibility) */
#top-bar.old-style {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(180deg, rgba(15, 10, 5, 0.98) 0%, rgba(20, 15, 10, 0.95) 100%);
    border-bottom: 2px solid var(--bf-orange);
    box-shadow: 0 4px 30px rgba(255, 106, 0, 0.2);
    z-index: 100;
}

.bar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 106, 0, 0.1);
    border: 1px solid var(--bf-panel-border);
    border-radius: 8px;
    color: var(--bf-orange);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 106, 0, 0.2);
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.3);
}

.back-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 8px solid currentColor;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.5));
}

.title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--bf-orange), var(--bf-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255, 106, 0, 0.4));
}

.title-badge {
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.2), rgba(255, 106, 0, 0.05));
    border: 1px solid var(--bf-orange);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--bf-orange);
}

/* Model Selector (Center) */
.bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bf-panel-border);
    border-radius: 10px;
}

.model-selector-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bf-text-dim);
}

.model-select {
    padding: 8px 16px;
    padding-right: 32px;
    background: rgba(255, 106, 0, 0.1);
    border: 1px solid var(--bf-orange);
    border-radius: 6px;
    color: var(--bf-orange);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff6a00' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.model-select:hover {
    background-color: rgba(255, 106, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 106, 0, 0.2);
}

.model-select:focus {
    border-color: var(--bf-orange-bright);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.3);
}

.model-select option {
    background: var(--bf-dark);
    color: var(--bf-text);
    padding: 8px;
}

.model-duration {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.duration-icon {
    font-size: 14px;
    opacity: 0.8;
}

.duration-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--bf-orange);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    min-width: 60px;
}

.duration-start {
    font-size: 11px;
    color: var(--bf-text-dim);
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.bar-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
}

.status-indicator.online .status-dot {
    background: var(--bf-green);
    box-shadow: 0 0 12px var(--bf-green);
    animation: pulse 2s infinite;
}

.status-indicator.training .status-dot {
    background: var(--bf-orange);
    box-shadow: 0 0 12px var(--bf-orange);
    animation: pulse 0.6s infinite;
}

.status-indicator.offline .status-dot {
    background: #666;
}

.status-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Main Content */
#main-content {
    display: flex;
    flex: 1;
    gap: 0;
    overflow: hidden;
}

/* Sidebars */
#stats-sidebar, #info-sidebar {
    width: 280px;
    min-width: 260px;
    background: var(--bf-panel);
    border-right: 1px solid var(--bf-panel-border);
    overflow-y: auto;
    padding: 16px;
}

#info-sidebar {
    border-right: none;
    border-left: 1px solid var(--bf-panel-border);
}

.sidebar-section {
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bf-orange);
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bf-panel-border);
}

.section-title .icon {
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 106, 0, 0.15);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.1);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--bf-orange);
    line-height: 1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums; /* Feste Ziffernbreite */
}

/* Laufzeit stat-card: Kleinerer Text, feste Breite, kein Springen */
#stat-duration {
    font-size: 18px;
    min-width: 70px;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.stat-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bf-text-dim);
}

/* Records List */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid var(--bf-orange);
}

.record-label {
    font-size: 12px;
    color: var(--bf-text-dim);
}

.record-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--bf-gold);
}

/* Agents Container */
#agents-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-agents {
    text-align: center;
    padding: 20px;
    color: var(--bf-text-dim);
    font-style: italic;
}

.agent-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 14px;
    border-left: 4px solid var(--bf-orange);
    transition: all 0.3s ease;
}

.agent-card:hover {
    background: rgba(255, 106, 0, 0.05);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.agent-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--bf-text);
}

.agent-status {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 255, 136, 0.2);
    color: var(--bf-green);
}

.agent-status.dead {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.agent-card.dead {
    opacity: 0.6;
    border-left-color: #ff4444;
}

/* Live Stats Bars */
.agent-live-stats {
    margin-bottom: 10px;
}

.stat-bar {
    position: relative;
    height: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    margin-bottom: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.2s ease;
}

.stat-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-gold {
    font-size: 11px;
    color: #ffd700;
    margin-top: 4px;
}

/* Abilities */
.agent-abilities {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ability {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 255, 136, 0.2);
    color: var(--bf-green);
}

.ability.on-cd {
    background: rgba(128, 128, 128, 0.3);
    color: #888;
}

.ability.active {
    background: rgba(255, 200, 0, 0.3);
    color: #ffd700;
    animation: pulse-ability 0.5s infinite;
}

@keyframes pulse-ability {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Training Stats */
.agent-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-stats span {
    color: var(--bf-text-dim);
}

.agent-stats strong {
    color: var(--bf-orange);
}

/* Purchase History */
.agent-purchases {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.purchases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.purchases-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--bf-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchases-summary {
    font-size: 10px;
    color: var(--bf-text-dim);
}

.purchases-recent {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.purchase-item {
    font-size: 16px;
    cursor: help;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 0 2px rgba(255, 204, 0, 0.5));
}

.purchase-item:hover {
    transform: scale(1.3);
}

.purchases-top {
    font-size: 11px;
    color: var(--bf-text-dim);
    background: rgba(255, 204, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.no-purchases {
    color: var(--bf-text-dim);
    font-size: 11px;
    font-style: italic;
}

/* Agent Inventory (Powerups) */
.agent-inventory {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-top: 6px;
    background: rgba(100, 150, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid rgba(100, 150, 255, 0.5);
}

.inventory-label {
    font-size: 14px;
    opacity: 0.8;
}

.inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.inventory-item {
    font-size: 16px;
    background: rgba(50, 50, 50, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: help;
    transition: all 0.2s ease;
}

.inventory-item:hover {
    background: rgba(100, 150, 255, 0.3);
    transform: scale(1.1);
}

.inventory-item sub {
    font-size: 9px;
    color: var(--bf-gold);
    margin-left: 2px;
}

/* Current Round Purchases (aktuelle Runde) */
.current-round-section {
    background: rgba(255, 200, 0, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    border-left: 3px solid var(--bf-gold);
}

.current-round-section .purchases-title {
    color: var(--bf-gold);
    font-weight: bold;
}

.current-round-items .purchase-item {
    filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.8));
    animation: currentRoundPulse 2s ease-in-out infinite;
}

@keyframes currentRoundPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 200, 0, 0.5)); }
    50% { filter: drop-shadow(0 0 8px rgba(255, 200, 0, 1)); }
}

/* Historical Purchases */
.history-section {
    margin-top: 6px;
}

.history-section .purchases-title {
    color: var(--bf-text-dim);
    font-weight: normal;
}

.historical-items .purchase-item {
    opacity: 0.7;
    filter: drop-shadow(0 0 1px rgba(255, 204, 0, 0.3));
}

.historical-items .purchase-item:hover {
    opacity: 1;
}

/* Info Card */
.info-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 12px;
    color: var(--bf-text-dim);
}

.info-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--bf-orange);
}

/* Controls Info */
.controls-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.control-row kbd {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--bf-panel-border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: var(--bf-orange);
    min-width: 80px;
    text-align: center;
}

.control-row span {
    color: var(--bf-text-dim);
}

.info-text {
    font-size: 12px;
    line-height: 1.7;
    color: var(--bf-text-dim);
}

/* Live View */
#live-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#live-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#live-canvas:active {
    cursor: grabbing;
}

/* No Training Overlay */
#no-training-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

#no-training-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    position: relative;
}

.brain-icon {
    font-size: 100px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 106, 0, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.overlay-content h2 {
    font-size: 28px;
    margin: 20px 0 10px;
    color: var(--bf-orange);
}

.overlay-content p {
    color: var(--bf-text-dim);
    font-size: 14px;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border: 2px solid var(--bf-orange);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Live Badge */
.live-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    animation: live-pulse 1.5s infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); }
    50% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.6); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* View Controls */
.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid var(--bf-panel-border);
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 106, 0, 0.1);
    border: 1px solid var(--bf-panel-border);
    border-radius: 8px;
    color: var(--bf-text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 106, 0, 0.2);
    border-color: var(--bf-orange);
}

.control-btn.active {
    background: var(--bf-orange);
    color: #000;
    border-color: var(--bf-orange);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-level {
    margin-left: auto;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bf-orange);
    font-family: monospace;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 106, 0, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.5);
}

/* Responsive */
@media (max-width: 1200px) {
    #stats-sidebar, #info-sidebar {
        width: 240px;
        min-width: 220px;
    }
}

@media (max-width: 1100px) {
    .bar-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .model-select {
        min-width: 140px;
    }
}

@media (max-width: 900px) {
    #top-bar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 16px;
    }

    .bar-center {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .model-selector {
        width: 100%;
        justify-content: center;
    }

    #main-content {
        flex-direction: column;
    }

    #stats-sidebar, #info-sidebar {
        width: 100%;
        max-height: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================ */
/* AI Analysis Section                          */
/* ============================================ */

.analysis-section {
    margin-top: auto;
}

.analysis-content {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 14px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 106, 0, 0.1);
    position: relative;
}

.analysis-content.typing {
    border-color: var(--bf-orange);
    box-shadow: 0 0 20px rgba(255, 106, 0, 0.1);
}

.analysis-content p {
    font-size: 12px;
    line-height: 1.7;
    color: var(--bf-text);
    margin: 0;
}

.analysis-content .no-analysis {
    color: var(--bf-text-dim);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.analysis-content .cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background: var(--bf-orange);
    margin-left: 2px;
    animation: cursor-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.analysis-timestamp {
    font-size: 10px;
    color: var(--bf-text-dim);
    text-align: right;
    margin-bottom: 12px;
    padding-right: 4px;
}

.btn-analysis {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.15), rgba(255, 106, 0, 0.05));
    border: 1px solid var(--bf-orange);
    border-radius: 10px;
    color: var(--bf-orange);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-analysis:hover {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.25), rgba(255, 106, 0, 0.1));
    box-shadow: 0 0 30px rgba(255, 106, 0, 0.2);
    transform: translateY(-2px);
}

.btn-analysis:active {
    transform: translateY(0);
}

.btn-analysis:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-analysis.loading .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analysis-cooldown {
    font-size: 11px;
    color: var(--bf-text-dim);
    text-align: center;
    margin-top: 8px;
    min-height: 16px;
}

.analysis-cooldown.active {
    color: var(--bf-orange);
}

/* Analysis Score Badge */
.analysis-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 204, 0, 0.15);
    border: 1px solid var(--bf-gold);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--bf-gold);
    margin-bottom: 10px;
}

.analysis-score.good {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--bf-green);
    color: var(--bf-green);
}

.analysis-score.bad {
    background: rgba(255, 68, 68, 0.15);
    border-color: #ff4444;
    color: #ff4444;
}

/* New Analysis Notification */
.analysis-new-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bf-orange);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: new-pulse 1.5s infinite;
    margin-left: 8px;
}

@keyframes new-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================ */
/* AUTO AI TRAINING SECTION                     */
/* ============================================ */

.autoai-section {
    border: 1px solid rgba(138, 43, 226, 0.3);
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.08) 0%, transparent 100%);
}

.autoai-section .section-title {
    color: #a855f7;
}

.autoai-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
}

.autoai-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.autoai-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    box-shadow: 0 0 8px rgba(136, 136, 136, 0.5);
    transition: all 0.3s ease;
}

.autoai-dot.active {
    background: #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
    animation: autoai-pulse 2s infinite;
}

.autoai-dot.inactive {
    background: #666;
}

.autoai-dot.thinking {
    background: #ffcc00;
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.8);
    animation: autoai-thinking 0.5s infinite;
}

@keyframes autoai-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes autoai-thinking {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.autoai-status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--bf-text);
}

.autoai-api-status {
    font-size: 10px;
    color: var(--bf-text-dim);
}

.autoai-api-status span {
    color: var(--bf-green);
}

.autoai-api-status span.unavailable {
    color: #ff4444;
}

/* Session Info */
.autoai-session-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.session-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.session-label {
    font-size: 10px;
    color: var(--bf-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.session-name {
    font-size: 13px;
    font-weight: 700;
    color: #a855f7;
}

.session-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.session-stat {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.session-stat .stat-num {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--bf-orange);
}

.session-stat .stat-label {
    font-size: 9px;
    color: var(--bf-text-dim);
    text-transform: uppercase;
}

.session-params {
    padding: 10px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
}

.params-title {
    display: block;
    font-size: 10px;
    color: var(--bf-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 11px;
}

.params-grid .param-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.params-grid .param-key {
    color: var(--bf-text-dim);
}

.params-grid .param-value {
    color: #a855f7;
    font-weight: 600;
}

.session-next-check {
    font-size: 11px;
    color: var(--bf-text-dim);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Communication Log */
.autoai-log-container {
    margin-bottom: 12px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--bf-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-count {
    padding: 2px 8px;
    background: rgba(138, 43, 226, 0.2);
    border-radius: 10px;
    font-size: 10px;
    color: #a855f7;
}

.autoai-log {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 8px;
}

.autoai-log::-webkit-scrollbar {
    width: 4px;
}

.autoai-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.autoai-log::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.5);
    border-radius: 2px;
}

.log-entry {
    display: flex;
    gap: 10px;
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid transparent;
    animation: log-fade-in 0.3s ease;
}

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

.log-entry.system {
    border-left-color: #666;
}

.log-entry.outgoing {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.log-entry.incoming {
    border-left-color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
}

.log-entry.ai_response {
    border-left-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.log-entry.parameter_change {
    border-left-color: #ffcc00;
    background: rgba(255, 204, 0, 0.08);
}

.log-entry.error {
    border-left-color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
}

.log-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.log-content {
    flex: 1;
    font-size: 11px;
    color: var(--bf-text);
    line-height: 1.4;
}

.log-timestamp {
    font-size: 9px;
    color: var(--bf-text-dim);
    margin-top: 4px;
}

.log-params {
    margin-top: 6px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: monospace;
    font-size: 10px;
    color: #a855f7;
}

/* Admin Controls */
.autoai-admin-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-autoai {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.3) 0%, rgba(138, 43, 226, 0.15) 100%);
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    color: #a855f7;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-autoai:hover {
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.4) 0%, rgba(138, 43, 226, 0.25) 100%);
    border-color: #a855f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-autoai:active {
    transform: translateY(0);
}

.btn-autoai.inactive {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.1) 100%);
    border-color: rgba(0, 255, 136, 0.4);
    color: var(--bf-green);
}

.btn-autoai.inactive:hover {
    border-color: var(--bf-green);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-autoai.active {
    background: linear-gradient(180deg, rgba(255, 68, 68, 0.2) 0%, rgba(255, 68, 68, 0.1) 100%);
    border-color: rgba(255, 68, 68, 0.4);
    color: #ff4444;
}

.btn-autoai.active:hover {
    border-color: #ff4444;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.btn-autoai.secondary {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--bf-text-dim);
}

.btn-autoai.secondary:hover {
    border-color: var(--bf-orange);
    color: var(--bf-orange);
}

.btn-autoai .btn-icon {
    font-size: 14px;
}

.btn-autoai:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-autoai:disabled:hover {
    box-shadow: none;
}

/* Thinking Animation Overlay */
.autoai-thinking-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.thinking-content {
    text-align: center;
}

.thinking-icon {
    font-size: 32px;
    animation: thinking-bounce 1s infinite;
}

@keyframes thinking-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.thinking-text {
    margin-top: 10px;
    font-size: 12px;
    color: #a855f7;
    animation: thinking-fade 1.5s infinite;
}

@keyframes thinking-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================ */
/* SPOTLIGHT OVERLAY                            */
/* ============================================ */

.spotlight-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 280px;
    background: linear-gradient(135deg, rgba(10, 14, 20, 0.95) 0%, rgba(20, 25, 35, 0.95) 100%);
    border: 2px solid rgba(255, 106, 0, 0.4);
    border-radius: 12px;
    padding: 16px;
    z-index: 100;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 106, 0, 0.1);
}

.spotlight-overlay.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.spotlight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 106, 0, 0.3);
}

.spotlight-badge {
    background: linear-gradient(135deg, #ff6a00 0%, #ff9500 100%);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.4);
    animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 106, 0, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(255, 106, 0, 0.7); }
}

.spotlight-player-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 106, 0, 0.5);
}

.spotlight-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.spotlight-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spotlight-stat .stat-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.stat-bar-container {
    flex: 1;
    height: 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.stat-bar.hp-bar {
    background: linear-gradient(90deg, #ff4444 0%, #ff6666 100%);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.stat-bar.energy-bar {
    background: linear-gradient(90deg, #44aaff 0%, #66ccff 100%);
    box-shadow: 0 0 10px rgba(68, 170, 255, 0.5);
}

.spotlight-stat .stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
    min-width: 60px;
    text-align: right;
}

.spotlight-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-stat .mini-icon {
    font-size: 14px;
}

.mini-stat .mini-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.spotlight-thoughts {
    margin-bottom: 12px;
}

.thought-bubble {
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: #d8b4fe;
    line-height: 1.4;
}

.thought-bubble.danger {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.4);
    color: #fca5a5;
}

.thought-bubble.warning {
    background: rgba(255, 170, 0, 0.2);
    border-color: rgba(255, 170, 0, 0.4);
    color: #fde68a;
}

.thought-bubble.action {
    background: rgba(68, 255, 136, 0.2);
    border-color: rgba(68, 255, 136, 0.4);
    color: #86efac;
}

.spotlight-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.spotlight-skill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.spotlight-skill.ready {
    border-color: rgba(68, 255, 136, 0.5);
    box-shadow: 0 0 8px rgba(68, 255, 136, 0.3);
}

.spotlight-skill.cooldown {
    opacity: 0.5;
}

.spotlight-skill .skill-icon {
    font-size: 14px;
}

.spotlight-skill .skill-level {
    color: #aaa;
    font-weight: 600;
}

.spotlight-skill .skill-cd {
    color: #ff6a00;
    font-weight: 600;
    font-size: 10px;
}

.no-skills {
    color: #666;
    font-size: 11px;
    font-style: italic;
}

/* ============================================ */
/* EVENT FEED OVERLAY                           */
/* ============================================ */

/* Event Feed - Compact & Minimizable */
#event-feed-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 260px;
    background: rgba(10, 10, 15, 0.92);
    border: 1px solid rgba(255, 106, 0, 0.35);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 50;
    pointer-events: auto;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#event-feed-overlay.event-feed-expanded {
    max-height: 220px;
}

#event-feed-overlay.event-feed-minimized {
    max-height: 34px;
}

#event-feed-overlay.event-feed-minimized .event-feed-container {
    display: none;
}

.event-feed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 106, 0, 0.12);
    border-bottom: 1px solid rgba(255, 106, 0, 0.25);
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.event-feed-header:hover {
    background: rgba(255, 106, 0, 0.2);
}

.event-feed-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bf-orange);
    flex: 1;
}

.event-feed-count {
    padding: 2px 8px;
    background: rgba(255, 106, 0, 0.25);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    color: var(--bf-orange);
}

.event-feed-toggle {
    font-size: 9px;
    color: var(--bf-orange);
    opacity: 0.6;
    transition: transform 0.2s ease;
}

#event-feed-overlay.event-feed-minimized .event-feed-toggle {
    transform: rotate(180deg);
}

.event-feed-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-feed-container::-webkit-scrollbar {
    width: 3px;
}

.event-feed-container::-webkit-scrollbar-track {
    background: transparent;
}

.event-feed-container::-webkit-scrollbar-thumb {
    background: rgba(255, 106, 0, 0.3);
    border-radius: 2px;
}

/* Event Entry - Compact */
.event-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    border-left: 2px solid var(--bf-orange);
    animation: event-slide-in 0.2s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
    font-size: 11px;
}

@keyframes event-slide-in {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.event-entry.kill {
    border-left-color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
}

.event-entry.gold {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

.event-entry.wave {
    border-left-color: var(--bf-green);
    background: rgba(0, 255, 136, 0.08);
}

.event-entry.death {
    border-left-color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.event-entry.shop {
    border-left-color: #00ccff;
    background: rgba(0, 204, 255, 0.08);
}

.event-entry.ai {
    border-left-color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
}

.event-entry.system {
    border-left-color: #888;
    background: rgba(136, 136, 136, 0.05);
}

.event-entry.pickup {
    border-left-color: #00ff88;
    background: rgba(0, 255, 136, 0.08);
}

.event-entry.thought {
    border-left-color: #00d4ff;
    background: rgba(0, 212, 255, 0.08);
}

/* Thought text styling */
.thought-text {
    font-style: italic;
    font-weight: 500;
}

.thought-text.danger {
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.thought-text.warning {
    color: #ffaa00;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.thought-text.action {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.thought-text.info {
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.event-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.event-content {
    flex: 1;
    min-width: 0;
}

.event-text {
    font-size: 12px;
    color: var(--bf-text);
    line-height: 1.4;
    word-wrap: break-word;
}

.event-text .highlight {
    color: var(--bf-orange);
    font-weight: 600;
}

.event-text .player-name {
    color: #00ff88;
    font-weight: 600;
}

.event-text .enemy-name {
    color: #ff4444;
    font-weight: 600;
}

.event-text .gold-amount {
    color: #ffd700;
    font-weight: 600;
}

.event-text .gold-cost {
    color: #ff8c00;
    font-weight: 500;
    font-size: 11px;
}

.event-text .item-name {
    color: #00ddff;
    font-weight: 600;
    text-transform: uppercase;
}

/* Skill-Event Styles */
.event-text .skill-name {
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.event-text .skill-name.skill-offensive {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.4);
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.event-text .skill-name.skill-defensive {
    color: #44aaff;
    background: rgba(68, 170, 255, 0.2);
    border: 1px solid rgba(68, 170, 255, 0.4);
    text-shadow: 0 0 8px rgba(68, 170, 255, 0.6);
}

.event-text .skill-name.skill-utility {
    color: #44ff88;
    background: rgba(68, 255, 136, 0.2);
    border: 1px solid rgba(68, 255, 136, 0.4);
    text-shadow: 0 0 8px rgba(68, 255, 136, 0.6);
}

/* Event type: skill - extra styling */
.event-entry[data-type="skill"] {
    border-left-color: #9966ff;
}

.event-entry[data-type="skill"] .event-icon {
    background: rgba(153, 102, 255, 0.2);
    color: #bb99ff;
}

/* Event type: purchase */
.event-entry[data-type="purchase"] {
    border-left-color: #00ddff;
}

.event-entry[data-type="purchase"] .event-icon {
    background: rgba(0, 221, 255, 0.2);
    color: #00ddff;
}

.event-text .wave-num {
    color: var(--bf-orange);
    font-weight: 700;
    font-size: 14px;
}

/* Typewriter effect */
.event-text .typewriter {
    overflow: hidden;
    display: inline;
}

.event-text .typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 12px;
    background: var(--bf-orange);
    margin-left: 2px;
    animation: cursor-blink 0.6s infinite;
    vertical-align: middle;
}

.event-time {
    font-size: 9px;
    color: var(--bf-text-dim);
    margin-top: 3px;
}

/* Event fade out for old events */
.event-entry.fading {
    animation: event-fade-out 0.5s ease-out forwards;
}

@keyframes event-fade-out {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-20px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* Important event highlight */
.event-entry.important {
    border-width: 4px;
    animation: event-slide-in 0.3s ease-out, event-glow 1.5s ease-in-out;
}

@keyframes event-glow {
    0% { box-shadow: 0 0 20px rgba(255, 106, 0, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 106, 0, 0.8); }
    100% { box-shadow: 0 0 0px rgba(255, 106, 0, 0); }
}

/* Responsive */
@media (max-width: 900px) {
    #event-feed-overlay {
        width: 90%;
        min-width: 300px;
    }
}

@media (max-width: 600px) {
    #event-feed-overlay {
        width: 100%;
        min-width: unset;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .event-text {
        font-size: 11px;
    }
}

/* ============================================
   AUTOAI CREATE SESSION MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-content.autoai-modal {
    background: var(--bf-panel);
    border: 1px solid var(--bf-orange);
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 0 40px rgba(255, 106, 0, 0.3);
    animation: modal-appear 0.2s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 106, 0, 0.3);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--bf-orange);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--bf-text-dim);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--bf-orange);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--bf-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 106, 0, 0.3);
    border-radius: 6px;
    color: var(--bf-text);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--bf-orange);
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.2);
}

.form-input::placeholder {
    color: var(--bf-text-dim);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 106, 0, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: var(--bf-text-dim);
}

.form-info .info-icon {
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 106, 0, 0.2);
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--bf-text-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bf-text);
}

.btn-create {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--bf-orange), var(--bf-orange-dim));
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-create:hover {
    background: linear-gradient(135deg, var(--bf-orange-bright), var(--bf-orange));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
}

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

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE
   ============================================ */

/* Tablet landscape and below */
@media (max-width: 1024px) {
    body {
        overflow: auto;
    }

    #live-container {
        height: auto;
        min-height: 100vh;
    }

    /* Navbar stacking */
    .navbar-container {
        flex-direction: column;
        padding: 10px 16px;
        gap: 12px;
    }

    .navbar-brand {
        width: 100%;
        justify-content: center;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-logo {
        height: 32px;
    }

    .navbar-center {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .model-selector-card {
        width: 100%;
        justify-content: center;
    }

    .model-select-pro {
        flex: 1;
        max-width: 300px;
    }

    .training-stats-bar {
        width: 100%;
        justify-content: center;
    }

    .navbar-actions {
        width: 100%;
        justify-content: center;
    }

    /* Main content - stack sidebars */
    #main-content {
        flex-direction: column;
        height: auto;
    }

    #stats-sidebar, #info-sidebar {
        width: 100%;
        max-height: none;
        border: none;
        border-bottom: 1px solid var(--bf-panel-border);
    }

    #stats-sidebar {
        order: 1;
        max-height: 250px;
        overflow-y: auto;
    }

    #live-view {
        order: 2;
        min-height: 400px;
    }

    #info-sidebar {
        order: 3;
    }

    /* Horizontal stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 8px;
    }

    /* Spotlight overlay - reposition */
    .spotlight-overlay {
        width: 240px;
        padding: 12px;
    }

    .spotlight-player-name {
        font-size: 14px;
    }

    /* Event feed - smaller */
    #event-feed-overlay {
        height: 18%;
        min-height: 120px;
        max-height: 200px;
    }

    /* Analysis log */
    #analysis-log-section {
        padding: 10px 16px;
    }

    .log-container {
        min-height: 150px;
        max-height: 250px;
    }
}

/* Tablet portrait and mobile */
@media (max-width: 768px) {
    /* Top bar compact */
    #top-bar {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .navbar-container {
        padding: 8px 12px;
        gap: 8px;
    }

    .brand-link {
        gap: 10px;
    }

    .brand-logo {
        height: 28px;
    }

    .brand-title {
        font-size: 14px;
    }

    /* Model selector - full width */
    .model-selector-card {
        padding: 6px 10px;
    }

    .selector-header {
        display: none;
    }

    .model-select-pro {
        min-width: 100%;
        font-size: 12px;
        padding: 10px 12px;
    }

    /* Training stats - compact */
    .training-stats-bar {
        padding: 6px 10px;
        gap: 8px;
    }

    .stat-item {
        gap: 6px;
    }

    .stat-icon {
        font-size: 14px;
    }

    .stat-content .stat-value {
        font-size: 12px;
    }

    .stat-content .stat-label {
        font-size: 7px;
    }

    .stat-divider {
        height: 24px;
    }

    /* Nav button compact */
    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .nav-btn span {
        display: none;
    }

    /* Status indicator */
    .status-indicator-pro {
        padding: 8px 12px;
    }

    .status-text-pro {
        font-size: 10px;
    }

    /* Sidebars - collapsible height */
    #stats-sidebar {
        max-height: 200px;
        padding: 12px;
    }

    .section-title {
        font-size: 10px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .section-title .icon {
        font-size: 14px;
    }

    /* Stats grid - 2x2 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card {
        padding: 10px 6px;
        border-radius: 8px;
    }

    .stat-value {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 8px;
    }

    /* Records - horizontal */
    .records-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .record-item {
        padding: 8px 10px;
    }

    .record-label {
        font-size: 10px;
    }

    .record-value {
        font-size: 12px;
    }

    /* Agents - horizontal scroll */
    #agents-container {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .agent-card {
        min-width: 180px;
        flex-shrink: 0;
        padding: 10px;
    }

    .agent-name {
        font-size: 12px;
    }

    /* Live view */
    #live-view {
        min-height: 350px;
    }

    /* View controls - touch optimized */
    .view-controls {
        padding: 10px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .zoom-level {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Spotlight - bottom left, smaller */
    .spotlight-overlay {
        top: auto;
        bottom: 80px;
        left: 10px;
        width: 200px;
        padding: 10px;
    }

    .spotlight-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .spotlight-badge {
        font-size: 8px;
        padding: 3px 8px;
    }

    .spotlight-player-name {
        font-size: 12px;
    }

    .stat-bar-container {
        height: 12px;
    }

    .spotlight-stat .stat-value {
        font-size: 10px;
        min-width: 50px;
    }

    .mini-stat {
        padding: 4px 8px;
    }

    .mini-stat .mini-icon {
        font-size: 12px;
    }

    .mini-stat .mini-value {
        font-size: 12px;
    }

    .thought-bubble {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Event feed - full width */
    #event-feed-overlay {
        width: 100%;
        min-width: unset;
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: 15%;
        min-height: 100px;
        max-height: 150px;
    }

    .event-feed-header {
        padding: 6px 12px;
    }

    .event-feed-title {
        font-size: 10px;
    }

    .event-feed-container {
        padding: 6px 12px;
    }

    .event-entry {
        padding: 6px 10px;
        gap: 8px;
    }

    .event-icon {
        font-size: 14px;
    }

    .event-text {
        font-size: 11px;
    }

    /* Info sidebar */
    #info-sidebar {
        padding: 12px;
        max-height: 350px;
    }

    .info-card {
        padding: 10px;
    }

    .info-row {
        padding: 6px 0;
    }

    .info-label, .info-value {
        font-size: 11px;
    }

    /* Controls info - horizontal */
    .controls-info {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .control-row {
        gap: 8px;
        font-size: 11px;
    }

    .control-row kbd {
        padding: 3px 6px;
        font-size: 10px;
        min-width: 60px;
    }

    .info-text {
        font-size: 11px;
        line-height: 1.5;
    }

    /* Snapshots section */
    .snapshots-section {
        max-height: 300px;
    }

    .snapshot-tabs {
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .tab-icon {
        font-size: 14px;
    }

    .tab-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .snapshot-content {
        max-height: 200px;
    }

    .snapshot-item {
        padding: 10px;
    }

    /* Analysis section */
    .analysis-content {
        min-height: 80px;
        max-height: 150px;
        padding: 10px;
    }

    .btn-analysis {
        padding: 12px 16px;
        font-size: 11px;
    }

    /* AutoAI section */
    .autoai-session-info {
        padding: 10px;
    }

    .session-stats-row {
        gap: 6px;
    }

    .session-stat {
        padding: 6px;
    }

    .session-stat .stat-num {
        font-size: 14px;
    }

    .autoai-log {
        max-height: 150px;
    }

    .log-entry {
        padding: 6px;
        gap: 8px;
    }

    .log-content {
        font-size: 10px;
    }

    .autoai-admin-controls {
        gap: 6px;
    }

    .btn-autoai {
        padding: 8px 10px;
        font-size: 10px;
    }

    /* Analysis log section */
    #analysis-log-section {
        padding: 8px 12px;
    }

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

    .log-section-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .snapshot-selector {
        min-width: 150px;
        padding: 8px 30px 8px 12px;
        font-size: 11px;
    }

    .log-btn {
        padding: 8px 12px;
        font-size: 10px;
    }

    .log-btn .btn-text {
        display: none;
    }

    .log-container {
        min-height: 120px;
        max-height: 200px;
    }

    /* Modal fullscreen on mobile */
    .modal-content.autoai-modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .btn-cancel, .btn-create {
        width: 100%;
        justify-content: center;
    }
}

/* Small phones */
@media (max-width: 480px) {
    /* Top bar minimal */
    .navbar-container {
        padding: 6px 10px;
        gap: 6px;
    }

    .brand-title {
        font-size: 12px;
    }

    .brand-logo {
        height: 24px;
    }

    /* Hide text in nav buttons */
    .nav-btn {
        padding: 8px;
        width: 40px;
        height: 40px;
    }

    .status-indicator-pro {
        padding: 6px 10px;
    }

    .status-dot-pro {
        width: 8px;
        height: 8px;
    }

    .status-text-pro {
        font-size: 9px;
    }

    /* Training stats - icons only */
    .training-stats-bar {
        padding: 4px 8px;
    }

    .stat-item {
        flex-direction: column;
        gap: 2px;
    }

    .stat-content .stat-label {
        display: none;
    }

    /* Sidebars even more compact */
    #stats-sidebar {
        max-height: 180px;
        padding: 10px;
    }

    .stats-grid {
        gap: 4px;
    }

    .stat-card {
        padding: 8px 4px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 7px;
    }

    /* Records - single column */
    .records-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .record-item {
        padding: 6px 10px;
    }

    /* Agents - smaller cards */
    .agent-card {
        min-width: 150px;
        padding: 8px;
    }

    /* Live view */
    #live-view {
        min-height: 300px;
    }

    /* Spotlight - hide on very small screens or minimize */
    .spotlight-overlay {
        width: 180px;
        left: 5px;
        bottom: 70px;
        padding: 8px;
    }

    .spotlight-header {
        gap: 8px;
        margin-bottom: 8px;
    }

    .spotlight-badge {
        font-size: 7px;
        padding: 2px 6px;
    }

    .spotlight-player-name {
        font-size: 11px;
    }

    .spotlight-stat-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .mini-stat {
        flex: 1 1 45%;
    }

    .spotlight-thoughts {
        display: none;
    }

    .spotlight-skills {
        display: none;
    }

    /* Event feed minimal */
    #event-feed-overlay {
        height: 12%;
        min-height: 80px;
        max-height: 120px;
    }

    .event-feed-header {
        padding: 4px 10px;
    }

    .event-feed-container {
        padding: 4px 10px;
        gap: 4px;
    }

    .event-entry {
        padding: 4px 8px;
    }

    .event-icon {
        font-size: 12px;
    }

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

    .event-time {
        display: none;
    }

    /* View controls */
    .view-controls {
        padding: 8px;
        gap: 4px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .zoom-level {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* Info sidebar compact */
    #info-sidebar {
        padding: 10px;
        max-height: 300px;
    }

    .sidebar-section {
        margin-bottom: 16px;
    }

    /* Hide controls info on very small screens */
    .controls-info {
        display: none;
    }

    /* Snapshots - minimal */
    .snapshot-tabs {
        gap: 2px;
    }

    .tab-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .tab-btn span:not(.tab-icon) {
        display: none;
    }

    .snapshot-content {
        max-height: 150px;
    }

    /* Analysis */
    .analysis-content {
        min-height: 60px;
        max-height: 100px;
    }

    .btn-analysis {
        padding: 10px 14px;
    }

    /* AutoAI - compact */
    .autoai-status {
        padding: 6px 10px;
    }

    .autoai-session-info {
        padding: 8px;
    }

    .session-name-row {
        flex-direction: column;
        gap: 4px;
    }

    .session-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .session-stat {
        padding: 4px;
    }

    .session-stat .stat-num {
        font-size: 12px;
    }

    .session-stat .stat-label {
        font-size: 7px;
    }

    .params-grid {
        grid-template-columns: 1fr;
    }

    .autoai-log {
        max-height: 120px;
    }

    /* Analysis log - collapsed by default info */
    #analysis-log-section.collapsed .log-section-title h3 {
        font-size: 11px;
    }

    .log-section-controls {
        justify-content: flex-start;
    }

    .log-btn {
        padding: 6px 10px;
    }

    .log-container {
        min-height: 100px;
        max-height: 150px;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 375px) {
    .brand-title {
        font-size: 11px;
    }

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

    .stat-value {
        font-size: 14px;
    }

    .spotlight-overlay {
        display: none;
    }

    #event-feed-overlay {
        height: 10%;
        min-height: 70px;
    }

    .tab-icon {
        font-size: 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .control-btn,
    .tab-btn,
    .btn-autoai,
    .btn-analysis,
    .log-btn,
    .nav-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better tap feedback */
    * {
        -webkit-tap-highlight-color: rgba(255, 106, 0, 0.2);
    }

    /* Disable hover effects that don't work on touch */
    .model-card:hover,
    .stat-card:hover,
    .agent-card:hover,
    .snapshot-item:hover {
        transform: none;
    }

    /* Scroll snapping for agent cards */
    #agents-container {
        scroll-snap-type: x mandatory;
    }

    .agent-card {
        scroll-snap-align: start;
    }
}

/* Landscape mode on mobile */
@media (max-width: 900px) and (orientation: landscape) {
    #main-content {
        flex-direction: row;
    }

    #stats-sidebar {
        width: 200px;
        max-height: none;
        order: 0;
    }

    #live-view {
        flex: 1;
        order: 1;
        min-height: 100%;
    }

    #info-sidebar {
        display: none;
    }

    .spotlight-overlay {
        top: 10px;
        bottom: auto;
        width: 200px;
    }

    #event-feed-overlay {
        height: 25%;
    }

    #analysis-log-section {
        display: none;
    }
}
