/* ─── Simulator Shared Tokens ───────────────────────────────────── */
:root {
    --sim-bg: #0d1117;
    --sim-card: #161b22;
    --sim-border: #21262d;
    --sim-green: #3fb950;
    --sim-red: #f85149;
    --sim-yellow: #e3b341;
    --sim-cyan: #39d0d8;
    --sim-font: 'Courier New', monospace;
}

.sim-mount {
    font-family: var(--sim-font);
    color: #e6edf3;
}

/* ─── INCIDENT WAR ROOM ────────────────────────────────────────── */
.warroom {
    background: var(--sim-bg);
    border: 1px solid var(--sim-border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

/* Header */
.warroom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--sim-card);
    border-bottom: 1px solid var(--sim-border);
}

.warroom-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #e6edf3;
    font-family: var(--sim-font);
    margin: 0;
}

.p0-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(248, 81, 73, 0.15);
    color: var(--sim-red);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(248, 81, 73, 0.3);
    font-family: var(--sim-font);
    letter-spacing: 0.05em;
}

.p0-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sim-red);
    animation: p0Blink 1s ease-in-out infinite;
}

@keyframes p0Blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

/* Banner */
.warroom-banner {
    background: rgba(248, 81, 73, 0.08);
    border-bottom: 1px solid rgba(248, 81, 73, 0.2);
    padding: 12px 20px;
    font-size: 0.75rem;
    line-height: 1.6;
}

.warroom-banner .banner-top {
    font-weight: 700;
    color: var(--sim-red);
    margin-bottom: 4px;
}

.warroom-banner .banner-sub {
    color: #8b949e;
}

/* Body */
.warroom-body {
    padding: 20px;
}

/* Metric cards */
.warroom-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.wm-card {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.3s, background 0.3s;
}

.wm-card .wm-label {
    font-size: 0.6rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.wm-card .wm-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--sim-font);
    transition: color 0.3s;
}

.wm-card.state-red {
    border-color: rgba(248, 81, 73, 0.4);
}

.wm-card.state-red .wm-value {
    color: var(--sim-red);
}

.wm-card.state-yellow {
    border-color: rgba(227, 179, 65, 0.4);
}

.wm-card.state-yellow .wm-value {
    color: var(--sim-yellow);
}

.wm-card.state-green {
    border-color: rgba(63, 185, 80, 0.4);
}

.wm-card.state-green .wm-value {
    color: var(--sim-green);
}

/* Log box */
.warroom-logs {
    background: #010409;
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 10px 12px;
    height: 110px;
    overflow-y: auto;
    margin-bottom: 16px;
    font-size: 0.68rem;
    line-height: 1.7;
}

.warroom-logs::-webkit-scrollbar {
    width: 4px;
}

.warroom-logs::-webkit-scrollbar-track {
    background: transparent;
}

.warroom-logs::-webkit-scrollbar-thumb {
    background: var(--sim-border);
    border-radius: 2px;
}

.log-line {
    opacity: 0;
    animation: logFadeIn 0.3s forwards;
}

@keyframes logFadeIn {
    to {
        opacity: 1;
    }
}

.log-line.log-red {
    color: var(--sim-red);
}

.log-line.log-yellow {
    color: var(--sim-yellow);
}

.log-line.log-green {
    color: var(--sim-green);
}

.log-line.log-cyan {
    color: var(--sim-cyan);
}

/* Progress */
.warroom-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.pdot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sim-border);
    border: 2px solid #30363d;
    transition: all 0.3s;
}

.pdot.current {
    background: rgba(56, 189, 248, 0.3);
    border-color: #58a6ff;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.4);
}

.pdot.correct {
    background: var(--sim-green);
    border-color: var(--sim-green);
}

.pdot.wrong {
    background: var(--sim-red);
    border-color: var(--sim-red);
}

.warroom-step-label {
    font-size: 0.8rem;
    color: #8b949e;
}

