/* Battle Simulator */
.battle { --panel: #171c3a; --panel2: #1e2448; --ok: #3ddc84; --bad: #ff5c7a; --first: #ff9a5a; --second: #6390f0; padding: 18px 0 40px; min-height: 70vh; }
.battle-body .newsletter { display: none; }
.battle section { padding: 0; }
.battle h1 { font: 700 clamp(28px, 4vw, 40px) var(--pixel); margin: 0 0 10px; line-height: 1.1; }
.battle h2 { font: 700 20px var(--pixel); margin: 22px 0 10px; }
.battle h3 { font: 700 15px var(--pixel); margin: 14px 0 6px; color: var(--muted); }
.battle h3 small { color: var(--text); }
.muted { color: var(--muted); }
.b-small, .b-credits { color: var(--muted); font-size: 12px; }
.b-credits { margin-top: 40px; opacity: 0.8; }

.b-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.b-brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); text-decoration: none; font: 700 26px var(--pixel); }
.b-brand small { font: 600 13px var(--body); color: var(--muted); }
.b-icon { align-self: center; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(160deg, #ff6b57, #f5c542); color: #1d1d2b; font-size: 18px; }
.b-tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-left: auto; overflow-x: auto; max-width: 100%; }
.b-tabs a { padding: 8px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.b-tabs a i { font-style: normal; font-size: 10px; background: var(--panel2); padding: 1px 5px; border-radius: 4px; margin-left: 3px; }
.b-tabs a.on { background: var(--gold); color: #1d1d2b; }
@media (max-width: 640px) { .b-brand small { display: none; } .b-tabs { margin-left: 0; width: 100%; } }

.b-intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; margin-bottom: 10px; }
.b-phases { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: ph; }
.b-phases li { counter-increment: ph; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 46px; position: relative; opacity: 0.6; }
.b-phases li::before { content: counter(ph); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font: 700 13px var(--pixel); }
.b-phases li.on { opacity: 1; border-color: var(--gold); }
.b-phases li.on::before { background: var(--gold); color: #1d1d2b; }
.b-phases b { display: block; }
.b-phases span { font-size: 13px; color: var(--muted); }
@media (max-width: 800px) { .b-intro { grid-template-columns: 1fr; } }

.b-decks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.b-decks li { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.b-decks li div { flex: 1; }
.b-decks b { display: block; }
.b-decks small { color: var(--muted); }
.b-x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.b-x:hover { color: var(--bad); }

/* Build */
.b-build { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.b-search input, .b-deck-head input { width: 100%; background: #0d1030; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 16px; }
.b-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 14px; }
.b-filters button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 6px 12px; font: 700 13px var(--body); cursor: pointer; }
.b-filters button.on { background: var(--gold); color: #1d1d2b; border-color: var(--gold); }
.b-mine { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.b-mine input { accent-color: var(--gold); }
.b-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.b-card { position: relative; background: none; border: 0; padding: 0; text-align: left; color: var(--text); cursor: pointer; }
.b-card img { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; background: var(--panel2); transition: transform 0.15s; }
.b-card:hover img { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); }
.b-card span { display: block; font-size: 12px; line-height: 1.25; margin-top: 4px; }
.b-card small { display: block; color: var(--muted); font-size: 11px; }
.b-n { position: absolute; top: 6px; right: 6px; background: var(--gold); color: #1d1d2b; border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; font: 700 13px var(--pixel); box-shadow: 0 2px 0 #000; }
.b-deck { position: sticky; top: 140px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; max-height: calc(100vh - 160px); overflow: auto; }
.b-deck-head { display: flex; gap: 8px; align-items: center; }
.b-deck-head span { font: 700 18px var(--pixel); white-space: nowrap; color: var(--bad); }
.b-deck-head span.ok { color: var(--ok); }
.b-ok { color: var(--ok); font-weight: 700; margin: 10px 0; }
.b-problems { margin: 10px 0; padding-left: 18px; color: #ffc2cd; font-size: 13px; }
.b-rows { list-style: none; padding: 0; margin: 0; }
.b-rows li { display: grid; grid-template-columns: 28px 1fr 26px 22px 26px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.b-rows img { width: 28px; height: 39px; object-fit: cover; border-radius: 3px; }
.b-rows small { display: block; color: var(--muted); font-size: 11px; }
.b-rows button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-weight: 700; }
.b-rows b { text-align: center; font-family: var(--pixel); }
.b-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
@media (max-width: 860px) { .b-build { grid-template-columns: 1fr; } .b-deck { position: static; max-height: none; } }

/* Test */
.b-test-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.b-run { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.b-run label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.b-run select { background: #0d1030; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
.b-warn { color: #ffc2cd; margin: 0; }
.b-prog { position: relative; height: 28px; background: var(--panel); border-radius: 99px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); }
.b-prog i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--gold), #ff9a5a); transition: width 0.2s; }
.b-prog span { position: relative; display: block; text-align: center; line-height: 26px; font-weight: 700; font-size: 13px; }
.b-tiles { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.b-tiles > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.b-tiles b { display: block; font: 700 30px var(--pixel); line-height: 1.1; }
.b-tiles span { color: var(--muted); font-size: 13px; }
.b-score { background: radial-gradient(circle at 20% 0%, rgba(245, 197, 66, 0.25), transparent 60%), var(--panel) !important; border-color: var(--gold) !important; }
.b-score b { font-size: 46px; color: var(--gold); }
.b-score span { display: block; color: var(--text) !important; font-weight: 700; font-size: 16px !important; }
.b-score small { color: var(--muted); }
.b-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.b-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.b-panel h2 { margin-top: 0; }
.b-chart { display: grid; grid-template-columns: 1fr; position: relative; height: 200px; margin-top: 10px; }
.b-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: end; height: 200px; grid-area: 1 / 1; padding: 0 6px; }
.b-bars div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.b-bars i { position: relative; width: 42%; border-radius: 6px 6px 0 0; }
.b-bars b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; white-space: nowrap; }
.b-bars span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.b-bars.first i { background: var(--first); margin-right: 44%; }
.b-bars.second i { background: var(--second); margin-left: 44%; }
.b-bars.second span { visibility: hidden; }
.b-legend { display: flex; gap: 16px; font-size: 13px; margin: 8px 0 0; }
.b-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.b-legend .first::before { background: var(--first); }
.b-legend .second::before { background: var(--second); }
.b-good, .b-bad { list-style: none; padding: 0; margin: 0 0 10px; }
.b-good li, .b-bad li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid var(--line); font-size: 14px; }
.b-good li::before { content: '✓'; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }
.b-bad li::before { content: '!'; position: absolute; left: 6px; color: var(--bad); font-weight: 900; }
.b-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.b-table td, .b-table th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.b-table td:not(:first-child), .b-table th:not(:first-child) { text-align: right; font-family: var(--pixel); }
.b-table small { color: var(--muted); }
.b-how { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.b-how summary { cursor: pointer; color: var(--gold); font-weight: 700; }
.b-next { background: linear-gradient(135deg, rgba(255, 107, 87, 0.15), rgba(245, 197, 66, 0.12)); border: 1px solid rgba(245, 197, 66, 0.4); border-radius: 14px; padding: 14px 16px; }
.b-empty { text-align: center; padding: 40px 0; }
.b-empty .lead { margin: 0 auto 20px; }
@media (max-width: 860px) { .b-tiles { grid-template-columns: 1fr 1fr; } .b-two { grid-template-columns: 1fr; } }
.b-toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; transition: 0.2s; background: #0b0e22; border: 1px solid var(--gold); padding: 10px 16px; border-radius: 10px; z-index: 100; pointer-events: none; }
.b-toast.on { opacity: 1; transform: translate(-50%, 0); }
