:root {
    --bg-dark: #0a0e17;
    --bg-panel: rgba(16, 24, 40, 0.85);
    --bg-card: rgba(23, 33, 56, 0.7);
    --cyan: #00f0ff;
    --telecom-orange: #ff6b00;
    --neon-green: #00ff88;
    --neon-yellow: #ffd700;
    --neon-pink: #ff007f;
    --neon-purple: #8b5cf6;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-glow: rgba(0, 240, 255, 0.25);
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-sub: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* FLATICON COLORFUL ICONS */
.flaticon-icon {
    width: 17px;
    height: 17px;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

.flaticon-icon-sm {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

.flaticon-icon-lg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* TOP HEADER BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 0.35rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

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

.sub-badge {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: var(--telecom-orange);
    text-transform: uppercase;
    font-weight: 700;
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--cyan), var(--telecom-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* STOPWATCH TIMER BOX */
.timer-display-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 10px;
    padding: 0.2rem 1.1rem;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.timer-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-value {
    font-family: var(--font-code);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 1px;
    line-height: 1.1;
}

.timer-status {
    font-family: var(--font-heading);
    font-size: 0.58rem;
    color: var(--neon-green);
    letter-spacing: 0.5px;
    font-weight: 700;
}

.timer-display-box.running {
    border-color: var(--neon-green);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.3);
}

.timer-display-box.running .timer-status {
    color: var(--neon-green);
    animation: pulseGlow 1s infinite;
}

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

/* HEADER ACTIONS & THEME TOGGLE */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* NAV TABS */
.header-nav-tabs {
    display: flex;
    gap: 0.4rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: rgba(0, 240, 255, 0.15);
    color: #fff;
    border-color: var(--cyan);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--cyan), #0077ff);
    color: #040914;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* THEME TOGGLE (ICON-ONLY) */
.theme-toggle-btn.icon-only {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle-btn.icon-only:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--cyan);
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

/* MAIN VIEW LAYOUT */
.main-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.view-panel {
    display: none;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.view-panel.active-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* 3 COLUMNS GRID */
.game-grid-layout {
    display: grid;
    grid-template-columns: 310px 1fr 340px;
    gap: 0.6rem;
    height: 100%;
    min-height: 0;
    flex: 1;
}

.panel-card {
    background: var(--bg-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.35rem;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    letter-spacing: 0.8px;
    color: #fff;
}

.bot-badge, .guide-tag {
    font-family: var(--font-code);
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(0, 240, 255, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
}

/* LEFT PANEL (BOT CONTROLLER) */
.agent-setup-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
}

.field-label {
    font-family: var(--font-sub);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    display: block;
}

.input-group {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.78rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), #0088ff);
    color: #040914;
    border: none;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

.active-agent-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.active-agent-badge strong {
    color: var(--neon-green);
    font-family: var(--font-code);
}

/* ACTION BUTTONS (START / RESET) */
.action-buttons-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
}

.btn-action-start {
    flex: 2;
    background: linear-gradient(135deg, #00ff88, #00b359);
    color: #040914;
    border: none;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
    transition: all 0.15s;
}

.btn-action-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 255, 136, 0.5);
}

.btn-action-start:active {
    transform: scale(0.98);
}

.btn-action-reset {
    flex: 1;
    background: rgba(255, 0, 80, 0.15);
    border: 1px solid rgba(255, 0, 80, 0.4);
    color: #ff5e85;
    border-radius: 8px;
    font-family: var(--font-sub);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-reset:hover {
    background: rgba(255, 0, 80, 0.4);
    color: #fff;
}

/* NUMBERED COMPONENTS LIST FOR BOTS */
.components-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-title-small {
    font-family: var(--font-sub);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--telecom-orange);
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    flex-shrink: 0;
}

.component-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 2px;
}

.comp-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    color: #fff;
    pointer-events: auto;
    flex-shrink: 0;
}

.comp-btn * {
    pointer-events: none;
}

.comp-btn:not(:disabled):hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan);
    transform: translateX(3px);
    cursor: pointer;
}

