/* Battle Barge (TOW) — Battle Screen */

/* ===== Join Code Bar ===== */

html[data-universe="tow"] .join-code-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-md);
}

/* Universe-scoped: also defined in static/hh/css/screens/battle.css,
   which loads before this file in the unified shell. */
html[data-universe="tow"] .join-code-value {
    font-family: 'Courier New', monospace;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 0.15em;
}

html[data-universe="tow"] .qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

html[data-universe="tow"] .qr-modal-content {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

html[data-universe="tow"] .qr-modal-content canvas {
    border-radius: var(--radius-md);
}


/* ===== Battle Actions Row ===== */

html[data-universe="tow"] .battle-actions-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}


/* ===== Phase Controls =====
   Directly under the phase tracker. Back is deliberately the smaller of the
   two: Advance is pressed four times a turn and Back only after a mistake. */

html[data-universe="tow"] .phase-controls-row {
    display: grid;
    /* Back was `auto`-width against a full-bleed Advance, which made it read
       as a caption rather than a button — reported as hard to find. A third
       of the row is enough to be obviously pressable while keeping Advance
       the one your thumb lands on by default. */
    grid-template-columns: minmax(96px, 1fr) minmax(0, 2.2fr);
    gap: var(--space-sm);
    align-items: stretch;
    margin-bottom: var(--space-md);
}

html[data-universe="tow"] .phase-controls-row .btn-advance {
    margin: 0;
    width: 100%;
    /* The label is a whole sentence and it changes every phase — "End Turn
       — Pass to Grimthorne the Unbroken" is not a nowrap string. On a phone
       it ran straight out of the button and off the card behind it.
       Field-reported 2026-08-14. */
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

@media (max-width: 420px) {
    html[data-universe="tow"] .phase-controls-row .btn-advance {
        font-size: var(--text-sm);
        letter-spacing: 0;
    }
}

html[data-universe="tow"] .phase-controls-row #btn-revert-phase {
    min-height: 44px;
    font-size: var(--text-sm);
    font-weight: 700;
    border: 1px solid var(--color-border);
}


/* ===== Setup Wizard ===== */

html[data-universe="tow"] .setup-wizard {
    padding-top: var(--space-md);
}

/* Universe-scoped: the setup wizard's .step-indicator is shared chrome
   styled by bb/css/screens/setup.css. Unscoped, this would restyle the
   HH and 40k wizards too.

   `flex-direction: row` is not redundant. The shared rule in
   bb/css/screens/setup.css sets `flex-direction: column` on the same
   class name, and this selector only overrode the properties it named —
   so the four step markers stacked into a vertical tower down the left of
   the wizard on every TOW setup screen. Field-reported 2026-08-14. */
html[data-universe="tow"] .step-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

html[data-universe="tow"] .step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    background-color: var(--color-surface-raised);
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    transition: all var(--transition-base);
}

html[data-universe="tow"] .step-dot.active {
    background-color: var(--color-gold-dark);
    color: var(--color-text-primary);
    border-color: var(--color-gold);
}

html[data-universe="tow"] .step-dot.completed {
    background-color: var(--color-forest-green);
    color: #fff;
    border-color: var(--color-forest-green);
}

/* The connecting rules between the markers are gone from the partial.
   Kept here as a no-op guard: a stale cached copy of the template would
   otherwise draw them into the middle of the new spacing. */
html[data-universe="tow"] .step-line {
    display: none;
}

html[data-universe="tow"] .setup-footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

html[data-universe="tow"] .setup-footer .btn {
    min-width: 120px;
}


/* ===== Confirm Row ===== */

html[data-universe="tow"] .confirm-row {
    padding: var(--space-sm) 0;
    font-size: var(--text-base);
}

html[data-universe="tow"] .confirm-row + .confirm-row {
    border-top: 1px solid var(--color-border);
}


/* ===== Journal ===== */

html[data-universe="tow"] .journal-form {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Universe-scoped: .journal-entry is shared chrome styled by
   bb/css/screens/journal.css. The modifiers are scoped alongside the
   base rule so the whole set moves together. */
html[data-universe="tow"] .journal-entry {
    padding: var(--space-md);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border-left: 4px solid var(--color-stone-gray);
}

html[data-universe="tow"] .journal-entry.journal-mvp {
    border-left-color: var(--color-gold);
}

html[data-universe="tow"] .journal-entry.journal-result {
    border-left-color: var(--color-forest-green);
}

html[data-universe="tow"] .journal-entry.journal-memorable_moment {
    border-left-color: var(--phase-strategy);
}

html[data-universe="tow"] .journal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}