.warroom-reset-btn {
    background: rgba(139, 148, 158, 0.1);
    color: #8b949e;
    border: 1px solid #30363d;
    padding: 5px 12px;
    border-radius: 4px;
    font-family: var(--sim-font);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.warroom-reset-btn:hover {
    background: rgba(139, 148, 158, 0.2);
    color: #e6edf3;
    border-color: #8b949e;
}

/* Question */
.warroom-question {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e6edf3;
    margin-bottom: 12px;
    font-family: var(--sim-font);
}

/* Answer grid */
.warroom-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.wa-btn {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 12px 14px;
    color: #c9d1d9;
    font-family: var(--sim-font);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.wa-btn:hover:not(.locked) {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.06);
    color: #e6edf3;
}

.wa-btn.locked {
    cursor: default;
    opacity: 0.6;
}

.wa-btn.chosen-correct {
    border-color: var(--sim-green) !important;
    background: rgba(63, 185, 80, 0.1) !important;
    color: var(--sim-green) !important;
    opacity: 1 !important;
}

.wa-btn.chosen-wrong {
    border-color: var(--sim-red) !important;
    background: rgba(248, 81, 73, 0.1) !important;
    color: var(--sim-red) !important;
    opacity: 1 !important;
}

/* End panel */
.warroom-end {
    margin-top: 20px;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    animation: endSlideIn 0.4s ease-out;
}

@keyframes endSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.warroom-end.resolved {
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.warroom-end.fired {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.warroom-end h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-family: var(--sim-font);
}

.warroom-end.resolved h4 {
    color: var(--sim-green);
}

.warroom-end.fired h4 {
    color: var(--sim-red);
}

.warroom-end p {
    font-size: 0.8rem;
    color: #8b949e;
    line-height: 1.6;
    margin-bottom: 16px;
}

.warroom-end .end-warn {
    color: var(--sim-yellow);
    font-size: 0.75rem;
    margin-bottom: 12px;
}

.warroom-end .restart-btn {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
    padding: 8px 18px;
    border-radius: 4px;
    font-family: var(--sim-font);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.warroom-end .restart-btn:hover {
    background: rgba(88, 166, 255, 0.2);
}

/* ─── ARCHITECTURE DECISION SIMULATOR ──────────────────────────── */
.archsim {
    background: var(--sim-bg);
    border: 1px solid var(--sim-border);
    border-radius: 12px;
    overflow: hidden;
}

/* Scenario banner */
.archsim-scenario {
    background: var(--sim-card);
    border-bottom: 1px solid var(--sim-border);
    padding: 16px 20px;
    font-size: 0.78rem;
    line-height: 1.6;
}

.archsim-scenario .scenario-title {
    font-weight: 700;
    color: var(--sim-yellow);
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.archsim-scenario .scenario-desc {
    color: #8b949e;
}

.archsim-body {
    padding: 20px;
}

/* Bars */
.archsim-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.as-bar-wrap {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 10px 14px;
}

.as-bar-label {
    font-size: 0.6rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.as-bar-track {
    height: 8px;
    background: #010409;
    border-radius: 4px;
    overflow: hidden;
}

.as-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.3s;
    width: 0%;
}

.as-bar-fill.budget {
    background: var(--sim-cyan);
}

.as-bar-fill.budget.over {
    background: var(--sim-red);
}

.as-bar-fill.efficiency {
    background: var(--sim-green);
}

/* Conflict warning */
.archsim-conflict {
    background: rgba(227, 179, 65, 0.08);
    border: 1px solid rgba(227, 179, 65, 0.3);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.75rem;
    color: var(--sim-yellow);
    display: none;
    animation: conflictPulse 2s ease-in-out infinite;
}

@keyframes conflictPulse {

    0%,
    100% {
        border-color: rgba(227, 179, 65, 0.3);
    }

    50% {
        border-color: rgba(227, 179, 65, 0.7);
    }
}

/* Category tabs */
.archsim-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.as-tab {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    color: #8b949e;
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--sim-font);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.as-tab:hover {
    border-color: #58a6ff;
    color: #c9d1d9;
}

.as-tab.active {
    background: rgba(88, 166, 255, 0.1);
    border-color: #58a6ff;
    color: #58a6ff;
}

/* Component grid */
.archsim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.as-comp {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.as-comp:hover {
    border-color: #30363d;
    background: #1c2128;
}

.as-comp .comp-name {
    font-size: 0.78rem;
    color: #c9d1d9;
}

.as-comp .comp-cost {
    font-size: 0.68rem;
    color: #8b949e;
    white-space: nowrap;
    margin-left: 8px;
}

.as-comp.selected {
    border-color: var(--sim-green);
    background: rgba(63, 185, 80, 0.06);
}

.as-comp.selected .comp-name {
    color: var(--sim-green);
}

.as-comp.trap-selected {
    border-color: var(--sim-red) !important;
    background: rgba(248, 81, 73, 0.06) !important;
}

.as-comp.trap-selected .comp-name {
    color: var(--sim-red) !important;
}

.as-comp.conflict-active {
    border-color: var(--sim-yellow) !important;
    animation: cardConflictPulse 1.5s ease-in-out infinite !important;
}

@keyframes cardConflictPulse {

    0%,
    100% {
        border-color: rgba(227, 179, 65, 0.4);
        box-shadow: 0 0 0 0 rgba(227, 179, 65, 0);
    }

    50% {
        border-color: rgba(227, 179, 65, 0.8);
        box-shadow: 0 0 12px 0 rgba(227, 179, 65, 0.15);
    }
}

.as-comp.hidden-card {
    display: none;
}

/* Outcome metrics */
.archsim-outcomes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.as-outcome {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.as-outcome .ao-label {
    font-size: 0.55rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.as-outcome .ao-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--sim-font);
    transition: color 0.3s;
}

/* SLA bar */
.archsim-sla-bar {
    position: relative;
    height: 20px;
    background: #010409;
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 6px;
    border: 1px solid var(--sim-border);
}

.sla-fill {
    height: 100%;
    border-radius: 4px 0 0 4px;
    transition: width 0.4s ease, background 0.3s;
    background: var(--sim-red);
}

.sla-fill.sla-ok {
    background: var(--sim-green);
}

.sla-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--sim-yellow);
    z-index: 2;
}

.sla-marker-label {
    position: absolute;
    top: -18px;
    font-size: 0.55rem;
    color: var(--sim-yellow);
    transform: translateX(-50%);
    white-space: nowrap;
}

.archsim-sla-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: #484f58;
    margin-bottom: 16px;
}

/* Verdict */
.archsim-verdict {
    background: var(--sim-card);
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.78rem;
    color: #8b949e;
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 44px;
}

/* Win panel */
.archsim-win {
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    animation: endSlideIn 0.4s ease-out;
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid rgba(63, 185, 80, 0.3);
    display: none;
}

.archsim-win h4 {
    font-size: 1.1rem;
    color: var(--sim-green);
    font-family: var(--sim-font);
    margin-bottom: 8px;
}

.archsim-win .win-grade {
    font-size: 0.9rem;
    color: var(--sim-yellow);
    margin-bottom: 8px;
}

.archsim-win .win-stats {
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 16px;
    line-height: 1.6;
}

.archsim-win .restart-btn {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
    padding: 8px 18px;
    border-radius: 4px;
    font-family: var(--sim-font);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.archsim-win .restart-btn:hover {
    background: rgba(88, 166, 255, 0.2);
}

/* Reset bar */
.archsim-reset-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .warroom-metrics {
        grid-template-columns: 1fr;
    }

    .warroom-answers {
        grid-template-columns: 1fr;
    }

    .archsim-bars {
        grid-template-columns: 1fr;
    }

    .archsim-grid {
        grid-template-columns: 1fr;
    }

    .archsim-outcomes {
        grid-template-columns: repeat(3, 1fr);
    }

    .archsim-tabs {
        gap: 4px;
    }

    .as-tab {
        padding: 5px 10px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .archsim-outcomes {
        grid-template-columns: repeat(2, 1fr);
    }
}