/* Battle Barge (TOW) — Phase Strip */

/* ===== Phase Tracker Bar (Two-Level) ===== */

html[data-universe="tow"] .phase-tracker {
    margin-bottom: var(--space-md);
}

/* Top bar: 4 major phase segments */
html[data-universe="tow"] .major-phase-bar {
    display: flex;
    gap: 2px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
}

/* Universe-scoped: HH's phase-strip.css also defines .phase-segment,
   and this file loads after it in the unified shell. */
html[data-universe="tow"] .phase-segment {
    flex: 1;
    padding: var(--space-sm) var(--space-xs);
    text-align: center;
    position: relative;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    opacity: 0.3;
}

/* Phase segment colors - 4 major phases */
html[data-universe="tow"] .phase-segment.phase-strategy { background-color: var(--phase-strategy); }
html[data-universe="tow"] .phase-segment.phase-movement { background-color: var(--phase-movement); }
html[data-universe="tow"] .phase-segment.phase-shooting { background-color: var(--phase-shooting); }
html[data-universe="tow"] .phase-segment.phase-combat { background-color: var(--phase-combat); }

html[data-universe="tow"] .phase-segment.past {
    opacity: 0.5;
}

html[data-universe="tow"] .phase-segment.current {
    opacity: 1;
    transform: scaleY(1.05);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

html[data-universe="tow"] .phase-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    /* The bar clips its overflow to keep the rounded corners, so a label
       too wide for its quarter of the screen was shaved off at BOTH ends
       and centred — "STRATEGY" arrived as "TRATEG". Let it wrap and break
       instead. Field-reported 2026-08-14. */
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
    max-width: 100%;
}

/* Below this the four segments are ~80px each and the letter-spacing is
   the difference between two lines and three. */
@media (max-width: 420px) {
    html[data-universe="tow"] .phase-label {
        letter-spacing: 0;
        font-size: 10px;
    }
    html[data-universe="tow"] .phase-segment {
        padding-left: 2px;
        padding-right: 2px;
    }
}

/* Bottom bar: sub-phase segments within the active major phase */
html[data-universe="tow"] .sub-phase-bar {
    display: flex;
    gap: 1px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    background-color: var(--color-surface);
}

html[data-universe="tow"] .sub-phase-segment {
    flex: 1;
    padding: var(--space-xs) var(--space-xs);
    text-align: center;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    background-color: var(--color-surface-raised);
    opacity: 0.4;
}

html[data-universe="tow"] .sub-phase-segment.past {
    opacity: 0.6;
    background-color: var(--color-surface-hover);
}

html[data-universe="tow"] .sub-phase-segment.current {
    opacity: 1;
    background-color: var(--color-surface-hover);
    border-bottom: 3px solid var(--color-gold);
}

/* Tint sub-phase bar based on active major phase */
html[data-universe="tow"] .sub-phase-bar.phase-strategy .sub-phase-segment.current { border-bottom-color: var(--phase-strategy); }
html[data-universe="tow"] .sub-phase-bar.phase-movement .sub-phase-segment.current { border-bottom-color: var(--phase-movement); }
html[data-universe="tow"] .sub-phase-bar.phase-shooting .sub-phase-segment.current { border-bottom-color: var(--phase-shooting); }
html[data-universe="tow"] .sub-phase-bar.phase-combat .sub-phase-segment.current { border-bottom-color: var(--phase-combat); }

html[data-universe="tow"] .sub-phase-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
    max-width: 100%;
}

@media (max-width: 420px) {
    html[data-universe="tow"] .sub-phase-label {
        letter-spacing: 0;
        font-size: 9px;
    }
    html[data-universe="tow"] .sub-phase-segment {
        padding-left: 2px;
        padding-right: 2px;
    }
}

html[data-universe="tow"] .sub-phase-segment.current .sub-phase-label {
    color: var(--color-text-primary);
}

/* Phase tracker reached state */
html[data-universe="tow"] .phase-segment.reached .phase-label::after,
html[data-universe="tow"] .sub-phase-segment.reached .sub-phase-label::after {
    content: '';
}

html[data-universe="tow"] .phase-segment.reached {
    opacity: 0.7;
}

html[data-universe="tow"] .sub-phase-segment.reached {
    opacity: 0.7;
}


/* ===== Round Indicator ===== */

html[data-universe="tow"] .round-indicator {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--color-border);
}

/* Two lines, always: when the round and the phase share one they wrap at
   whatever word happens to land on the edge, and the round number — the
   thing being glanced at across a table — ends up mid-sentence. */
html[data-universe="tow"] .round-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

html[data-universe="tow"] .round-text-when {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

html[data-universe="tow"] .round-text-what {
    font-size: var(--text-lg);
    font-weight: 700;
}
