/* BattGuide web — same "caveira em chamas" theme as the desktop app (Themes/BattGuide.xaml).
   The site is always dark, like the app, so there is no light variant. */

@font-face { font-family: "Oswald"; src: url("../fonts/Oswald-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/NunitoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/NunitoSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    color-scheme: dark;
    --bg: #0C0908;
    --surface: #1B1110;
    --raised: #281714;
    --hover: #351D18;
    --line: #43211A;
    --ink: #0A0705;
    --text: #F7EEE6;
    --muted: #DDBFAE;
    --caption: #FF9A55;
    --accent: #FF7A1A;
    --accent-hover: #FF9440;
    --yellow: #FFC53D;
    --blue: #3CC8FF;
    --on-accent: #1B0C04;
    --link: #FFC53D;
    --warn: #FF5442;
    --note-bg: #0F1F27; --note-line: #10394A; --note-text: #CFEFFF;
    --warn-bg: #2A0F0B; --warn-line: #5A1E15;
    --table-head: #3A2006;
    --chip-bg: #1A2A33; --chip-line: #10394A; --chip-text: #9FE3FF;
    --done-bg: #3A1A06;
    --error: #FF8A78;
    --display: "Oswald", "Segoe UI", sans-serif;
    --body: "Nunito Sans", "Segoe UI", sans-serif;
    --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
    --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

img { image-rendering: pixelated; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }

/* ---------- App frame ---------- */
.app {
    min-height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    background:
        radial-gradient(120% 60% at 50% 110%, rgba(255, 74, 20, 0.35), transparent 60%),
        url("../img/grain.png"), var(--bg);
}

.topbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px var(--gutter);
    background: rgba(12, 9, 8, 0.92);
    border-bottom: 1.5px solid var(--ink);
    backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.brand img { image-rendering: auto; }
.lang { display: flex; gap: 2px; }
.lang button {
    background: none; border: 0; padding: 6px 8px; cursor: pointer;
    font-family: var(--display); font-weight: 700; color: #5F667A; border-radius: 6px;
}
.lang button.on { color: #ECEEF3; }
.lang button:hover { background: var(--raised); }

.screen { padding: 12px var(--gutter) 120px; position: relative; z-index: 1; }

.flames {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: 560px; height: 90px; pointer-events: none; z-index: 0;
    background: url("../img/flames_bottom.png") bottom center / 100% auto no-repeat;
    opacity: .85;
}

/* ---------- Type ---------- */
.h1 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: .01em; overflow-wrap: anywhere; }
.h1.fit { font-size: clamp(20px, 7vw, 30px); }
.h2 { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 14px 0 10px; }
.label { font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--caption); letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accent { color: var(--accent); }
.link-color { color: var(--link); }
.icon { flex: none; vertical-align: middle; }
.center-msg { text-align: center; padding: 40px 0; display: grid; gap: 16px; justify-items: center; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer;
    font-weight: 700; font-size: 13.5px; border: 0; background: none; max-width: 100%;
}
.btn.ghost { color: var(--muted); padding: 0 10px; }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.outline { background: var(--raised); color: var(--text); border: 1.5px solid var(--ink); border-bottom-width: 4px; }
.btn.outline:hover:not(:disabled) { background: var(--hover); }
.btn.outline.sm { min-height: 34px; padding: 0 12px; }
.btn.primary {
    color: var(--on-accent); border: 1.5px solid var(--ink); border-bottom-width: 4px;
    background: linear-gradient(#FFB347, #FF7A1A 60%, #E2560E);
}
.btn.primary:hover { background: linear-gradient(#FFC56A, #FF8E36 60%, #EE6418); }
.btn.block { width: 100%; min-height: 48px; font-size: 15px; }
.btn.pill { min-height: 34px; padding: 0 12px; border-radius: 999px; color: var(--text); background: var(--raised); border: 1.5px solid var(--ink); }
.btn.pill.on { background: var(--yellow); color: var(--on-accent); }
.btn:disabled { opacity: .4; cursor: default; }
.link { display: inline-flex; align-items: center; gap: 5px; color: var(--link); font-weight: 700; font-size: 12.5px; }
.link:hover { text-decoration: underline; }

.navbar { display: flex; justify-content: space-between; align-items: center; margin: 0 -10px 8px; gap: 8px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 10px; padding: 12px; }

.row-card {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
    background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 10px;
    padding: 6px 10px 6px 6px; margin-bottom: 9px; cursor: pointer;
    transition: transform .12s ease-out, background .12s, border-color .12s;
}
.row-card:hover:not(:disabled) { background: var(--raised); border-color: var(--accent); transform: translateY(-2px); }
.row-card:disabled { opacity: .45; cursor: default; }

.well {
    flex: none; display: grid; place-items: center; width: 86px; height: 86px;
    border: 1.5px solid var(--ink); border-radius: 9px;
    background: radial-gradient(70% 70% at 50% 72%, #7A2810, #281714);
}
.well.sm { width: 56px; height: 56px; border-bottom-width: 4px; }
.well.md { width: 64px; height: 64px; border-bottom-width: 4px; }
.well img { max-width: 80px; max-height: 80px; }

.go {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--raised); border: 1.5px solid var(--ink); color: var(--accent);
}

/* ---------- Home ---------- */
.tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 14px;
    background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 12px;
}
.tabs button {
    min-height: 40px; border: 0; border-radius: 8px; cursor: pointer; background: none;
    font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted);
}
.tabs button.on { background: linear-gradient(#FFB347, #FF7A1A 60%, #E2560E); color: var(--on-accent); }
.tabs button:not(.on):hover { background: var(--raised); color: var(--text); }

.liga-header { text-align: center; margin-bottom: 12px; }
.liga-header .h1 { font-size: clamp(26px, 9vw, 40px); }
.subtitle { color: var(--muted); font-size: clamp(11px, 3.4vw, 15px); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.team-card { flex-direction: column; align-items: stretch; padding: 8px 10px; }
.team-card-top { display: flex; align-items: center; gap: 10px; }
.team-name { font-family: var(--display); font-weight: 700; font-size: 17px; }
.roster { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; justify-items: center; }
.roster-ball {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
    background: var(--raised); border: 1.5px solid var(--ink);
}
.roster-ball img { width: 40px; height: 40px; }
.roster-ball.lg { width: 52px; height: 52px; flex: none; }
.roster-ball.lg img { width: 52px; height: 52px; }

.regions-label { font-size: 18px; margin: 6px 2px 8px; }
.region-name { display: block; font-family: var(--display); font-weight: 700; font-size: 24px; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.team-tile { padding: 12px; gap: 6px; }

/* ---------- Guide ---------- */
.guide-header { margin-bottom: 12px; }
.guide-title-row { display: flex; align-items: center; gap: 12px; }
.guide-header.centered .guide-title-row { text-align: center; }
.guide-header.centered .prompt { text-align: center; }
.links { display: flex; gap: 14px; margin-top: 2px; }
.legend { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.legend strong { color: var(--text); }

.lead-card {
    display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px;
    background: linear-gradient(90deg, #B3360C, #5A140A 55%, #1B1110);
    border: 1.5px solid var(--ink); border-bottom-width: 4px;
}
.lead-text { font-family: var(--display); font-weight: 700; font-size: 17px; }
.guide-header.centered .lead-text { text-align: center; }
.stack { display: grid; align-items: center; }
.stack > * { grid-area: 1 / 1; }
.sizer { visibility: hidden; }
.prompt { margin-top: 16px; }

.member-name { font-family: var(--display); font-weight: 700; font-size: 25px; }
.member-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

.dropdown { position: relative; margin-bottom: 14px; }
.dropdown-toggle {
    width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 0 12px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13.5px; text-align: left;
    background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 3px;
}
.dropdown-toggle:hover { background: var(--raised); }
.dropdown-menu {
    position: absolute; z-index: 4; left: 0; right: 0; top: calc(100% + 4px); padding: 3px; display: grid; gap: 3px;
    background: var(--surface); border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.variant {
    min-height: 34px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--muted);
    background: none; border: 1.5px solid transparent; border-bottom-width: 3px;
}
.variant:hover { background: var(--raised); color: var(--text); }
.variant.on { background: var(--yellow); color: var(--on-accent); border-color: var(--ink); }

.search {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 12px; min-height: 42px;
    background: var(--ink); border: 1.5px solid var(--line); border-radius: 10px;
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 10px 0; }
.search input::placeholder { color: var(--muted); opacity: .7; }

/* Lead tiles: as many columns as fit, stretched so no strip is left on the right */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(91px, 1fr)); gap: 7px; }
.tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 4px 3px 6px; cursor: pointer; text-align: center; font-size: 11.5px; font-weight: 500;
    background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 10px;
    transition: transform .12s ease-out, background .12s, border-color .12s;
}
.tile:hover { background: var(--raised); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Steps ---------- */
.steps-header { margin-bottom: 12px; }
.path { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.node-title { margin-top: 6px; font-size: 26px; }
.lead-hint {
    display: inline-block; margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 700;
    background: linear-gradient(90deg, #B3360C, #5A140A); border: 1.5px solid var(--ink); border-bottom-width: 3px;
}
.steps { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .steps, .row-card, .tile { animation: none; transition: none; } }

.step {
    display: flex; align-items: center; gap: 12px; margin-bottom: 9px; padding: 10px 12px; border-radius: 10px;
    background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px;
}
.step-note { background: var(--note-bg); border: 1.5px solid var(--note-line); color: var(--note-text); }
.step-warning { background: var(--warn-bg); border: 1.5px solid var(--warn-line); }
.marker { flex: none; width: 28px; display: grid; place-items: center; }
.coin {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); border: 1.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink);
    color: var(--on-accent); font-family: var(--display); font-weight: 700; font-size: 15px;
}
.step-kind { font-family: var(--display); font-weight: 700; font-size: 11.5px; margin-bottom: 2px; }
.step-action .step-kind { color: var(--accent); }
.step-note .step-kind, .step-note .marker { color: var(--blue); }
.step-setup .step-kind, .step-setup .marker { color: var(--yellow); }
.step-warning .step-kind, .step-warning .marker { color: var(--warn); }
.step-text { font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.step-text .hl { color: var(--yellow); }
.step-text.has-tip { text-decoration: underline dotted; cursor: help; }
.step-sprite { flex: none; }

.cond-table { margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1.5px solid var(--ink); border-bottom-width: 4px; }
.cond-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--table-head); color: var(--warn); font-family: var(--display); font-weight: 700; font-size: 13.5px; }
.cond-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; }
.cond-row + .cond-row { border-top: 1px solid var(--line); }
.move-chip { flex: none; padding: 2px 7px 3px; border-radius: 6px; background: var(--chip-bg); border: 1px solid var(--chip-line); color: var(--chip-text); font-family: var(--mono); font-size: 13px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.single { grid-template-columns: 1fr; }
.choice {
    display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 6px 10px; text-align: left; cursor: pointer;
    font-weight: 700; font-size: 14px; line-height: 19px;
    background: var(--raised); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 10px;
}
.choice:hover { background: var(--hover); border-color: var(--accent); }
.choice img { margin: -4px 0; }

.done-card { margin-top: 4px; padding: 14px; border-radius: 10px; background: var(--done-bg); border: 1.5px solid var(--ink); border-bottom-width: 4px; }
.done-title { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 18px; }
.check { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); border: 1.5px solid var(--ink); color: var(--bg); }
.done-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.done-buttons .btn { min-height: 44px; }

.steps-footer {
    position: fixed; z-index: 6; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 10px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: rgba(10, 7, 5, 0.9); border-top: 1.5px solid var(--ink); backdrop-filter: blur(6px);
}
.steps-footer .btn { min-height: 44px; min-width: 0; }
.fit-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11px, 3.3vw, 13.5px); }

/* ---------- Team page ---------- */
.team-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.roster-hint { font-size: 14px; margin-bottom: 10px; }
.set-card { padding: 0; margin-bottom: 8px; overflow: hidden; }
.set-toggle {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; text-align: left; cursor: pointer;
    background: none; border: 0; border-radius: 9px;
}
.set-toggle:hover:not(:disabled) { background: var(--raised); }
.set-toggle:disabled { cursor: default; }
.set-name { font-family: var(--display); font-weight: 700; font-size: 18px; }
.set-body { margin: 0 10px 10px; padding: 8px 10px; border-radius: 8px; background: var(--raised); font-family: var(--mono); font-size: 13px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.set-header { font-weight: 700; margin-bottom: 2px; }

/* ---------- Boot + errors ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot img { image-rendering: auto; animation: pulse 1.4s ease-in-out infinite; }
.boot-bar { width: 140px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: var(--blazor-load-percentage, 0%); background: linear-gradient(90deg, #FF7A1A, #FFC53D); transition: width .1s; }
@keyframes pulse { 50% { transform: scale(1.06); filter: brightness(1.2); } }

#blazor-error-ui {
    display: none; position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0;
    padding: 12px 40px 12px 16px; background: var(--warn-bg); color: var(--text); border-top: 2px solid var(--warn);
}
#blazor-error-ui .reload { color: var(--yellow); font-weight: 700; margin-left: 8px; }
#blazor-error-ui .dismiss { position: absolute; right: 14px; top: 10px; cursor: pointer; }

.blazor-error-boundary { background: var(--warn-bg); padding: 1rem; color: var(--text); border-radius: 10px; }
.blazor-error-boundary::after { content: "Ocorreu um erro. / An error has occurred."; }

/* Blazor focuses the page's h1 after navigation (for screen readers); no visible ring needed there. */
h1:focus, h1:focus-visible { outline: none; }

/* Branch questions are centered, like the desktop. */
.steps .prompt { text-align: center; margin-top: 4px; }