.comp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.comp-btn.active-target {
    border-color: var(--neon-yellow) !important;
    background: rgba(255, 215, 0, 0.15) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.35) !important;
    animation: pulseTarget 1.2s infinite;
    cursor: pointer !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

@keyframes pulseTarget {
    0%, 100% { border-color: var(--neon-yellow); }
    50% { border-color: #fff; }
}

.comp-btn.completed {
    border-color: var(--neon-green);
    background: rgba(0, 255, 136, 0.1);
    opacity: 0.9;
    cursor: default;
}

.comp-num-badge {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1.5px solid var(--cyan);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.82rem;
    color: var(--cyan);
}

.comp-btn.completed .comp-num-badge {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #040914;
}

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

.comp-title {
    font-family: var(--font-sub);
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    line-height: 1.1;
}

.comp-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-status {
    font-family: var(--font-code);
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.comp-btn.completed .comp-status {
    color: var(--neon-green);
}

/* SUBMIT BUTTON */
.submit-section {
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.btn-submit-build {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #ff6b00, #ff007f);
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 3px 15px rgba(255, 107, 0, 0.35);
    transition: all 0.2s;
}

.btn-submit-build:not(:disabled):hover {
    filter: brightness(1.2);
    box-shadow: 0 5px 20px rgba(255, 107, 0, 0.6);
    transform: translateY(-1px);
}

.btn-submit-build:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #2a344d;
    box-shadow: none;
}

.submit-num-badge {
    background: rgba(0, 0, 0, 0.4);
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* CENTER PANEL (VISUALIZATION OF TOWER - THREE.JS 3D) */
.center-panel {
    display: flex;
    flex-direction: column;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.three-badge {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 136, 255, 0.2));
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-family: var(--font-heading);
    font-size: 0.58rem;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.progress-container {
    display: flex;
    gap: 0.35rem;
    font-family: var(--font-sub);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.progress-container strong {
    color: var(--cyan);
    font-family: var(--font-code);
}

/* 3D STAGE & CANVAS */
.tower-3d-stage {
    flex: 1;
    min-height: 0;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at 50% 30%, #0d172a 0%, #060912 100%);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

/* FULLSCREEN 3D VIEWPORT */
.tower-3d-stage:fullscreen,
.tower-3d-stage:-webkit-full-screen,
.tower-3d-stage.is-fullscreen-fallback {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 99999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #060912 !important;
}

.hud-btn-fullscreen {
    background: rgba(0, 240, 255, 0.15) !important;
    border-color: var(--cyan) !important;
    color: var(--cyan) !important;
    font-weight: 700;
}

.hud-btn-fullscreen:hover {
    background: rgba(0, 240, 255, 0.35) !important;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.three-canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.three-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
}

.three-canvas-container canvas:active {
    cursor: grabbing;
}

/* 3D HUD TOOLBAR */
.viewport-hud-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(10, 14, 23, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 20px;
    padding: 0.25rem 0.5rem;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.hud-label {
    font-family: var(--font-heading);
    font-size: 0.62rem;
    color: var(--telecom-orange);
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-right: 0.1rem;
    padding-left: 0.2rem;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-family: var(--font-sub);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.55rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.hud-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--cyan);
    color: #fff;
    transform: translateY(-1px);
}

.hud-btn.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 136, 255, 0.35));
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* 3D INTERACTION HINT */
.viewport-interaction-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-family: var(--font-code);
    font-size: 0.65rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

/* LIVE STATUS LOG */
.status-log-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.8rem;
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--text-muted);
    max-height: 70px;
    overflow-y: auto;
}

.status-log-box code {
    color: var(--cyan);
}

/* RIGHT PANEL (GUIDE FOR BOT HERMES/OPENCLAW) */
.right-panel {
    display: flex;
    flex-direction: column;
}

.guide-content-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 4px;
}

