/* ==========================================================================
   OceanWar — Guided First Turn (Phase 1 Onboarding)
   Coachmark briefing system. CRT / naval command aesthetic.
   ========================================================================== */

#ow-onboarding-root {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
}

/* Dim layer — covers the whole screen except the spotlight cutout */
.ow-onb-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 14, 28, 0.62);
    pointer-events: auto;
    transition: opacity 220ms ease;
    /* Spotlight cutout via CSS mask. Fallback: full dim. */
    -webkit-mask-image: radial-gradient(ellipse var(--ow-onb-mw, 0px) var(--ow-onb-mh, 0px) at var(--ow-onb-mx, -200px) var(--ow-onb-my, -200px), transparent 70%, rgba(0, 0, 0, 1) 100%);
            mask-image: radial-gradient(ellipse var(--ow-onb-mw, 0px) var(--ow-onb-mh, 0px) at var(--ow-onb-mx, -200px) var(--ow-onb-my, -200px), transparent 70%, rgba(0, 0, 0, 1) 100%);
}

/* Spotlight ring — visible outline around the anchor */
.ow-onb-ring {
    position: absolute;
    border: 2px solid #6cf2c8;
    border-radius: 8px;
    box-shadow:
        0 0 0 2px rgba(108, 242, 200, 0.25),
        0 0 24px rgba(108, 242, 200, 0.55),
        inset 0 0 12px rgba(108, 242, 200, 0.18);
    pointer-events: none;
    transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease;
    animation: ow-onb-pulse 2.4s ease-in-out infinite;
}

@keyframes ow-onb-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(108, 242, 200, 0.25), 0 0 24px rgba(108, 242, 200, 0.45), inset 0 0 12px rgba(108, 242, 200, 0.18); }
    50%      { box-shadow: 0 0 0 3px rgba(108, 242, 200, 0.40), 0 0 36px rgba(108, 242, 200, 0.70), inset 0 0 16px rgba(108, 242, 200, 0.28); }
}

/* Briefing panel — anchored near the spotlight */
.ow-onb-panel {
    position: absolute;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(180deg, rgba(8, 22, 36, 0.97) 0%, rgba(4, 14, 24, 0.97) 100%);
    border: 1px solid rgba(108, 242, 200, 0.55);
    border-radius: 6px;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(108, 242, 200, 0.10),
        inset 0 1px 0 rgba(108, 242, 200, 0.12);
    color: #cfeee0;
    font-family: 'Courier New', Consolas, monospace;
    pointer-events: auto;
    transition: top 180ms ease, left 180ms ease, opacity 220ms ease;
}

.ow-onb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(108, 242, 200, 0.08);
    border-bottom: 1px solid rgba(108, 242, 200, 0.30);
    font-size: 11px;
    letter-spacing: 2px;
    color: #6cf2c8;
    text-transform: uppercase;
}

.ow-onb-step-tag {
    font-weight: bold;
    font-size: 10px;
    color: #8ef0c8;
}

.ow-onb-progress-dots {
    display: inline-flex;
    gap: 4px;
}

.ow-onb-progress-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(108, 242, 200, 0.25);
    display: inline-block;
}

.ow-onb-progress-dots span.active {
    background: #6cf2c8;
    box-shadow: 0 0 6px #6cf2c8;
}

.ow-onb-panel-body {
    padding: 12px 14px 6px 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #d8efe4;
}

.ow-onb-panel-body strong {
    color: #ffd86b;
    font-weight: bold;
}

.ow-onb-cta {
    padding: 4px 14px 12px 14px;
    font-size: 11px;
    color: #ffd86b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ow-onb-cta::before { content: '▸ '; color: #ffd86b; }

.ow-onb-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(108, 242, 200, 0.18);
    background: rgba(0, 0, 0, 0.18);
}

.ow-onb-skip {
    background: none;
    border: none;
    color: #7a8f86;
    font-family: inherit;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 4px 6px;
}

.ow-onb-skip:hover { color: #cfeee0; text-decoration: underline; }

.ow-onb-continue {
    background: linear-gradient(180deg, rgba(108, 242, 200, 0.18), rgba(108, 242, 200, 0.08));
    border: 1px solid rgba(108, 242, 200, 0.55);
    color: #6cf2c8;
    font-family: inherit;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.ow-onb-continue:hover {
    background: linear-gradient(180deg, rgba(108, 242, 200, 0.30), rgba(108, 242, 200, 0.15));
    box-shadow: 0 0 12px rgba(108, 242, 200, 0.45);
    color: #b6f7dc;
}

/* Arrow connecting panel to spotlight */
.ow-onb-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: linear-gradient(180deg, rgba(8, 22, 36, 0.97), rgba(4, 14, 24, 0.97));
    border-left: 1px solid rgba(108, 242, 200, 0.55);
    border-top: 1px solid rgba(108, 242, 200, 0.55);
    transform: rotate(45deg);
}

.ow-onb-panel[data-arrow="top"]    .ow-onb-arrow { top: -8px; left: 24px; }
.ow-onb-panel[data-arrow="bottom"] .ow-onb-arrow { bottom: -8px; left: 24px; transform: rotate(-135deg); }
.ow-onb-panel[data-arrow="left"]   .ow-onb-arrow { left: -8px; top: 24px; transform: rotate(-45deg); }
.ow-onb-panel[data-arrow="right"]  .ow-onb-arrow { right: -8px; top: 24px; transform: rotate(135deg); }

/* Completion toast */
.ow-onb-complete-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(8, 28, 18, 0.97), rgba(4, 18, 12, 0.97));
    border: 1px solid rgba(108, 242, 200, 0.65);
    box-shadow: 0 0 24px rgba(108, 242, 200, 0.40);
    color: #b6f7dc;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 10px 18px;
    border-radius: 4px;
    z-index: 9100;
    pointer-events: auto;
    animation: ow-onb-toast-in 320ms ease;
}

@keyframes ow-onb-toast-in {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ow-onb-ring { animation: none; }
    .ow-onb-panel, .ow-onb-ring, .ow-onb-dim { transition: none; }
}

/* Small screens: stack panel below spotlight */
@media (max-width: 640px) {
    .ow-onb-panel { width: calc(100vw - 32px); }
}

/* ---------- Phase 1.5: Persistent Command Help (v9.4.118) ---------- */
#command-help-btn.btn.btn-help {
    background: linear-gradient(180deg, rgba(8, 36, 24, 0.95), rgba(4, 22, 16, 0.95));
    border: 1px solid rgba(108, 242, 200, 0.55);
    color: #b6f7dc;
    text-shadow: 0 0 6px rgba(108, 242, 200, 0.45);
    letter-spacing: 0.08em;
    font-weight: 600;
    transition: all 160ms ease;
}
#command-help-btn.btn.btn-help:hover {
    background: linear-gradient(180deg, rgba(12, 52, 34, 1), rgba(6, 32, 22, 1));
    border-color: rgba(108, 242, 200, 0.95);
    box-shadow: 0 0 12px rgba(108, 242, 200, 0.55);
    color: #d6ffec;
}
#command-help-btn.btn.btn-help:active {
    transform: translateY(1px);
}

/* Standing Orders panel uses the same shell as a step panel but flagged */
.ow-onb-panel.ow-onb-standing-orders .ow-onb-step-tag {
    color: #ffd28a;
    text-shadow: 0 0 6px rgba(255, 210, 138, 0.40);
}
.ow-onb-panel.ow-onb-standing-orders {
    border-color: rgba(255, 210, 138, 0.55);
    box-shadow: 0 0 22px rgba(255, 210, 138, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.6);
}
