/* =========================================================
   BUGHUNT: MODERN ENEMY SHOWCASE & INTEL BRIEFING SYSTEM
   Ultra-Clean Dark Cyber-Fantasy Glassmorphism Theme
   Typography: 'Inter', sans-serif & 'JetBrains Mono', monospace
========================================================= */

#enemy-intro-overlay.enemy-showcase-screen {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    box-sizing: border-box;
    padding: clamp(12px, 1.8vh, 22px) clamp(16px, 2.5vw, 36px);
    overflow-y: auto;
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(circle at 50% 15%, var(--theme-card-bg-subtle, rgba(26, 16, 48, 0.98)) 0%, rgba(10, 6, 20, 0.98) 70%, rgba(5, 3, 10, 1) 100%);
    backdrop-filter: blur(20px);
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85);
}

#enemy-intro-overlay.enemy-showcase-screen.visible {
    display: flex !important;
}

.showcase-ambient-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.008) 0px, rgba(255, 255, 255, 0.008) 1px, transparent 1px, transparent 3px),
        radial-gradient(ellipse at 50% 40%, var(--theme-glow-soft, rgba(168, 85, 247, 0.07)) 0%, transparent 65%);
    z-index: 1;
}

/* =========================================================
   1. TOPBAR & ENCOUNTER CLUSTER STRIP
========================================================= */

.showcase-topbar {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--theme-border-subtle, rgba(139, 92, 246, 0.25));
    flex-shrink: 0;
}

.showcase-alert-box {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.8px;
    user-select: none;
}

.alert-pulse-circle {
    width: 10px;
    height: 10px;
    background: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 10px #38bdf8;
    animation: alertBeaconPulse 1.4s infinite alternate ease-in-out;
}

@keyframes alertBeaconPulse {
    0% { transform: scale(0.85); opacity: 0.55; }
    100% { transform: scale(1.15); opacity: 1; }
}

.showcase-topbar-center {
    justify-self: center;
}

.showcase-cluster-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--theme-card-bg, rgba(18, 12, 34, 0.94));
    border: 1px solid var(--theme-border, rgba(139, 92, 246, 0.45));
    border-radius: 30px;
    padding: 6px 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 15px var(--theme-glow-soft, rgba(124, 58, 237, 0.2));
    user-select: none;
}

.showcase-pill-diff {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #facc15;
    text-transform: uppercase;
}

.showcase-sep {
    color: rgba(167, 139, 250, 0.35);
    font-size: 13px;
    font-weight: 400;
}

.showcase-pill-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #f3e8ff;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.showcase-pill-topic {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.showcase-close-btn {
    justify-self: end;
    background: rgba(225, 29, 72, 0.16);
    border: 1px solid rgba(244, 63, 94, 0.45);
    color: #fecdd3;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.showcase-close-btn:hover {
    background: #e11d48;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(225, 29, 72, 0.65);
    transform: translateY(-1px);
}

/* =========================================================
   2. MAIN STAGE (BALANCED 2-COLUMN DOSSIER LAYOUT)
========================================================= */

.showcase-main-stage {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: clamp(280px, 28vw, 380px) 1fr;
    gap: clamp(14px, 2vw, 24px);
    width: 100%;
    flex: 1;
    margin: clamp(10px, 1.4vh, 16px) 0;
    min-height: 0;
    align-items: stretch;
    box-sizing: border-box;
}

/* --- Left Column: Character Spotlight Frame --- */
.showcase-left-pillar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.char-spotlight-frame {
    background: linear-gradient(180deg, var(--theme-card-bg, rgba(22, 15, 44, 0.94)) 0%, var(--theme-card-bg-subtle, rgba(13, 9, 26, 0.98)) 100%);
    border: 1px solid var(--theme-border, rgba(139, 92, 246, 0.35));
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 0 25px var(--theme-glow-soft, rgba(124, 58, 237, 0.08));
    overflow-y: auto;
}

.char-sprite-stage {
    position: relative;
    width: 100%;
    height: clamp(130px, 18vh, 175px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.showcase-sprite-floating {
    max-height: 92%;
    max-width: 85%;
    object-fit: contain;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 25px rgba(168, 85, 247, 0.4));
    animation: showcaseFloat 3.2s ease-in-out infinite alternate;
    z-index: 5;
    user-select: none;
}

@keyframes showcaseFloat {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-7px) scale(1.02); }
}