.guide-alert {
    background: rgba(0, 240, 255, 0.08);
    border-left: 4px solid var(--cyan);
    padding: 0.6rem 0.8rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.guide-alert code {
    background: rgba(0, 0, 0, 0.5);
    color: var(--neon-yellow);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-code);
}

.guide-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.8rem;
}

.guide-card h3 {
    font-family: var(--font-sub);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--telecom-orange);
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.guide-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.guide-table th, .guide-table td {
    padding: 0.35rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guide-table th {
    color: var(--text-muted);
    font-family: var(--font-sub);
    font-weight: 700;
}

.num-tag {
    background: var(--cyan);
    color: #000;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-code);
}

.guide-table code {
    color: var(--neon-green);
    font-family: var(--font-code);
    font-size: 0.72rem;
}

.code-block {
    background: #040812;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 6px;
    padding: 0.6rem;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--cyan);
    overflow-x: auto;
}

.url-badge {
    background: #040812;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0.5rem;
    border-radius: 6px;
    font-family: var(--font-code);
    font-size: 0.68rem;
    color: var(--neon-yellow);
    word-break: break-all;
}

.btn-demo-sim {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--cyan));
    border: none;
    border-radius: 8px;
    padding: 0.7rem;
    color: #fff;
    font-family: var(--font-sub);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-demo-sim:hover {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

/* LEADERBOARD VIEW */
.leaderboard-full-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.lb-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.lb-top-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--neon-yellow);
}

.lb-top-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.lb-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.lb-reset-box {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.lb-pwd-input {
    background: rgba(4, 8, 18, 0.8);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 0.48rem 0.8rem;
    font-size: 0.78rem;
    color: #fca5a5;
    font-family: var(--font-code);
    outline: none;
    width: 140px;
    transition: all 0.2s;
}

.lb-pwd-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
    width: 160px;
}

.lb-pwd-input::placeholder {
    color: rgba(239, 68, 68, 0.5);
}

.btn-danger-outline {
    background: rgba(255, 0, 80, 0.15);
    border: 1px solid rgba(255, 0, 80, 0.4);
    color: #ff5e85;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-danger-outline:hover {
    background: rgba(255, 0, 80, 0.3);
    border-color: #ff0050;
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 0, 80, 0.4);
    transform: translateY(-1px);
}

.lb-table-wrapper {
    flex: 1;
    overflow-y: auto;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.8rem 1rem;
    text-align: left;
    font-family: var(--font-sub);
    font-weight: 700;
    color: var(--cyan);
    font-size: 0.85rem;
    border-bottom: 2px solid rgba(0, 240, 255, 0.2);
}

.lb-table td {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-table tr:hover {
    background: rgba(0, 240, 255, 0.05);
}

.lb-table .rank-cell {
    font-family: var(--font-heading);
    font-weight: 900;
}

.lb-table tr:nth-child(1) .rank-cell { color: #ffd700; font-size: 1.1rem; }
.lb-table tr:nth-child(2) .rank-cell { color: #e0e0e0; font-size: 1.05rem; }
.lb-table tr:nth-child(3) .rank-cell { color: #cd7f32; font-size: 1rem; }

.lb-table .time-cell {
    font-family: var(--font-code);
    font-weight: 800;
    color: var(--neon-green);
}

.lb-table .bot-cell {
    font-family: var(--font-code);
    font-weight: 700;
    color: #fff;
}

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    background: rgba(16, 24, 40, 0.95);
    border: 1px solid var(--cyan);
    color: #fff;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: slideInToast 0.3s ease-out;
}

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

/* 3D PART HOVER TOOLTIP HUD */
.part-tooltip-hud {
    position: absolute;
    display: none;
    pointer-events: none;
    z-index: 25;
    background: rgba(10, 16, 30, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 240, 255, 0.6);
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.35), 0 0 10px rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -130%);
    transition: opacity 0.15s ease-out;
}

.part-tooltip-hud .tooltip-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    margin-right: 6px;
}

.part-tooltip-hud .tooltip-action {
    color: var(--neon-green);
    font-size: 0.7rem;
    margin-left: 6px;
    font-weight: 600;
}

