/* diplomatic.quest — Cyberpunk Data-Viz Dashboard
   Palette: #0D1117 #161B22 #00E5FF #FF6D00 #00E676 #448AFF #E6EDF3 #30363D #FF1744
*/

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

body {
    background-color: #0D1117;
    color: #E6EDF3;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Grid Scan Lines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 39px,
        rgba(48, 54, 61, 0.3) 39px,
        rgba(48, 54, 61, 0.3) 40px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Dashboard Sections */
.dashboard-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
}

/* Dashboard Grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.hero-grid .panel-main {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.hero-grid .panel-stat:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.hero-grid .panel-stat:nth-child(3) {
    grid-column: 4;
    grid-row: 1;
}

.hero-grid .panel-stat:nth-child(4) {
    grid-column: 3 / 5;
    grid-row: 2;
}

.data-grid .panel-wide {
    grid-column: 1 / 3;
}

.data-grid .panel-stat:nth-child(2) {
    grid-column: 3;
}

.data-grid .panel-stat:nth-child(3) {
    grid-column: 4;
}

.panel-full {
    grid-column: 1 / -1;
}

/* Dashboard Panels */
.dash-panel {
    background: #161B22;
    border: 1px solid #30363D;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 1px rgba(0, 229, 255, 0.3);
    opacity: 0;
    transition: opacity 0.4s ease, box-shadow 0.2s ease;
}

.dash-panel.panel-visible {
    opacity: 1;
}

.dash-panel:hover {
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

/* Panel Border Animation */
.dash-panel.border-draw {
    animation: borderTrace 800ms ease forwards;
}

@keyframes borderTrace {
    0% {
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%);
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Panel Header */
.panel-header {
    height: 36px;
    background: rgba(22, 27, 34, 0.9);
    border-bottom: 1px solid #30363D;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}

.panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.panel-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #E6EDF3;
}

/* Panel Body */
.panel-body {
    padding: 20px 16px;
}

/* Mission Title (Typewriter) */
.mission-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00E5FF;
    margin-bottom: 16px;
    min-height: 1.2em;
}

.mission-title .cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: #00E5FF;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 800ms step-end infinite;
}

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

/* Briefing Text */
.briefing-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #E6EDF3;
    opacity: 0.9;
}

/* Stat Panels */
.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
    color: #00E5FF;
    display: block;
}

.stat-unit {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: #E6EDF3;
    opacity: 0.6;
    display: block;
    margin-top: 4px;
}

.stat-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    color: #FF6D00;
    display: block;
    margin-bottom: 8px;
}

/* Mini Chart */
.mini-chart {
    display: block;
    margin-top: 8px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #30363D;
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s ease-out;
}

.progress-fill.animated {
    transform: scaleX(1);
}

.success-fill {
    background: #00E676;
}

.alert-fill {
    background: #FF6D00;
}

/* Dialogue Options */
.dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.dialogue-card {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid #30363D;
    border-left: 4px solid #00E5FF;
    border-radius: 4px;
    padding: 16px 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.2s ease;
    cursor: default;
}

.dialogue-card.card-revealed {
    opacity: 1;
    transform: translateY(0);
}

.dialogue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.option-label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #448AFF;
    display: block;
    margin-bottom: 6px;
}

.option-text {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #E6EDF3;
    opacity: 0.85;
}

/* Results Panel */
.results-panel {
    position: relative;
}

.results-body {
    text-align: center;
}

.results-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00E676;
    margin-bottom: 24px;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 24px;
}

.result-item {
    text-align: center;
}

.result-item .stat-value {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #00E5FF;
}

.result-item .stat-unit {
    display: inline;
    margin-left: 4px;
}

.result-label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #E6EDF3;
    opacity: 0.6;
    display: block;
    margin-bottom: 8px;
}

.results-verdict {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #E6EDF3;
    opacity: 0.5;
    margin-top: 16px;
}

/* Mission Complete Dim Effect */
.mission-dimmed .dash-panel:not(.results-panel) {
    opacity: 0.4;
    transition: opacity 0.8s ease;
}

.mission-dimmed .results-panel {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-grid .panel-main {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .hero-grid .panel-stat:nth-child(2) {
        grid-column: 1;
    }

    .hero-grid .panel-stat:nth-child(3) {
        grid-column: 2;
    }

    .hero-grid .panel-stat:nth-child(4) {
        grid-column: 1 / -1;
    }

    .data-grid .panel-wide {
        grid-column: 1 / -1;
    }

    .data-grid .panel-stat:nth-child(2) {
        grid-column: 1;
    }

    .data-grid .panel-stat:nth-child(3) {
        grid-column: 2;
    }

    .panel-full {
        grid-column: 1 / -1;
    }

    .results-stats {
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid .panel-main,
    .hero-grid .panel-stat:nth-child(2),
    .hero-grid .panel-stat:nth-child(3),
    .hero-grid .panel-stat:nth-child(4),
    .data-grid .panel-wide,
    .data-grid .panel-stat:nth-child(2),
    .data-grid .panel-stat:nth-child(3) {
        grid-column: 1;
    }

    .dashboard-section {
        padding: 8px 12px;
    }

    .results-stats {
        flex-direction: column;
        gap: 16px;
    }

    .dialogue-card {
        padding: 12px 14px;
    }
}