.char-pedestal-platform {
    position: absolute;
    bottom: 4px;
    width: 70%;
    height: 18px;
    background: radial-gradient(ellipse at center, var(--theme-glow, rgba(168, 85, 247, 0.6)) 0%, var(--theme-glow-soft, rgba(124, 58, 237, 0.2)) 55%, transparent 80%);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--theme-glow, rgba(168, 85, 247, 0.5));
}

.char-title-card {
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

.showcase-enemy-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(20px, 2.2vmin + 2px, 26px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.showcase-enemy-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    color: #c084fc;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Streamlined Vitals Strip */
.showcase-vitals-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
    margin: 6px 0 10px;
    flex-shrink: 0;
}

.vital-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--theme-card-bg-subtle, rgba(20, 14, 40, 0.9));
    border: 1px solid var(--theme-border-subtle, rgba(139, 92, 246, 0.3));
    border-radius: 20px;
    padding: 6px 14px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.vital-pill:hover {
    border-color: var(--theme-border, rgba(139, 92, 246, 0.6));
    transform: translateY(-1px);
}

.vital-pill .vital-icon {
    font-size: 13.5px;
    line-height: 1;
    flex-shrink: 0;
}

.vital-pill.vital-pill-hp .vital-icon-hp {
    color: #f43f5e;
    filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.6));
}

.vital-pill.vital-pill-tp .vital-icon-tp {
    color: #facc15;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.6));
}

.vital-pill.vital-pill-core .vital-icon-core {
    color: #38bdf8;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

.vital-pill .vital-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Atmospheric Enemy Transmission Callout */
.transmission-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--theme-card-bg-subtle, rgba(14, 10, 28, 0.75));
    border: 1px solid var(--theme-border-subtle, rgba(139, 92, 246, 0.25));
    border-radius: 10px;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.transmission-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 800;
    color: var(--theme-accent, #38bdf8);
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    padding: 2px 7px;
    letter-spacing: 0.6px;
    flex-shrink: 0;
    margin-top: 1px;
}

.transmission-quote {
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    font-style: italic;
    line-height: 1.55;
    color: #e2e8f0;
    margin: 0;
    white-space: pre-line;
}

/* --- Right Column: Unified Tactical Combat Dossier --- */
.showcase-right-pillar {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--theme-card-bg, rgba(20, 14, 40, 0.94)) 0%, var(--theme-card-bg-subtle, rgba(12, 8, 24, 0.98)) 100%);
    border: 1px solid var(--theme-border, rgba(139, 92, 246, 0.35));
    border-radius: 14px;
    padding: 16px 20px;
    box-sizing: border-box;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    min-height: 0;
    height: 100%;
}

.showcase-tabs-nav {
    display: flex;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--theme-border-subtle, rgba(139, 92, 246, 0.2));
    flex-shrink: 0;
}