/* CLICKABLE SPEC ROWS IN SOP GUIDE */
.guide-table tbody tr {
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}

.guide-table tbody tr:hover {
    background: rgba(0, 240, 255, 0.12);
    transform: translateX(3px);
}

.guide-table tbody tr:active {
    transform: scale(0.98);
}

.spec-inspect-hint {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* HUAWEI TECHNICAL SPEC MODAL */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 18, 0.78);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.spec-modal-card {
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    background: linear-gradient(165deg, rgba(17, 24, 39, 0.95), rgba(11, 17, 30, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .spec-modal-card {
    transform: scale(1) translateY(0);
}

.spec-modal-header {
    padding: 1.2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spec-brand-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.huawei-brand-badge {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 119, 255, 0.35));
    border: 1px solid rgba(0, 240, 255, 0.5);
    color: var(--cyan);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.spec-modal-header h2 {
    font-size: 1.15rem;
    color: #fff;
    font-family: var(--font-heading);
    margin: 0;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: rgba(225, 20, 20, 0.6);
    border-color: #e11414;
}

.spec-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.spec-product-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    padding: 1.1rem;
}

.spec-icon-box {
    font-size: 2.2rem;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spec-product-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15rem;
    color: var(--cyan);
    font-family: var(--font-heading);
}

.spec-product-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.spec-product-desc {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 0;
}

.spec-section-title {
    font-size: 0.85rem;
    color: #f8fafc;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0.3rem 0;
}

.spec-table-custom {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.spec-table-custom tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-table-custom tr:last-child {
    border-bottom: none;
}

.spec-table-custom td {
    padding: 0.6rem 0.85rem;
    font-size: 0.78rem;
}

.spec-table-custom td:first-child {
    width: 38%;
    color: #94a3b8;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-table-custom td:last-child {
    color: #f1f5f9;
    font-family: var(--font-code);
}

.spec-notes-box {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid var(--neon-green);
    border-radius: 4px 8px 8px 4px;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    line-height: 1.45;
}

.spec-modal-footer {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.btn-focus-3d {
    background: linear-gradient(135deg, var(--cyan), #0077ff);
    color: #040914;
    font-weight: 700;
    border: none;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-focus-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.55);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE (HP) OPTIMIZATION
   ========================================================================== */

@media (max-width: 1200px) {
    .game-grid-layout {
        grid-template-columns: 340px 1fr 340px;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .game-grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .center-panel {
        order: 1;
    }
    
    .left-panel {
        order: 2;
    }
    
    .right-panel {
        order: 3;
    }
    
    .tower-3d-stage {
        min-height: 320px;
        height: 340px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0.6rem;
        gap: 0.75rem;
    }

    /* TOP HEADER BAR */
    .top-bar {
        padding: 0.65rem 0.85rem;
        border-radius: 12px;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .brand {
        flex: 1;
        min-width: 140px;
    }

    .sub-badge {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }

    .brand h1 {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }

    .timer-display-box {
        padding: 0.25rem 0.8rem;
        border-radius: 8px;
    }

    .timer-label {
        font-size: 0.62rem;
    }

    .timer-value {
        font-size: 1.35rem;
    }

    .timer-status {
        font-size: 0.58rem;
    }

    .header-nav-tabs {
        width: 100%;
        display: flex;
        gap: 0.4rem;
    }

    .nav-tab {
        flex: 1;
        text-align: center;
        padding: 0.45rem 0.6rem;
        font-size: 0.78rem;
        border-radius: 8px;
    }

    /* 3D TOWER VIEWPORT */
    .tower-3d-stage {
        min-height: 250px;
        height: 270px;
        max-height: 300px;
        border-radius: 10px;
    }

    .viewport-hud-toolbar {
        top: 6px;
        left: 6px;
        right: 6px;
        gap: 0.3rem;
    }

    .hud-group {
        padding: 0.15rem 0.35rem;
        gap: 0.2rem;
    }

    .hud-label {
        font-size: 0.55rem;
    }

    .hud-btn {
        padding: 0.18rem 0.38rem;
        font-size: 0.62rem;
        border-radius: 10px;
    }

    .viewport-interaction-hint {
        font-size: 0.62rem;
        padding: 0.2rem 0.5rem;
        bottom: 6px;
        white-space: nowrap;
        max-width: 90%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* PANELS */
    .panel-card {
        padding: 0.75rem;
        border-radius: 12px;
        gap: 0.5rem;
    }

    .panel-header {
        padding-bottom: 0.4rem;
        margin-bottom: 0.5rem;
    }

    .panel-header h2 {
        font-size: 0.88rem;
    }

    .bot-badge, .guide-tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }

    /* BOT CONTROLLER */
    .agent-setup-box {
        padding: 0.5rem 0.65rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }

    .field-label {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
    }

    .input-group {
        display: flex;
        gap: 0.4rem;
    }

    .input-group input {
        padding: 0.4rem 0.6rem;
        font-size: 0.78rem;
        border-radius: 6px;
    }

    .input-group button, .btn-primary {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .active-agent-badge {
        font-size: 0.7rem;
        margin-top: 0.35rem;
    }

    /* ACTION BUTTONS */
    .action-buttons-row {
        gap: 0.5rem;
        margin-bottom: 0.6rem;
    }

    .btn-action-start, .btn-action-reset {
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    /* NUMBERED COMPONENT BUTTONS */
    .section-title-small {
        font-size: 0.68rem;
        margin-bottom: 0.35rem;
    }

    .component-list {
        max-height: none;
        gap: 0.35rem;
    }

    .comp-btn {
        padding: 0.45rem 0.6rem;
        gap: 0.55rem;
        border-radius: 8px;
    }

    .comp-num-badge {
        width: 26px;
        height: 26px;
        font-size: 0.88rem;
        border-radius: 6px;
        border-width: 1.5px;
    }

    .comp-title {
        font-size: 0.8rem;
    }

    .comp-desc {
        font-size: 0.64rem;
        line-height: 1.25;
    }

    .comp-status {
        font-size: 0.62rem;
        padding: 0.15rem 0.35rem;
        border-radius: 4px;
    }

    .btn-submit-build {
        padding: 0.65rem 0.9rem;
        font-size: 0.88rem;
        border-radius: 8px;
        gap: 0.6rem;
    }

    .submit-num-badge {
        width: 24px;
        height: 24px;
        font-size: 0.88rem;
    }

    /* SOP GUIDE TABLE */
    .guide-content-scroll {
        max-height: none;
    }

    .guide-alert {
        font-size: 0.72rem;
        padding: 0.5rem 0.65rem;
        border-radius: 8px;
        line-height: 1.4;
    }

    .guide-table {
        font-size: 0.72rem;
    }

    .guide-table th, .guide-table td {
        padding: 0.4rem 0.5rem;
    }

    .guide-table td code {
        font-size: 0.65rem;
    }

    /* LEADERBOARD VIEW */
    .leaderboard-full-card {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .lb-top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .lb-top-header h2 {
        font-size: 0.95rem;
    }

    .lb-top-header p {
        font-size: 0.72rem;
    }

    .lb-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .lb-reset-box {
        width: 100%;
        display: flex;
        gap: 0.4rem;
    }

    .lb-pwd-input {
        flex: 1;
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .btn-danger-outline {
        font-size: 0.72rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
    }

    .lb-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lb-table {
        min-width: 480px;
        font-size: 0.75rem;
    }

    .lb-table th, .lb-table td {
        padding: 0.45rem 0.55rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.4rem;
    }

    .brand h1 {
        font-size: 0.95rem;
    }

    .timer-value {
        font-size: 1.2rem;
    }

    .tower-3d-stage {
        min-height: 220px;
        height: 235px;
        max-height: 250px;
    }

    .comp-title {
        font-size: 0.76rem;
    }

    .comp-desc {
        display: none;
    }

    .comp-btn {
        padding: 0.4rem 0.55rem;
    }
}

/* ==========================================================================
   LIGHT THEME (TEMA PUTIH / TERANG)
   ========================================================================== */
body.theme-light,
[data-theme="light"] {
    --bg-dark: #f0f4f9;
    --bg-panel: rgba(255, 255, 255, 0.94);
    --bg-card: rgba(243, 246, 250, 0.95);
    --cyan: #0284c7;
    --telecom-orange: #ea580c;
    --neon-green: #15803d;
    --neon-yellow: #b45309;
    --neon-pink: #be185d;
    --neon-purple: #6d28d9;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --border-glow: rgba(2, 132, 199, 0.35);
}

body.theme-light {
    background-color: #eef2f6;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.1) 0%, transparent 60%),
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 28px 28px, 28px 28px;
    color: #0f172a;
}

body.theme-light .top-bar {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(2, 132, 199, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.theme-light .brand h1 {
    color: #0f172a;
}

body.theme-light .timer-display-box {
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.15);
}

body.theme-light .timer-label {
    color: #64748b;
}

body.theme-light .timer-value {
    color: #b45309;
    text-shadow: none;
}

body.theme-light .timer-status {
    color: #15803d;
}

body.theme-light .timer-display-box.running {
    border-color: #15803d;
    box-shadow: 0 0 20px rgba(21, 128, 61, 0.25);
}

body.theme-light .nav-tab {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #475569;
}

body.theme-light .nav-tab:hover {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border-color: #0284c7;
}

body.theme-light .nav-tab.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

body.theme-light .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

body.theme-light .theme-toggle-btn:hover {
    background: rgba(2, 132, 199, 0.12);
    border-color: #0284c7;
    color: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
}

body.theme-light .panel-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(2, 132, 199, 0.22);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

body.theme-light .panel-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .panel-header h2 {
    color: #0f172a;
}

body.theme-light .agent-setup-box {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .input-group input {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.35);
    color: #0f172a;
}

body.theme-light .btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
}

body.theme-light .btn-primary:hover {
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

body.theme-light .btn-action-start {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.3);
}

body.theme-light .btn-action-reset {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

body.theme-light .btn-action-reset:hover {
    background: #dc2626;
    color: #ffffff;
}

body.theme-light .comp-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

body.theme-light .comp-btn:not(:disabled):hover {
    background: #f0f9ff;
    border-color: #0284c7;
}

body.theme-light .comp-btn.active-target {
    border-color: #ea580c !important;
    background: #fff7ed !important;
    box-shadow: 0 0 14px rgba(234, 88, 12, 0.3) !important;
}

body.theme-light .comp-btn.completed {
    border-color: #16a34a;
    background: #f0fdf4;
}

body.theme-light .comp-num-badge {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

body.theme-light .comp-btn.completed .comp-num-badge {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

body.theme-light .comp-title {
    color: #0f172a;
}

body.theme-light .comp-status {
    background: #f1f5f9;
    color: #475569;
}

body.theme-light .comp-btn.completed .comp-status {
    color: #15803d;
    background: #dcfce7;
}

body.theme-light .btn-submit-build:disabled {
    background: #e2e8f0;
    color: #94a3b8;
}

body.theme-light .status-log-box {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
    color: #334155;
}

body.theme-light .status-log-box code {
    color: #0284c7;
    font-weight: 600;
}

body.theme-light .guide-alert {
    background: #f0f9ff;
    border-left-color: #0284c7;
    color: #0369a1;
}

body.theme-light .guide-alert code {
    background: #e0f2fe;
    color: #b45309;
}

body.theme-light .guide-card {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .guide-table th {
    color: #475569;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .guide-table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

body.theme-light .guide-table tbody tr:hover {
    background: #e0f2fe;
}

body.theme-light .num-tag {
    background: #0284c7;
    color: #ffffff;
}

body.theme-light .guide-table code {
    color: #15803d;
}

body.theme-light .code-block {
    background: #f1f5f9;
    border-color: rgba(2, 132, 199, 0.3);
    color: #0369a1;
}

body.theme-light .url-badge {
    background: #fffbeb;
    border-color: rgba(180, 83, 9, 0.3);
    color: #92400e;
}

body.theme-light .btn-demo-sim {
    background: linear-gradient(135deg, #7c3aed, #0284c7);
    color: #ffffff;
}

body.theme-light .tower-3d-stage {
    border-color: rgba(2, 132, 199, 0.35);
    background: #dbeafe;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.08);
}

body.theme-light .hud-group {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.theme-light .hud-label {
    color: #ea580c;
}

body.theme-light .hud-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

body.theme-light .hud-btn:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

body.theme-light .hud-btn.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border-color: #0284c7;
    color: #ffffff;
}

body.theme-light .hud-btn-fullscreen {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

body.theme-light .viewport-interaction-hint {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.12);
    color: #475569;
}

body.theme-light .leaderboard-full-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(2, 132, 199, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

body.theme-light .lb-top-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .lb-top-header h2 {
    color: #b45309;
}

body.theme-light .lb-top-header p {
    color: #64748b;
}

body.theme-light .lb-pwd-input {
    background: #ffffff;
    border-color: rgba(239, 68, 68, 0.4);
    color: #b91c1c;
}

body.theme-light .lb-table th {
    background: #f1f5f9;
    color: #0284c7;
    border-bottom-color: rgba(2, 132, 199, 0.3);
}

body.theme-light .lb-table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

body.theme-light .lb-table tr:hover {
    background: #f0f9ff;
}

body.theme-light .lb-table .bot-cell {
    color: #0f172a;
}

body.theme-light .lb-table .time-cell {
    color: #15803d;
}

body.theme-light .spec-modal-card {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

body.theme-light .spec-modal-header {
    background: #f8fafc;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .spec-modal-header h2 {
    color: #0f172a;
}

body.theme-light .btn-close-modal {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

body.theme-light .btn-close-modal:hover {
    background: #ef4444;
    color: #ffffff;
}

body.theme-light .spec-product-hero {
    background: #f0f9ff;
    border-color: rgba(2, 132, 199, 0.25);
}

body.theme-light .spec-product-tag {
    background: #e2e8f0;
    color: #334155;
}

body.theme-light .spec-product-desc {
    color: #334155;
}

body.theme-light .spec-section-title {
    color: #0f172a;
}

body.theme-light .spec-table-custom {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .spec-table-custom tr {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .spec-table-custom td:first-child {
    color: #475569;
    background: #f8fafc;
    border-right-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .spec-table-custom td:last-child {
    color: #0f172a;
}

body.theme-light .spec-notes-box {
    background: #f0fdf4;
    border-left-color: #16a34a;
    color: #166534;
}

body.theme-light .spec-modal-footer {
    background: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .toast {
    background: #ffffff;
    border-color: #0284c7;
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.theme-light .part-tooltip-hud {
    background: rgba(255, 255, 255, 0.95);
    border-color: #0284c7;
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.25), 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   LEADERBOARD (3D FULL BTS CONFIG & TOP-LEFT FLOATING RANKING HUD)
   ========================================================================== */
.lb2-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    border: 1px solid var(--border-glow);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(0, 240, 255, 0.05);
}

.lb2-3d-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.lb2-hud-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    width: 440px;
    max-width: calc(100% - 30px);
    max-height: calc(100% - 30px);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    animation: fadeInSlideLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lb2-card {
    pointer-events: auto;
    background: rgba(10, 16, 30, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 240, 255, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 110px);
    overflow: hidden;
}

.lb2-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.08) 0%, transparent 100%);
}

.lb2-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb2-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.lb2-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb2-badge {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--cyan);
    font-weight: 700;
}

.lb2-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
}

.lb2-refresh-btn {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-family: var(--font-sub);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb2-refresh-btn:hover {
    background: var(--cyan);
    color: #000000;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

/* Podium Top 3 Mini Cards */
.lb2-podium-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lb2-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    transition: transform 0.2s ease;
}

.lb2-podium-card:hover {
    transform: translateY(-2px);
}

.lb2-podium-card.rank-1 {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.02) 100%);
    border-color: rgba(255, 215, 0, 0.45);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.lb2-podium-card.rank-2 {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.02) 100%);
    border-color: rgba(192, 192, 192, 0.4);
}

.lb2-podium-card.rank-3 {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.02) 100%);
    border-color: rgba(205, 127, 50, 0.4);
}

.lb2-podium-medal {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.lb2-podium-name {
    font-family: var(--font-sub);
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lb2-podium-time {
    font-family: var(--font-code);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--neon-yellow);
    margin-top: 2px;
}

/* Scrollable Table List */
.lb2-table-container {
    overflow-y: auto;
    max-height: 280px;
    padding: 0 0.5rem;
}

.lb2-table-container::-webkit-scrollbar {
    width: 6px;
}

.lb2-table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.lb2-table-container::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 4px;
}

.lb2-rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.lb2-rank-table thead th {
    position: sticky;
    top: 0;
    background: rgba(10, 16, 30, 0.95);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    z-index: 2;
}

.lb2-rank-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.lb2-rank-table tbody tr:hover {
    background: rgba(0, 240, 255, 0.08);
}

.lb2-rank-table tbody tr.row-top-1 {
    background: rgba(255, 215, 0, 0.06);
}

.lb2-rank-table tbody td {
    padding: 7px 10px;
    color: var(--text-primary);
}

.lb2-rank-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--cyan);
}

.lb2-rank-table tbody tr.row-top-1 .lb2-rank-num {
    color: var(--neon-yellow);
}

.lb2-agent-name {
    font-family: var(--font-sub);
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.lb2-time-val {
    font-family: var(--font-code);
    font-weight: 700;
    color: var(--neon-green);
    text-align: right;
    font-size: 0.82rem;
}

.lb2-time-ts {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.lb2-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    font-family: var(--font-sub);
    color: var(--text-muted);
}

.lb2-sync-status {
    color: var(--neon-green);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Floating 3D Controls (Top-Right) */
.lb2-viewport-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    background: rgba(10, 16, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Theme light adjustments for Leaderboard 2 */
body.theme-light .lb2-wrapper {
    background: #f1f5f9;
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
}

body.theme-light .lb2-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(2, 132, 199, 0.1);
}

body.theme-light .lb2-card-header {
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.1) 0%, transparent 100%);
    border-bottom-color: rgba(2, 132, 199, 0.2);
}

body.theme-light .lb2-title {
    color: #0f172a;
}

body.theme-light .lb2-badge {
    color: #0284c7;
}

body.theme-light .lb2-refresh-btn {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

body.theme-light .lb2-refresh-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

body.theme-light .lb2-podium-row {
    background: #f8fafc;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .lb2-podium-name {
    color: #0f172a;
}

body.theme-light .lb2-podium-time {
    color: #d97706;
}

body.theme-light .lb2-rank-table thead th {
    background: rgba(255, 255, 255, 0.95);
    color: #64748b;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .lb2-rank-table tbody td {
    color: #1e293b;
}

body.theme-light .lb2-agent-name {
    color: #0f172a;
}

body.theme-light .lb2-time-val {
    color: #16a34a;
}

body.theme-light .lb2-card-footer {
    background: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.06);
    color: #64748b;
}

body.theme-light .lb2-viewport-controls {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness for 3D Leaderboard */
@media (max-width: 900px) {
    .lb2-hud-overlay {
        position: static;
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
    }

    .lb2-wrapper {
        height: auto;
        min-height: 480px;
        display: flex;
        flex-direction: column;
    }

    .lb2-3d-stage {
        position: relative;
        height: 400px;
    }

    .lb2-viewport-controls {
        top: 10px;
        right: 10px;
        padding: 6px 8px;
    }
}



