/* STRYKE Tactical HUD v1 — Mission 07 */

.hud-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(ellipse at center, #0a0e1a 0%, #000 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Space Grotesk', 'Montserrat', sans-serif;
    color: #e6f7ff;
    animation: hud-enter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.hud-root.hidden { display: none; }

@keyframes hud-enter {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.hud-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hud-scanline {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 212, 255, 0.04) 50%,
        transparent 100%
    );
    background-size: 100% 8px;
    pointer-events: none;
    animation: hud-scanline-drift 6s linear infinite;
}
@keyframes hud-scanline-drift {
    from { background-position: 0 0; }
    to   { background-position: 0 100%; }
}

.hud-header,
.hud-footer {
    position: relative;
    z-index: 2;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top, 0));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}
.hud-footer {
    border-bottom: 0;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
    justify-content: center;
}
.hud-header-left,
.hud-header-right { display: flex; align-items: center; gap: 12px; }

.hud-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: hud-status-pulse 1.4s ease-in-out infinite;
}
.hud-status-dot.listening { background: #ff3366; box-shadow: 0 0 12px #ff3366; }
.hud-status-dot.parsing   { background: #ff9f1a; box-shadow: 0 0 12px #ff9f1a; }
.hud-status-dot.error     { background: #ff3366; animation-duration: 0.4s; }

@keyframes hud-status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

.hud-mode-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #00d4ff;
}

.hud-quota {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(230, 247, 255, 0.6);
    padding: 4px 10px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.hud-quota.warn  { color: #ff9f1a; border-color: rgba(255, 159, 26, 0.5); }
.hud-quota.error { color: #ff3366; border-color: rgba(255, 51, 102, 0.5); }

.hud-abort-btn {
    width: 40px; height: 40px;
    border: 1px solid rgba(255, 51, 102, 0.4);
    background: rgba(255, 51, 102, 0.08);
    color: #ff3366;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hud-abort-btn:active { transform: scale(0.92); background: rgba(255, 51, 102, 0.2); }
.hud-abort-btn:hover  { border-color: #ff3366; }

.hud-footer-tag {
    font-size: 9px;
    letter-spacing: 0.4em;
    color: rgba(0, 212, 255, 0.4);
    text-transform: uppercase;
}

.hud-stage {
    flex: 1;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.hud-state {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: hud-state-enter 200ms ease-out;
}
.hud-state.hidden { display: none; }

@keyframes hud-state-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hud-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
}
.hud-waveform span {
    display: block;
    width: 3px;
    background: #00d4ff;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
    animation: hud-wave 1.1s ease-in-out infinite;
    height: 30%;
}
.hud-waveform span:nth-child(1)  { animation-delay: 0.0s;  }
.hud-waveform span:nth-child(2)  { animation-delay: 0.05s; }
.hud-waveform span:nth-child(3)  { animation-delay: 0.10s; }
.hud-waveform span:nth-child(4)  { animation-delay: 0.15s; }
.hud-waveform span:nth-child(5)  { animation-delay: 0.20s; }
.hud-waveform span:nth-child(6)  { animation-delay: 0.25s; }
.hud-waveform span:nth-child(7)  { animation-delay: 0.30s; }
.hud-waveform span:nth-child(8)  { animation-delay: 0.35s; }
.hud-waveform span:nth-child(9)  { animation-delay: 0.40s; }
.hud-waveform span:nth-child(10) { animation-delay: 0.45s; }
.hud-waveform span:nth-child(11) { animation-delay: 0.50s; }
.hud-waveform span:nth-child(12) { animation-delay: 0.55s; }
.hud-waveform span:nth-child(13) { animation-delay: 0.60s; }
.hud-waveform span:nth-child(14) { animation-delay: 0.65s; }
.hud-waveform span:nth-child(15) { animation-delay: 0.70s; }

@keyframes hud-wave {
    0%, 100% { height: 25%; opacity: 0.5; }
    50%      { height: 95%; opacity: 1; }
}
.hud-state[data-hud-state="listening"]:not(.is-active) .hud-waveform span { animation-play-state: paused; }

.hud-mic-btn {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15), rgba(0, 212, 255, 0.02));
    border: 2px solid #00d4ff;
    color: #00d4ff;
    font-size: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.4),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    transition: all 0.2s ease;
}
.hud-mic-btn:active { transform: scale(0.94); }
.hud-mic-btn.is-active {
    border-color: #ff3366;
    color: #ff3366;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.2), rgba(255, 51, 102, 0.02));
    box-shadow:
        0 0 40px rgba(255, 51, 102, 0.6),
        inset 0 0 30px rgba(255, 51, 102, 0.15);
}
.hud-mic-pulse {
    position: absolute; inset: -10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
}
.hud-mic-btn.is-active .hud-mic-pulse {
    animation: hud-mic-pulse 1.4s ease-out infinite;
}
@keyframes hud-mic-pulse {
    0%   { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}

.hud-prompt {
    font-size: 14px;
    color: #e6f7ff;
    text-align: center;
    letter-spacing: 0.05em;
    margin: 0;
}
.hud-hint {
    font-size: 11px;
    color: rgba(0, 212, 255, 0.55);
    text-align: center;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

.hud-transcript-frame {
    position: relative;
    width: 100%;
    padding: 24px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.2);
}
.hud-frame-corner {
    position: absolute;
    width: 14px; height: 14px;
    border-color: #00d4ff;
    border-style: solid;
}
.hud-frame-corner.tl { top: -1px; left: -1px;  border-width: 2px 0 0 2px; }
.hud-frame-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.hud-frame-corner.bl { bottom: -1px; left: -1px;  border-width: 0 0 2px 2px; }
.hud-frame-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.hud-transcript {
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
    margin: 0;
    text-align: center;
    min-height: 24px;
}
.hud-status-text {
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #00d4ff;
    text-transform: uppercase;
    margin: 0;
}

.hud-parser-orb {
    position: relative;
    width: 140px; height: 140px;
    display: flex; align-items: center; justify-content: center;
}
.hud-parser-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 1px solid #00d4ff;
    opacity: 0.6;
}
.hud-parser-ring.r1 { animation: hud-ring 2.0s linear infinite; }
.hud-parser-ring.r2 { animation: hud-ring 2.0s linear infinite reverse; transform: scale(0.8); border-style: dashed; }
.hud-parser-ring.r3 { animation: hud-ring 3.0s linear infinite; transform: scale(0.6); border-color: #ff9f1a; }
@keyframes hud-ring {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.hud-parser-icon {
    font-size: 36px;
    color: #ff9f1a;
    z-index: 1;
    animation: hud-pulse-soft 1.4s ease-in-out infinite;
}
@keyframes hud-pulse-soft {
    0%, 100% { transform: scale(1);    opacity: 0.8; }
    50%      { transform: scale(1.12); opacity: 1; }
}

.hud-data-locked {
    width: 100%;
    display: grid;
    gap: 12px;
}
.hud-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid #00d4ff;
    border-radius: 4px;
    animation: hud-data-slide 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.hud-data-row:nth-child(1) { animation-delay: 0ms;   }
.hud-data-row:nth-child(2) { animation-delay: 80ms;  }
.hud-data-row:nth-child(3) { animation-delay: 160ms; }
.hud-data-row:nth-child(4) { animation-delay: 240ms; }
@keyframes hud-data-slide {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
.hud-data-label {
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(0, 212, 255, 0.7);
}
.hud-data-value {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.hud-confirm-row { display: flex; gap: 12px; width: 100%; }
.hud-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hud-btn:active { transform: scale(0.96); }
.hud-btn-primary {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    color: #0a0a0f;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}
.hud-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #e6f7ff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hud-error-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.1);
    border: 2px solid #ff3366;
    color: #ff3366;
    font-size: 32px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.4);
}

.hud-done-burst {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.3), transparent);
    color: #00ff88;
    font-size: 48px;
    display: flex; align-items: center; justify-content: center;
    box-shadow:
        0 0 40px rgba(0, 255, 136, 0.6),
        inset 0 0 20px rgba(0, 255, 136, 0.3);
    animation: hud-done-burst 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hud-done-burst {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hud-root,
    .hud-state,
    .hud-data-row,
    .hud-done-burst { animation: none; }
    .hud-scanline,
    .hud-waveform span,
    .hud-mic-pulse,
    .hud-parser-ring,
    .hud-parser-icon,
    .hud-status-dot { animation: none; }
}

/* ==========================================================
   PHASE B — COMMAND CENTER DASHBOARD v2
   Mission: Tactical UI Components
   ========================================================== */

/* ── XP Progress Bar ─────────────────────────────────────── */
.tactical-progress-bar {
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.tactical-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    animation: tactical-bar-shimmer 2.4s ease-in-out infinite;
}

@keyframes tactical-bar-shimmer {
    0%   { left: -60%; }
    100% { left: 140%; }
}

/* ── Armor Awarded Flash ─────────────────────────────────── */
@keyframes armor-awarded-flash-keyframe {
    0%, 100% {
        filter: drop-shadow(0 0 6px #00d4ff);
        transform: scale(1);
    }
    20% {
        filter: drop-shadow(0 0 18px #00d4ff) drop-shadow(0 0 32px #00ff88);
        transform: scale(1.18);
    }
    40% {
        filter: drop-shadow(0 0 28px #00ff88) drop-shadow(0 0 48px #00d4ff);
        transform: scale(1.24);
    }
    60% {
        filter: drop-shadow(0 0 20px #00d4ff) drop-shadow(0 0 36px #00ff88);
        transform: scale(1.16);
    }
    80% {
        filter: drop-shadow(0 0 12px #00d4ff);
        transform: scale(1.06);
    }
}

.armor-awarded-flash {
    animation: armor-awarded-flash-keyframe 0.7s ease-in-out 3;
}

/* ── SOP Card Components ─────────────────────────────────── */
.sop-card {
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: var(--surface-elevated);
    border-radius: 14px;
    padding: 14px 16px;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sop-card:active {
    transform: scale(0.98);
}

.sop-card[data-sop-done="true"] {
    border-color: var(--sop-color, var(--border-default));
    background: color-mix(in srgb, var(--sop-color, #00d4ff) 7%, var(--surface-elevated));
    box-shadow: 0 0 12px color-mix(in srgb, var(--sop-color, #00d4ff) 20%, transparent);
}

.sop-card[data-sop-done="false"] .sop-icon,
.sop-card:not([data-sop-done]) .sop-icon {
    opacity: 0.45;
}

.sop-checkmark {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sop-card[data-sop-done="true"] .sop-checkmark { opacity: 1; }

/* ── Hydration cup icons ─────────────────────────────────── */
.water-cup {
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.water-cup:active { transform: scale(0.92); }
.water-cup.filled { filter: drop-shadow(0 0 6px #00d4ff); }
.water-cup.empty  { opacity: 0.3; }

/* ── Dashboard section heading micro-label ───────────────── */
.section-callsign {
    font-size: 9px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

/* ── Gulag workout entry tint ────────────────────────────── */
.workout-entry-gulag {
    border-color: rgba(255, 51, 102, 0.35) !important;
    background: rgba(255, 51, 102, 0.05) !important;
    opacity: 0.75;
}

/* ── Macro bar ───────────────────────────────────────────── */
.macro-bar-track {
    height: 6px;
    border-radius: 999px;
    background: var(--border-subtle);
    overflow: hidden;
}
.macro-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.macro-bar-overflow {
    animation: macro-overflow-pulse 1.4s ease-in-out infinite;
}
@keyframes macro-overflow-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ── Desktop 3-Zone Theater — Tactical Grid Background ──── */
/*
 * Applied to the outermost dashboard grid container on desktop.
 * Renders a faint cyan crosshatch overlay via pseudo-element so
 * the layout never sits on a flat black void. Pointer-events are
 * disabled so it never interferes with card interactions.
 */
.desktop-tactical-grid {
    position: relative;
}
.desktop-tactical-grid::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
}
.desktop-tactical-grid > * {
    position: relative;
    z-index: 1;
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .tactical-progress-bar::after,
    .armor-awarded-flash,
    .macro-bar-fill,
    .water-cup { animation: none; transition: none; }
    .sop-card:active { transform: none; }
}