.showcase-tab-btn {
    background: var(--theme-card-bg-subtle, rgba(15, 10, 30, 0.85));
    border: 1px solid var(--theme-border-subtle, rgba(139, 92, 246, 0.3));
    color: var(--theme-text-sub, #c4b5fd);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.showcase-tab-btn .tab-glyph {
    font-size: 13px;
    line-height: 1;
    color: var(--theme-accent, #c084fc);
}

.showcase-tab-btn:hover {
    background: var(--theme-glow-soft, rgba(124, 58, 237, 0.2));
    border-color: var(--theme-primary, #a855f7);
    color: #ffffff;
}

.showcase-tab-btn.active {
    background: var(--theme-btn-gradient, linear-gradient(135deg, #a855f7 0%, #7c3aed 100%));
    border-color: var(--theme-accent, #c084fc);
    color: #ffffff;
    box-shadow: 0 0 16px var(--theme-glow, rgba(168, 85, 247, 0.5));
    transform: translateY(-1px);
}

.showcase-tab-panel {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
    min-height: 0;
}

.showcase-tab-panel::-webkit-scrollbar {
    width: 6px;
}
.showcase-tab-panel::-webkit-scrollbar-thumb {
    background: #634394;
    border-radius: 4px;
}

/* Threat Intel Card */
.threat-intel-box {
    background: rgba(18, 12, 34, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-left: 3px solid #f43f5e;
    border-radius: 10px;
    padding: 12px 16px;
    flex-shrink: 0;
}

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

.threat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.threat-icon {
    font-size: 15px;
}

.threat-intel-header h4 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 800;
    color: #fca5a5;
    letter-spacing: 0.5px;
}

.threat-error-pill-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.threat-error-pill-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
}

.threat-error-pill {
    background: rgba(225, 29, 72, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #fecdd3;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 6px;
}

.threat-intel-desc {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #f1f5f9;
}

/* Side-by-Side Bug Comparison Grid */
.syntax-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex-shrink: 0;
}

.syntax-box {
    border-radius: 8px;
    padding: 10px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.syntax-box.bug-box {
    background: rgba(28, 12, 22, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-left: 3px solid #ef4444;
}

.syntax-box.fix-box {
    background: rgba(8, 26, 20, 0.85);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-left: 3px solid #22c55e;
}

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

.syntax-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 700;
}

.syntax-badge.bad { color: #fca5a5; }
.syntax-badge.good { color: #86efac; }

.syntax-file-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #94a3b8;
}

.syntax-code-wrap {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    padding: 8px 10px;
}

.syntax-pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
}

.syntax-box.bug-box .syntax-pre { color: #fecdd3; }
.syntax-box.fix-box .syntax-pre { color: #bbf7d0; }

/* Tactical Battle Rules Card */
.guide-rules-card {
    background: rgba(18, 12, 34, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    flex-shrink: 0;
}

.guide-rules-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.guide-topic-heading {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.guide-rules-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guide-rule-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(10, 6, 20, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 6px;
    padding: 7px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #f1f5f9;
    line-height: 1.45;
}

.rule-item-icon {
    color: #38bdf8;
    font-size: 13px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Inline Tactical Field Tip */
.tactical-tip-inline {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(139, 92, 246, 0.25);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #bae6fd;
}

.tactical-tip-inline .tip-bulb-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.tactical-tip-inline-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tactical-tip-text {
    margin: 0;
    color: #bae6fd;
}

/* --- Panel 2: Parsons Puzzle Tutorial --- */
.tutorial-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.tutorial-header h4 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.tutorial-steps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tut-step {
    background: rgba(14, 10, 28, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tut-step-num {
    width: 28px;
    height: 28px;
    background: var(--theme-btn-gradient, linear-gradient(135deg, #a855f7, #7c3aed));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--theme-glow, rgba(168, 85, 247, 0.4));
}

.tut-step-body h5 {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #38bdf8;
    margin: 0 0 4px;
}

.tut-step-body p {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #cbd5e1;
    margin: 0;
}

.tutorial-tips-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.tut-tip-card {
    background: rgba(12, 16, 32, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.4;
}

.tut-tip-card.warn {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(30, 10, 16, 0.8);
}

/* =========================================================
   3. BOTTOM SHOWCASE ACTION BAR
========================================================= */

.showcase-footer-bar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 92, 246, 0.25);
    flex-shrink: 0;
}

.showcase-btn {
    font-family: 'Inter', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

.showcase-btn.retreat-btn {
    background: rgba(26, 18, 44, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #cbd5e1;
}

.showcase-btn.retreat-btn:hover {
    background: var(--theme-glow-soft, rgba(124, 58, 237, 0.3));
    color: #ffffff;
    border-color: var(--theme-primary, #a855f7);
    transform: translateX(-2px);
}

.showcase-btn.engage-btn {
    background: var(--theme-btn-gradient, linear-gradient(135deg, #a855f7 0%, #7c3aed 100%));
    border: 1.5px solid var(--theme-accent, #c084fc);
    color: #ffffff;
    box-shadow: 0 4px 18px var(--theme-glow-soft, rgba(124, 58, 237, 0.45)), 0 0 15px var(--theme-glow, rgba(168, 85, 247, 0.3));
}

.showcase-btn.engage-btn:hover {
    background: var(--theme-btn-hover-gradient, linear-gradient(135deg, #c084fc 0%, #9333ea 100%));
    border-color: #ffffff;
    box-shadow: 0 6px 24px var(--theme-glow-strong, rgba(168, 85, 247, 0.7));
    transform: translateY(-1px);
}

/* =========================================================
   4. RESPONSIVE SCALING & ADAPTIVE VIEWPORTS
========================================================= */

@media (max-width: 900px) {
    .showcase-main-stage {
        grid-template-columns: 1fr;
    }
    .syntax-compare-grid,
    .tutorial-steps-container,
    .tutorial-tips-row {
        grid-template-columns: 1fr;
    }
    .showcase-topbar {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    .showcase-alert-box,
    .showcase-close-btn {
        justify-self: center;
    }
}

@media (max-height: 720px) {
    #enemy-intro-overlay.enemy-showcase-screen {
        padding: 8px 16px;
    }
    .char-sprite-stage {
        height: 110px;
    }
    .showcase-enemy-title {
        font-size: 16px;
    }
    .syntax-compare-grid {
        grid-template-columns: 1fr;
    }
    .tutorial-steps-container {
        grid-template-columns: 1fr;
    }
}
