/* =============================================================================
   BW Build Order Explorer — Liquipedia-inspired styling
   ============================================================================= */

#page-learn-bw {
    height: calc(100vh - 60px);
    padding: 0;
    overflow-y: auto;
    background: #0d1117;
}

/* Header */
.bw-guide-header {
    height: 56px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid #21262d;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Content area */
.bw-guide-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem;
}

.bw-guide-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #8b949e;
    font-size: 1rem;
}

/* Loading overlay */
#bw-guide-loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.85);
    z-index: 100;
}

/* =============================================================================
   Archetype Tabs
   ============================================================================= */

.archetype-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #21262d;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.arch-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    color: #8b949e;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.arch-tab:hover {
    color: #c9d1d9;
}

.arch-tab.active {
    color: #e6c47f;
    border-bottom-color: #e6c47f;
}

.arch-tab-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.arch-tab-meta {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* =============================================================================
   Build Info Box (Liquipedia infobox)
   ============================================================================= */

.build-info-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-matchup-badge {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d253f 100%);
    border: 1px solid #2d5a8e;
    color: #79b8ff;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.info-title h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #e6edf3;
}

.info-subtitle {
    font-size: 0.85rem;
    color: #8b949e;
}

.info-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid #21262d;
    border-bottom: 1px solid #21262d;
}

.info-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e6edf3;
    font-variant-numeric: tabular-nums;
}

.info-stat-value.win { color: #3fb950; }
.info-stat-value.loss { color: #f85149; }

.info-stat-label {
    font-size: 0.7rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Key Timings */
.key-timings {
    margin-top: 0.75rem;
}

.key-timings h4 {
    font-size: 0.75rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem;
}

.timing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timing-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #1c2333;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.timing-chip-time {
    color: #e6c47f;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.timing-chip-action {
    color: #c9d1d9;
}

/* =============================================================================
   Build Order List
   ============================================================================= */

.build-order-section h3 {
    font-size: 0.85rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem;
}

.bo-list {
    display: flex;
    flex-direction: column;
}

/* Phase Divider */
.bo-phase-divider {
    padding: 0.6rem 0;
    margin: 0.3rem 0;
    border-bottom: 1px solid #30363d;
}

.bo-phase-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e6c47f;
}

/* Build Order Row */
.bo-row {
    display: flex;
    align-items: baseline;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    transition: background 0.1s;
    gap: 0;
}

.bo-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.bo-supply {
    width: 36px;
    text-align: right;
    font-weight: 700;
    font-size: 0.95rem;
    color: #79b8ff;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.bo-dash {
    width: 28px;
    text-align: center;
    color: #484f58;
    flex-shrink: 0;
}

.bo-action {
    flex: 1;
    font-size: 0.95rem;
    color: #e6edf3;
    font-weight: 500;
}

.bo-timing {
    width: 50px;
    text-align: right;
    font-size: 0.85rem;
    color: #8b949e;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.bo-freq {
    width: 40px;
    text-align: right;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.freq-high { color: #3fb950; }
.freq-mid  { color: #e6c47f; }
.freq-low  { color: #8b949e; }

/* Type indicators — left border color */
.bo-type-production  { border-left: 3px solid #388bfd; }
.bo-type-tech        { border-left: 3px solid #a371f7; }
.bo-type-expansion   { border-left: 3px solid #3fb950; }
.bo-type-gas         { border-left: 3px solid #39d353; }
.bo-type-defense     { border-left: 3px solid #f85149; }
.bo-type-building    { border-left: 3px solid #388bfd; }
.bo-type-upgrade     { border-left: 3px solid #d2a8ff; }
.bo-type-unit        { border-left: 3px solid #f0883e; }

/* Extractor trick annotation */
.bo-trick-note {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-style: italic;
    color: #e6c47f;
    opacity: 0.8;
    cursor: help;
}

/* Alternative rows */
.bo-alt {
    opacity: 0.6;
    border-left: 3px solid transparent;
    padding-left: calc(0.5rem + 3px);
}

.bo-alt .bo-action {
    font-style: italic;
    font-weight: 400;
    color: #8b949e;
}

/* =============================================================================
   BW Players — smurf count badge
   ============================================================================= */

.smurf-count {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.7rem;
    color: #8b949e;
    background: rgba(139, 148, 158, 0.15);
    padding: 1px 6px;
    border-radius: 3px;
}

.bw-player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fp-dims {
    font-size: 0.7rem;
    white-space: nowrap;
}

.fp-dims span {
    margin-right: 3px;
    font-variant-numeric: tabular-nums;
}

.verified-badge {
    display: inline-block;
    font-size: 0.65rem;
    color: #3fb950;
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

/* =============================================================================
   Harvest Toggle (shared)
   ============================================================================= */

.harvest-game-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
    margin-left: 1rem;
}

.harvest-game-toggle .toggle-btn {
    background: #1e293b;
    border: none;
    color: #94a3b8;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.harvest-game-toggle .toggle-btn:not(:last-child) {
    border-right: 1px solid #334155;
}

.harvest-game-toggle .toggle-btn.active {
    background: #334155;
    color: #f1f5f9;
}

.harvest-game-toggle .toggle-btn:hover:not(.active) {
    background: #263040;
}
