/* Terminal 43 System -- Custom Theme */

:root {
    --t43-glow-green: 0 0 20px rgba(0, 255, 65, 0.15);
    --t43-glow-blue: 0 0 20px rgba(88, 166, 255, 0.15);
    --t43-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0e14; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* Selection */
::selection { background: rgba(0, 255, 65, 0.2); color: #e6edf3; }

/* Terminal cursor blink */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink { animation: blink 1s step-end infinite; }

/* Glow effects */
.glow-green { box-shadow: var(--t43-glow-green); }
.glow-green-text { text-shadow: 0 0 10px rgba(0, 255, 65, 0.4); }
.glow-blue { box-shadow: var(--t43-glow-blue); }

/* Nav dropdowns */
.nav-dropdown { pointer-events: none; opacity: 0; transform: translateY(-4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.group:hover .nav-dropdown { pointer-events: auto; opacity: 1; transform: translateY(0); display: block !important; }

/* Card hover */
.card-hover {
    transition: all 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--t43-shadow-card), 0 0 20px rgba(0, 255, 65, 0.08);
    border-color: #39d353;
}

/* Difficulty badges */
.diff-trivial { color: #39d353; background: rgba(57, 211, 83, 0.1); }
.diff-easy { color: #e3b341; background: rgba(227, 179, 65, 0.1); }
.diff-medium { color: #f0883e; background: rgba(240, 136, 62, 0.1); }
.diff-hard { color: #f85149; background: rgba(248, 81, 73, 0.1); }
.diff-insane { color: #bc8cff; background: rgba(188, 140, 255, 0.1); }

/* Progress bar */
.progress-bar {
    background: #21262d;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-fill {
    background: linear-gradient(90deg, #1a7f37, #39d353, #00ff41);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Typing animation */
@keyframes typing { from { width: 0; } to { width: 100%; } }
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #00ff41;
    animation: typing 2s steps(30) forwards, blink 1s step-end infinite;
}

/* GSAP animation initial state */
.gsap-fade { opacity: 0; transform: translateY(30px); }
.gsap-fade-left { opacity: 0; transform: translateX(-30px); }
.gsap-fade-right { opacity: 0; transform: translateX(30px); }

/* Flash messages auto-dismiss */
.flash-msg { animation: fadeIn 0.3s ease, fadeOut 0.3s ease 4s forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; height: 0; padding: 0; margin: 0; overflow: hidden; } }

/* Scanline overlay */
.scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    pointer-events: none;
}

/* Stat card */
.stat-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: #39d353; }

/* Pulse animation for container status */
@keyframes pulse-green { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse-green { animation: pulse-green 2s ease-in-out infinite; }

/* Code blocks */
pre code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

/* ── Prose / Markdown Content Styling ── */
#lesson-content h1 { font-size: 1.75rem; font-weight: 700; color: #e6edf3; margin: 1.5rem 0 0.75rem; }
#lesson-content h2 { font-size: 1.35rem; font-weight: 700; color: #e6edf3; margin: 2rem 0 0.6rem; padding-bottom: 0.3rem; border-bottom: 1px solid #21262d; }
#lesson-content h3 { font-size: 1.1rem; font-weight: 600; color: #c9d1d9; margin: 1.5rem 0 0.5rem; }
#lesson-content p { margin: 0.6rem 0; line-height: 1.7; }
#lesson-content strong { color: #e6edf3; }
#lesson-content em { color: #c9d1d9; }
#lesson-content a { color: #58a6ff; text-decoration: underline; }
#lesson-content ul, #lesson-content ol { margin: 0.5rem 0; padding-left: 1.5rem; }
#lesson-content li { margin: 0.25rem 0; line-height: 1.6; }
#lesson-content ul li { list-style: disc; }
#lesson-content ol li { list-style: decimal; }
#lesson-content blockquote { border-left: 3px solid #39d353; padding: 0.5rem 1rem; margin: 1rem 0; background: rgba(57, 211, 83, 0.05); border-radius: 0 0.5rem 0.5rem 0; }
#lesson-content blockquote p { margin: 0.25rem 0; }
#lesson-content pre { background: #0d1117; border: 1px solid #21262d; border-radius: 0.5rem; padding: 1rem; overflow-x: auto; margin: 0.75rem 0; }
#lesson-content pre code { background: none; border: none; padding: 0; font-size: 0.85rem; color: #e6edf3; }
#lesson-content code { background: #21262d; color: #f0883e; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
#lesson-content table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.9rem; }
#lesson-content th { background: #161b22; padding: 0.6rem 0.75rem; text-align: left; border-bottom: 2px solid #30363d; color: #e6edf3; font-weight: 600; }
#lesson-content td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #21262d; }
#lesson-content tr:hover { background: rgba(22, 27, 34, 0.5); }
#lesson-content hr { border: none; border-top: 1px solid #21262d; margin: 1.5rem 0; }
#lesson-content h1:first-child { display: none; }

/* Table styles */
.t43-table { width: 100%; border-collapse: collapse; }
.t43-table thead { background: #161b22; }
.t43-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #8b949e; border-bottom: 1px solid #21262d; }
.t43-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #21262d; font-size: 0.875rem; }
.t43-table tbody tr:hover { background: #161b22; }

/* Form inputs */
.t43-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    color: #e6edf3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}
.t43-input:focus {
    outline: none;
    border-color: #39d353;
    box-shadow: 0 0 0 3px rgba(57, 211, 83, 0.15);
}
.t43-input::placeholder { color: #484f58; }

/* Buttons */
.btn-primary {
    background: #39d353;
    color: #0a0e14;
    font-weight: 700;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: #00ff41; box-shadow: 0 0 15px rgba(0, 255, 65, 0.3); }

.btn-secondary {
    background: #21262d;
    color: #e6edf3;
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #30363d;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-secondary:hover { background: #30363d; border-color: #484f58; }

.btn-danger {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(248, 81, 73, 0.3);
    transition: all 0.2s;
    cursor: pointer;
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.2); }

/* Toast slide-in */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.animate-slide-in { animation: slideIn 0.3s ease-out; }

/* Confetti burst -- challenge solve celebration */
@keyframes confettiBurst {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}
.confetti-burst {
    position: fixed; top: 50%; left: 50%; width: 200px; height: 200px;
    margin: -100px 0 0 -100px; z-index: 200; pointer-events: none;
    border-radius: 50%; background: radial-gradient(circle, rgba(0,255,65,0.4) 0%, transparent 70%);
    animation: confettiBurst 0.8s ease-out forwards;
}

/* ── Light Theme ── */
html:not(.dark) body { background: #f6f8fa; color: #1f2328; }
html:not(.dark) .bg-t43-black { background: #f6f8fa; }
html:not(.dark) .bg-t43-darker { background: #ffffff; }
html:not(.dark) .bg-t43-dark { background: #ffffff; }
html:not(.dark) .bg-t43-medium { background: #d0d7de; }
html:not(.dark) .border-t43-medium { border-color: #d0d7de; }
html:not(.dark) .text-t43-text { color: #1f2328; }
html:not(.dark) .text-t43-text-secondary { color: #656d76; }
html:not(.dark) .text-t43-text-tertiary { color: #8b949e; }
html:not(.dark) .stat-card { background: #ffffff; border-color: #d0d7de; }
html:not(.dark) .t43-input { background: #ffffff; border-color: #d0d7de; color: #1f2328; }
html:not(.dark) .t43-table td { border-color: #d0d7de; }
html:not(.dark) .t43-table thead { background: #f6f8fa; }
html:not(.dark) nav.bg-t43-darker { background: #ffffff; border-color: #d0d7de; }
html:not(.dark) footer.bg-t43-darker { background: #ffffff; border-color: #d0d7de; }
html:not(.dark) ::-webkit-scrollbar-track { background: #f6f8fa; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: #d0d7de; }
html:not(.dark) ::selection { background: rgba(0, 255, 65, 0.15); color: #1f2328; }
html:not(.dark) #lesson-content pre { background: #f6f8fa; border-color: #d0d7de; }
html:not(.dark) #lesson-content pre code { color: #1f2328; }
html:not(.dark) #lesson-content code { background: #eff1f3; color: #cf222e; }
html:not(.dark) #lesson-content h1, html:not(.dark) #lesson-content h2 { color: #1f2328; }
html:not(.dark) #lesson-content h2 { border-color: #d0d7de; }
html:not(.dark) #lesson-content th { background: #f6f8fa; color: #1f2328; }
html:not(.dark) #lesson-content td { border-color: #d0d7de; }
html:not(.dark) #lesson-content blockquote { background: rgba(57,211,83,0.08); }
html:not(.dark) .progress-bar { background: #d0d7de; }

/* ── Landing Page & Dashboard Animation Enhancements ── */

/* Hero grid background */
.hero-grid-bg {
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Section divider with gradient fade */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
}

/* GSAP initial state -- scale entrance */
.gsap-scale { opacity: 0; transform: scale(0.8); }

/* Dashboard GSAP initial states */
.dash-stat { opacity: 0; transform: translateY(30px) scale(0.95); }
.dash-container-card { opacity: 0; transform: translateX(-20px); }
.dash-submission { opacity: 0; transform: translateY(15px); }
.dash-sidebar-card { opacity: 0; transform: translateX(20px); }
.dash-classroom { opacity: 0; transform: translateX(20px); }

/* Enhanced status dot for running containers */
.status-dot-running {
    width: 10px; height: 10px;
    background: #39d353; border-radius: 50%;
    box-shadow: 0 0 8px rgba(57, 211, 83, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

/* Sidebar icon hover shift */
.icon-shift-right { transition: transform 0.2s ease; }
.card-hover:hover .icon-shift-right { transform: translateX(3px); }

/* Stat value hover scale */
.stat-value-hover { transition: transform 0.15s ease; display: inline-block; }
.stat-card:hover .stat-value-hover { transform: scale(1.05); }

/* Course card accent bars by difficulty */
.course-accent::before {
    content: ''; display: block; height: 2px;
    border-radius: 2px 2px 0 0;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
}
.course-accent-beginner::before { background: #39d353; }
.course-accent-intermediate::before { background: #f0883e; }
.course-accent-advanced::before { background: #f85149; }
.course-accent-expert::before { background: #bc8cff; }

/* Submission result pill */
.result-pill-success {
    background: rgba(13, 40, 24, 0.8);
    padding: 2px 8px; border-radius: 9999px; font-size: 0.75rem;
}

/* Section glow border bottom */
.glow-border-bottom { position: relative; }
.glow-border-bottom::after {
    content: ''; position: absolute;
    bottom: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.3), transparent);
}

/* Light theme overrides for new classes */
html:not(.dark) .hero-grid-bg {
    background-image:
        linear-gradient(rgba(0, 100, 30, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 100, 30, 0.04) 1px, transparent 1px);
}
html:not(.dark) .section-divider {
    background: linear-gradient(90deg, transparent, rgba(0, 100, 30, 0.15), transparent);
}

/* ── Search Tabs ── */
.search-tab {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #8b949e;
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: pointer;
    background: none;
    border: none;
}
.search-tab:hover { color: #e6edf3; background: #21262d; }
.search-tab-active {
    color: #39d353;
    background: rgba(57, 211, 83, 0.1);
    box-shadow: inset 0 -2px 0 #39d353;
}
html:not(.dark) .search-tab { color: #656d76; }
html:not(.dark) .search-tab:hover { color: #1f2328; background: #eff1f3; }
html:not(.dark) .search-tab-active { color: #1a7f37; background: rgba(57, 211, 83, 0.08); }

/* ── Cyber City Game ── */

.cc-hud {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; z-index: 10;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.92) 0%, rgba(10, 14, 20, 0) 100%);
    pointer-events: none;
}
.cc-hud > * { pointer-events: auto; }

.cc-budget {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700; font-size: 1.1rem;
    color: #39d353; text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.cc-wave-banner {
    position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
    z-index: 20; text-align: center; pointer-events: none;
    animation: cc-wave-announce 2.5s ease-out forwards;
}
.cc-wave-banner h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem; font-weight: 700;
    color: #f85149; text-shadow: 0 0 30px rgba(248, 81, 73, 0.6);
    text-transform: uppercase; letter-spacing: 0.15em;
}
.cc-wave-banner p {
    color: #e6edf3; font-size: 1rem; margin-top: 0.25rem; opacity: 0.8;
}

@keyframes cc-wave-announce {
    0% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.8); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.05); }
    25% { transform: translateX(-50%) translateY(0) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.cc-defense-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    width: 72px; padding: 0.5rem 0.25rem;
    background: #21262d; border: 1px solid #30363d; border-radius: 0.5rem;
    color: #e6edf3; font-size: 0.65rem; font-family: 'JetBrains Mono', monospace;
    cursor: pointer; transition: all 0.2s; text-align: center;
}
.cc-defense-btn--wide {
    width: 140px; padding: 0.5rem;
}
.cc-defense-btn-top {
    display: flex; align-items: center; gap: 0.35rem; width: 100%; justify-content: center;
}
.cc-defense-btn-label { font-weight: 600; }
.cc-defense-btn-desc {
    color: #8b949e; font-size: 0.55rem; line-height: 1.3; margin-top: 0.15rem;
}
.cc-defense-btn:hover:not(:disabled) {
    background: #30363d; border-color: #39d353;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
}
.cc-defense-btn:disabled {
    opacity: 0.35; cursor: not-allowed;
}
.cc-defense-btn .cc-cost {
    color: #e3b341; font-size: 0.6rem; font-weight: 700;
}

/* Connection picker */
.cc-connection-picker {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    max-width: 380px; width: 100%; flex-basis: 100%;
}
.cc-connection-option {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.55rem 0.75rem;
    background: #161b22; border: 1px solid #30363d; border-radius: 0.5rem;
    color: #e6edf3; font-size: 0.75rem; font-family: 'JetBrains Mono', monospace;
    cursor: pointer; transition: all 0.2s;
}
.cc-connection-option:hover {
    background: #21262d; border-color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}
.cc-conn-arrow {
    color: #00f0ff; font-weight: 700; font-size: 0.85rem;
}
html:not(.dark) .cc-connection-option { background: #f6f8fa; border-color: #d0d7de; color: #1f2328; }
html:not(.dark) .cc-connection-option:hover { background: #eff1f3; border-color: #0969da; }

/* Defense Sidebar */
.cc-defense-sidebar {
    position: absolute; top: 36px; left: 0; bottom: 4px;
    width: 130px; background: rgba(13, 17, 23, 0.94);
    border-right: 1px solid #21262d;
    display: flex; flex-direction: column; z-index: 6;
    backdrop-filter: blur(6px);
}
.cc-sidebar-header {
    padding: 0.4rem 0.5rem; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid #21262d;
}
.cc-sidebar-budget {
    font-size: 0.65rem; font-weight: 700;
    font-family: 'JetBrains Mono', monospace; color: #e3b341;
}
.cc-sidebar-items {
    flex: 1; padding: 0.35rem; display: flex; flex-direction: column;
    gap: 0.25rem; overflow-y: auto;
}
.cc-sidebar-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
    padding: 0.35rem 0.25rem; background: #161b22;
    border: 1px solid #30363d; border-radius: 0.4rem;
    cursor: grab; transition: all 0.15s;
    font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
    color: #e6edf3; text-align: center; user-select: none;
}
.cc-sidebar-item:hover:not(.disabled) {
    border-color: #00f0ff; background: #21262d;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}
.cc-sidebar-item.selected {
    border-color: #00f0ff; background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.cc-sidebar-item.disabled {
    opacity: 0.35; cursor: not-allowed; pointer-events: none;
}
.cc-sidebar-item.dragging { opacity: 0.4; }
.cc-sidebar-item--action { cursor: pointer; }
.cc-sidebar-item-icon { color: #00f0ff; }
.cc-sidebar-item-label { font-weight: 600; line-height: 1.1; }
.cc-sidebar-item-cost { color: #e3b341; font-weight: 700; }
.cc-sidebar-item-desc {
    display: none; color: #8b949e; font-size: 0.5rem; font-weight: 400;
    line-height: 1.25; max-width: 100%; text-align: center;
}
.cc-sidebar-item:hover .cc-sidebar-item-desc { display: block; }
.cc-sidebar-footer {
    padding: 0.35rem; border-top: 1px solid #21262d;
}

/* Planning Info Bar */
.cc-planning-bar {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.35rem 0.8rem; background: rgba(13, 17, 23, 0.94);
    border: 1px solid #30363d; border-radius: 0.5rem; z-index: 6;
    backdrop-filter: blur(6px); white-space: nowrap;
}
.cc-planning-bar-info {
    display: flex; align-items: center; gap: 0.5rem;
}

/* Wire Mode Prompt */
.cc-wire-prompt {
    position: absolute; top: 44px; left: 50%; transform: translateX(-50%);
    padding: 0.35rem 0.8rem; display: flex; align-items: center; gap: 0.5rem;
    background: rgba(0, 240, 255, 0.08); border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 0.5rem; color: #00f0ff;
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    z-index: 7; backdrop-filter: blur(6px); white-space: nowrap;
    animation: cc-wire-pulse 1.5s ease-in-out infinite;
}
@keyframes cc-wire-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.15); }
    50% { box-shadow: 0 0 16px rgba(0, 240, 255, 0.3); }
}
.cc-wire-cancel-btn {
    background: none; border: 1px solid rgba(248, 81, 73, 0.4);
    color: #f85149; font-size: 0.6rem; font-family: 'JetBrains Mono', monospace;
    padding: 0.15rem 0.4rem; border-radius: 0.25rem; cursor: pointer;
    transition: all 0.15s;
}
.cc-wire-cancel-btn:hover { background: rgba(248, 81, 73, 0.15); border-color: #f85149; }

/* Canvas drag-over state */
#cc-game-wrapper.drag-over #cyber-city-canvas {
    outline: 2px dashed rgba(0, 240, 255, 0.5); outline-offset: -2px;
}

.cc-uptime-bar {
    width: 160px; height: 10px;
    background: #21262d; border-radius: 999px; overflow: hidden;
    border: 1px solid #30363d;
}
.cc-uptime-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #f85149, #e3b341, #39d353);
    transition: width 0.3s ease;
}

.cc-planning-overlay {
    position: absolute; inset: 0; z-index: 15;
    background: rgba(10, 14, 20, 0.72);
    backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1rem; text-align: center; padding: 1rem;
    overflow-y: auto;
}
.cc-planning-overlay h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem; font-weight: 700;
    color: #00f0ff; text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.cc-game-over {
    position: absolute; inset: 0; z-index: 25;
    background: rgba(10, 14, 20, 0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1rem; text-align: center;
}
.cc-score-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3.5rem; font-weight: 700;
    color: #00ff41; text-shadow: 0 0 40px rgba(0, 255, 65, 0.5);
    animation: cc-score-glow 2s ease-in-out infinite alternate;
}
@keyframes cc-score-glow {
    0% { text-shadow: 0 0 20px rgba(0, 255, 65, 0.3); }
    100% { text-shadow: 0 0 50px rgba(0, 255, 65, 0.7), 0 0 80px rgba(0, 255, 65, 0.3); }
}

.cc-wave-progress {
    width: 100%; height: 4px;
    background: #21262d; position: absolute; bottom: 0; left: 0; z-index: 10;
}
.cc-wave-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f0ff, #a855f7);
    transition: width 0.5s linear;
}

/* Attack indicator badges in HUD */
.cc-attack-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.5rem; border-radius: 999px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; font-weight: 600;
    animation: cc-attack-pulse 1.5s ease-in-out infinite;
}
.cc-attack-ddos  { background: rgba(248, 81, 73, 0.2);  color: #f85149; border: 1px solid rgba(248, 81, 73, 0.4); }
.cc-attack-db    { background: rgba(240, 136, 62, 0.2);  color: #f0883e; border: 1px solid rgba(240, 136, 62, 0.4); }
.cc-attack-slow  { background: rgba(188, 140, 255, 0.2); color: #bc8cff; border: 1px solid rgba(188, 140, 255, 0.4); }
.cc-attack-sqli  { background: rgba(227, 179, 65, 0.2);  color: #e3b341; border: 1px solid rgba(227, 179, 65, 0.4); }
.cc-attack-xss   { background: rgba(86, 212, 221, 0.2);  color: #56d4dd; border: 1px solid rgba(86, 212, 221, 0.4); }
.cc-attack-brute { background: rgba(240, 136, 62, 0.2);  color: #f0883e; border: 1px solid rgba(240, 136, 62, 0.4); }
.cc-attack-dns   { background: rgba(88, 166, 255, 0.2);  color: #58a6ff; border: 1px solid rgba(88, 166, 255, 0.4); }
.cc-attack-zday  { background: rgba(248, 81, 73, 0.25);  color: #ff4444; border: 1px solid rgba(248, 81, 73, 0.5); }
.cc-attack-apt   { background: rgba(188, 140, 255, 0.25); color: #d4a5ff; border: 1px solid rgba(188, 140, 255, 0.5); }
.cc-attack-multi { background: rgba(248, 81, 73, 0.25);  color: #ff6b6b; border: 1px solid rgba(248, 81, 73, 0.5); }

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

/* Light theme overrides for Cyber City */
html:not(.dark) .cc-hud { background: linear-gradient(180deg, rgba(246, 248, 250, 0.92) 0%, rgba(246, 248, 250, 0) 100%); }
html:not(.dark) .cc-defense-btn { background: #f6f8fa; border-color: #d0d7de; color: #1f2328; }
html:not(.dark) .cc-defense-btn:hover:not(:disabled) { background: #eff1f3; border-color: #1a7f37; }
html:not(.dark) .cc-defense-btn-desc { color: #656d76; }
html:not(.dark) .cc-planning-overlay { background: rgba(246, 248, 250, 0.78); }
html:not(.dark) .cc-game-over { background: rgba(246, 248, 250, 0.95); }
html:not(.dark) .cc-uptime-bar { background: #d0d7de; border-color: #d0d7de; }
html:not(.dark) .cc-budget { color: #1a7f37; text-shadow: none; }
html:not(.dark) .cc-wave-banner h2 { color: #cf222e; text-shadow: none; }
html:not(.dark) .cc-score-display { color: #1a7f37; text-shadow: none; animation: none; }
html:not(.dark) .cc-tutorial-modal { background: rgba(246, 248, 250, 0.95); }
html:not(.dark) .cc-tutorial-content { background: #fff; border-color: #d0d7de; }
html:not(.dark) .cc-tutorial-section { background: #f6f8fa; border-color: #d0d7de; }
html:not(.dark) .cc-tutorial-section h3 { color: #1f2328; }
html:not(.dark) .cc-tutorial-section p { color: #656d76; }
html:not(.dark) .cc-deploy-toast { background: rgba(255, 255, 255, 0.95); border-color: #d0d7de; color: #1f2328; }
html:not(.dark) .cc-reset-btn { background: #f6f8fa; border-color: #d0d7de; color: #656d76; }
html:not(.dark) .cc-reset-btn:hover { border-color: #cf222e; color: #cf222e; }

/* Reset Phase button */
.cc-reset-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.35rem;
    width: 100%; padding: 0.4rem 0.5rem; margin-top: 0.25rem;
    background: transparent; border: 1px dashed #30363d; border-radius: 0.5rem;
    color: #8b949e; font-size: 0.65rem; font-family: 'JetBrains Mono', monospace;
    cursor: pointer; transition: all 0.2s;
}
.cc-reset-btn:hover {
    border-color: #f85149; color: #f85149; background: rgba(248, 81, 73, 0.08);
}

/* Deploy Toast Notifications */
.cc-deploy-toasts {
    position: absolute; bottom: 12px; left: 12px; z-index: 20;
    display: flex; flex-direction: column; gap: 0.35rem;
    pointer-events: none; max-width: 320px;
}
.cc-deploy-toast {
    padding: 0.4rem 0.75rem; border-radius: 0.5rem;
    background: rgba(13, 17, 23, 0.92); border: 1px solid #21262d;
    color: #e6edf3; font-size: 0.7rem; font-family: 'JetBrains Mono', monospace;
    animation: cc-toast-in 0.3s ease-out;
    transition: opacity 0.4s ease;
}
.cc-deploy-toast strong { color: #39d353; }
.cc-deploy-toast--fade { opacity: 0; }

@keyframes cc-toast-in {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Tutorial Modal */
.cc-tutorial-modal {
    position: absolute; inset: 0; z-index: 30;
    background: rgba(10, 14, 20, 0.92);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.cc-tutorial-content {
    background: #0d1117; border: 1px solid #21262d; border-radius: 0.75rem;
    padding: 1.5rem; max-width: 640px; width: 100%; max-height: 90%;
    overflow-y: auto; text-align: center;
}
.cc-tutorial-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
    text-align: left; margin-top: 0.5rem;
}
.cc-tutorial-section {
    background: #161b22; border: 1px solid #21262d; border-radius: 0.5rem;
    padding: 0.75rem;
}
.cc-tutorial-section h3 {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    font-weight: 700; color: #e6edf3; margin-bottom: 0.35rem;
    display: flex; align-items: center; gap: 0.35rem;
}
.cc-tutorial-section p {
    font-size: 0.72rem; color: #8b949e; line-height: 1.5;
}
.cc-tutorial-section p strong { color: #e6edf3; }

@media (max-width: 600px) {
    .cc-tutorial-grid { grid-template-columns: 1fr; }
    .cc-defense-btn--wide { width: 110px; }
}
