:root {
  --bg: #0a120c; --bg2: #101b13; --card: #142219; --card2: #1a2b20; --line: #24382b;
  --text: #ecf2e8; --muted: #93a596; --amber: #f2b134; --amber2: #ffcf6b; --red: #d63428; --ok: #6fdc6a;
  --common: #a3acb5; --rare: #3f8cff; --epic: #f2b134; --legendary: #e5413b; --unique: #33c25e; --apex: #b07cff; --omega: #e8eef6;
  --radius: 14px;
  --head: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.jungle { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(242,177,52,.16), transparent 60%),
    radial-gradient(700px 600px at -10% 30%, rgba(51,194,94,.10), transparent 60%),
    radial-gradient(700px 600px at 110% 70%, rgba(51,194,94,.08), transparent 60%),
    linear-gradient(#0d1a10, #070d08 70%);
}
[hidden] { display: none !important; }
a { color: var(--amber2); }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.view { max-width: 720px; margin: 0 auto; }
.center { min-height: 90vh; display: grid; place-items: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--amber); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-card { width: min(92vw, 360px); background: linear-gradient(var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; display: grid; gap: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-logo { margin: 0 auto; border-radius: 22px; }
.login-card h1 { margin: 0; font: 800 28px/1 var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.login-card label { display: grid; gap: 4px; text-align: left; font-size: 13px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: #0c160f; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
input:focus, select:focus { outline: 2px solid rgba(242,177,52,.6); outline-offset: 0; }
.btn { font: 600 15px/1 inherit; font-family: inherit; color: var(--text); background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 44px; cursor: pointer; }
.btn.primary { background: linear-gradient(#f6c14d, #e09a1d); color: #1d1405; border-color: #f6c14d; font-weight: 800; letter-spacing: .03em; }
.btn.danger { color: #ff8a80; }
.btn:disabled { opacity: .55; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 8px; background: linear-gradient(rgba(10,18,12,.97), rgba(10,18,12,.88)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(242,177,52,.35); }
.brand h1 { margin: 0; font: 800 21px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); text-shadow: 0 1px 0 #6b3d00, 0 0 18px rgba(242,177,52,.25); }
.brand p { margin: 2px 0 0; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 12px; width: 42px; height: 42px; font-size: 20px; cursor: pointer; }

/* Tabs */
.tabs { display: grid; grid-template-columns: 1fr 1.25fr 1.35fr; gap: 6px; margin: 4px 14px 8px; padding: 4px; background: #0c160f; border: 1px solid var(--line); border-radius: 14px; }
.tab { font: 800 14px/1 var(--head); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: none; border: 0; border-radius: 10px; padding: 11px 6px; cursor: pointer; }
.tab[aria-selected="true"] { color: #1d1405; background: linear-gradient(#f6c14d, #e09a1d); box-shadow: 0 4px 14px rgba(242,177,52,.25); }
.count { font-weight: 700; opacity: .75; }

/* Toolbar */
.toolbar { padding: 0 14px; display: grid; gap: 8px; position: sticky; top: 60px; z-index: 4; background: linear-gradient(rgba(10,18,12,.95), rgba(10,18,12,.85)); padding-bottom: 8px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { --c: var(--muted); flex: none; font: 700 12.5px/1 inherit; color: var(--c); background: #0c160f; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 999px; padding: 8px 11px; cursor: pointer; }
.chip[data-r="common"] { --c: var(--common); } .chip[data-r="rare"] { --c: var(--rare); } .chip[data-r="epic"] { --c: var(--epic); }
.chip[data-r="legendary"] { --c: var(--legendary); } .chip[data-r="unique"] { --c: var(--unique); } .chip[data-r="apex"] { --c: var(--apex); }
.chip[data-r="omega"] { --c: var(--omega); } .team-chip { --c: var(--amber2); }
.chip.on { color: #0a120c; background: var(--c); border-color: var(--c); }
.banner { margin: 0 14px 8px; padding: 8px 12px; border-radius: 10px; background: rgba(242,177,52,.12); border: 1px solid rgba(242,177,52,.35); color: var(--amber2); font-size: 13px; }

/* List */
.list { padding: 2px 10px 18px; display: grid; gap: 7px; }
.row { --rc: var(--common); position: relative; display: grid; grid-template-columns: 62px 1fr auto; gap: 11px; align-items: center; padding: 8px 10px 8px 8px; border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 12%, var(--card)) 0%, var(--card) 45%); border: 1px solid color-mix(in srgb, var(--rc) 28%, var(--line)); cursor: pointer; content-visibility: auto; contain-intrinsic-size: 78px; }
.row:active { transform: scale(.99); }
.r-common { --rc: var(--common); } .r-rare { --rc: var(--rare); } .r-epic { --rc: var(--epic); } .r-legendary { --rc: var(--legendary); }
.r-unique { --rc: var(--unique); } .r-apex { --rc: var(--apex); } .r-omega { --rc: var(--omega); }
.thumb { position: relative; width: 62px; height: 62px; border-radius: 12px; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 35%, #1b2a1f), #0b140d 75%); border: 2px solid var(--rc); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.locked img { filter: grayscale(1) brightness(.75) sepia(.35) hue-rotate(250deg); }
.lvl { position: absolute; left: -2px; bottom: -2px; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 0 8px 0 10px; background: var(--rc); color: #0a120c; font: 800 13px/22px var(--head); text-align: center; }
.r-legendary .lvl, .r-rare .lvl, .r-apex .lvl { color: #fff; }
.info { min-width: 0; }
.name { font: 800 16px/1.15 var(--head); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.rtag { color: var(--rc); font-weight: 700; text-transform: capitalize; }
.team { font: 800 10.5px/1 inherit; letter-spacing: .05em; color: #1d1405; background: var(--amber); border-radius: 6px; padding: 3px 5px; }
.side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 18px 30px; }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: min(720px, 100%); max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(#152519, #0d170f); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.6); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet h2 { margin: 0 0 6px; font: 800 22px/1.1 var(--head); text-transform: uppercase; letter-spacing: .05em; color: var(--amber); }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #0c160f; color: var(--text); font-size: 16px; cursor: pointer; z-index: 2; }
.stack { display: grid; gap: 8px; margin: 12px 0; }

.hero { --rc: var(--common); display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; margin-right: 40px; }
.hero .thumb { width: 112px; height: 112px; border-radius: 18px; border-width: 3px; box-shadow: 0 0 28px color-mix(in srgb, var(--rc) 40%, transparent); }
.hero .lvl { font-size: 16px; height: 28px; line-height: 28px; min-width: 32px; }
.hero h2 { color: var(--text); font-size: 24px; }
.hero .rtag { font-size: 13px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.section h3 { margin: 0 0 10px; font: 800 14px/1 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--amber2); }
.edit-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.edit-grid > .label { color: var(--muted); font-size: 13px; }
.stepper { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stepper button { min-width: 44px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font: 700 14px/1 inherit; cursor: pointer; }
.stepper .val { min-width: 54px; text-align: center; font: 800 22px/1 var(--head); }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.toggle { border: 1px solid var(--line); background: #0c160f; color: var(--muted); border-radius: 999px; padding: 9px 13px; font: 700 13px/1 inherit; cursor: pointer; }
.toggle.on { color: #1d1405; background: var(--amber); border-color: var(--amber); }
.save-state { font-size: 12px; color: var(--muted); min-height: 16px; margin-top: 6px; }
.save-state.ok { color: var(--ok); } .save-state.err { color: #ff8a80; }

.mini-list { display: grid; gap: 6px; }
.mini { --rc: var(--common); display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 30%, var(--line)); cursor: pointer; color: inherit; text-align: left; font: inherit; width: 100%; }
.mini .thumb { width: 44px; height: 44px; border-radius: 9px; }
.mini .name { font-size: 14px; }
.mini .sub { font-size: 12px; color: var(--muted); }
.ok-t { color: var(--ok); } .bad-t { color: #ff8a80; }

.calc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.calc-opts { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.calc-opts select { min-height: 34px; padding: 4px 8px; }
.calc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc-card { border-radius: 14px; padding: 12px; background: #0c160f; border: 1px solid var(--line); }
.calc-card.exp { border-color: rgba(111,220,106,.5); box-shadow: inset 0 0 30px rgba(111,220,106,.06); }
.calc-card .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.calc-card .big { font: 800 30px/1.05 var(--head); margin: 4px 0; }
.calc-card .big small { font-size: 15px; color: var(--muted); }
.calc-card .sub { font-size: 12.5px; color: var(--muted); }
table.use { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
table.use th, table.use td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.use th:first-child, table.use td:first-child { text-align: left; }
table.use th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.stop { margin-top: 8px; font-size: 12.5px; color: var(--amber2); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: #1e3124; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; max-width: 90vw; }
@media (min-width: 560px) { .row { grid-template-columns: 70px 1fr auto; } .thumb { width: 70px; height: 70px; } .mini .thumb { width: 44px; height: 44px; } .hero .thumb { width: 130px; height: 130px; } .hero { grid-template-columns: 130px 1fr; } }
/* keep grids from growing to the width of the scrolling chip row */
html, body { overflow-x: hidden; }
.toolbar { grid-template-columns: minmax(0, 1fr); }
.toolbar > *, .info, .section, .calc-cards > *, .mini > div { min-width: 0; }
.search-row select { max-width: 42vw; }
.calc-opts label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.search-row { grid-template-columns: minmax(0, 1fr) auto; }
.search-row input { width: 100%; min-width: 0; }
.calc-card .big small { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; }

/* v1.1: level line in rows */
.lvline { margin-top: 6px; display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.lvline b { color: var(--text); font: 800 15px/1 var(--head); }
.lvline.locked-t { display: block; font-style: italic; }
.lvbar { height: 5px; border-radius: 3px; background: #0b140d; border: 1px solid var(--line); overflow: hidden; }
.lvbar > i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 70%, #000), var(--rc)); }
.calc-btn { width: 100%; margin-top: 14px; font-size: 16px; }

/* v1.1: Upgrade Calculator */
.calc-view { margin: 0 14px; }
.calc-pick { display: grid; gap: 6px; }
.calc-pick input { width: 100%; font-size: 17px; }
.calc-intro { margin-top: 18px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.calc-intro h3 { margin: 0 0 6px; font: 800 18px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--amber2); }
.calc-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.calc-title h2 { margin: 0; font: 800 24px/1.05 var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--rc); min-width: 0; }
.small-btn { min-height: 36px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.link-btn { background: none; border: 0; color: var(--amber2); font: 600 13px/1 inherit; padding: 8px 4px; cursor: pointer; text-decoration: underline; }
.tree { display: grid; gap: 8px; }
.node { margin-left: calc(min(var(--d), 4) * 12px); padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line)); border-left: 4px solid var(--rc); min-width: 0; }
.node.root { background: linear-gradient(var(--card2), var(--card)); box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 18%, transparent); }
.node.dup { background: none; border: 1px dashed var(--line); padding: 8px 10px; }
.node-head { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
.node-head .thumb { width: 48px; height: 48px; border-radius: 10px; }
.node-head .name { font: 800 16px/1.1 var(--head); text-transform: uppercase; letter-spacing: .02em; }
.node-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.node-inputs { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.node-inputs label { display: grid; gap: 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 0; }
.node-inputs input { width: 100%; min-height: 50px; font: 800 22px/1 var(--head); letter-spacing: .02em; text-align: right; padding: 8px 12px; }
.node-inputs .lv-in input { text-align: center; }
.node-inputs input::placeholder { font: 500 13px/1 -apple-system, system-ui, sans-serif; color: #6f8172; letter-spacing: 0; }
.node-inputs .dna-in input { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.node-hint:empty { display: none; }
.node-hint { margin-top: 5px; font-size: 11.5px; }
.target-in { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; font: 800 14px/1 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--amber2); }
.target-in input { min-height: 50px; font: 800 22px/1 var(--head); text-align: center; }
.target-in input::placeholder { font: 500 13px/1 system-ui, sans-serif; }
.calc-cards.one { grid-template-columns: 1fr; }
.first { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(242,177,52,.08); border: 1px solid rgba(242,177,52,.35); }
.first h4 { margin: 0 0 6px; font: 800 13px/1 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--amber2); }
.first ul { margin: 0; padding-left: 18px; font-size: 13px; }
.lv-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: #0c160f; border: 1px solid var(--line); font-size: 13px; }
.lv-save span { flex: 1 1 auto; }
#calc-view .calc-opts { margin: 4px 0 2px; }
#calc-view .section h3 { margin-bottom: 0; }
#calc-view #calc-out .section h3 { margin-bottom: 10px; }
.calc-card .big small.pre { display: block; margin: 0 0 2px; font-size: 14px; color: var(--amber2); text-transform: uppercase; letter-spacing: .04em; }
table.use .fz { display: block; font-size: 11px; color: var(--muted); }
.node-inputs { grid-template-columns: 112px minmax(0, 1fr); }
.node-inputs .lv-in input { padding: 8px 4px; }
.node-inputs .lv-in input::placeholder { font-size: 12.5px; }

/* v1.2: four tabs */
.tabs { grid-template-columns: .9fr 1.3fr .85fr 1fr; gap: 4px; }
.tab { font-size: 13px; letter-spacing: .03em; padding: 11px 2px; }
.detail-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.detail-actions .calc-btn { margin-top: 0; }
.focus-btn { white-space: nowrap; font-weight: 700; }
.focus-btn.on { color: var(--amber2); border-color: rgba(242,177,52,.5); }
.title-btns { display: flex; gap: 6px; flex-shrink: 0; }
.title-btns .focus-btn { min-height: 36px; padding: 8px 10px; font-size: 13px; }
.toast-btn { margin-left: 10px; background: none; border: 1px solid var(--amber); color: var(--amber2); border-radius: 8px; padding: 4px 10px; font: 700 13px/1 inherit; cursor: pointer; }

/* v1.2: Focus */
.focus-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.focus-head h3 { margin: 0; font: 800 14px/1 var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--amber2); }
.goal-list { display: grid; gap: 8px; }
.goal { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 38px; gap: 6px; align-items: stretch; padding: 8px 6px 8px 2px; border-radius: 14px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line)); border-left: 4px solid var(--rc); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.goal.dragging { z-index: 5; box-shadow: 0 14px 40px rgba(0,0,0,.6); background: var(--card2); transition: none; }
.goal:not(.dragging) { transition: transform .15s ease; }
.goal.swiping { transition: none; }
.drag-h { touch-action: none; display: grid; place-items: center; background: none; border: 0; color: var(--muted); font: 800 18px/1 inherit; letter-spacing: -3px; cursor: grab; padding: 0; }
.goal-top { display: grid; grid-template-columns: auto 52px minmax(0, 1fr); gap: 8px; align-items: center; }
.goal .rank { font: 800 20px/1 var(--head); color: var(--amber); min-width: 26px; text-align: center; }
.goal .thumb { width: 52px; height: 52px; border-radius: 10px; }
.goal-info .name { font: 800 16px/1.1 var(--head); text-transform: uppercase; letter-spacing: .02em; }
.goal-info .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tgt { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-weight: 700; }
.tgt input { width: 54px; min-height: 34px; padding: 4px 6px; text-align: center; font: 800 17px/1 var(--head); border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); user-select: text; -webkit-user-select: text; }
.goal-note { width: 100%; margin-top: 6px; min-height: 36px; font-size: 14px; padding: 6px 10px; user-select: text; -webkit-user-select: text; }
.goal-actions { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.goal-actions .link-btn { font-size: 12.5px; padding: 6px 4px; }
.link-btn:empty { display: none; }
.danger-t { color: #ff8a80 !important; }
.goal-move { display: grid; gap: 6px; align-content: center; }
.goal-move button { height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 13px; cursor: pointer; }
.goal-move button:disabled { opacity: .3; }
.dart-list { display: grid; gap: 6px; margin-top: 8px; }
.dart { --rc: var(--common); display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 30%, var(--line)); color: inherit; font: inherit; text-align: left; width: 100%; cursor: pointer; }
.dart.r-common { --rc: var(--common); } .dart.r-rare { --rc: var(--rare); } .dart.r-epic { --rc: var(--epic); } .dart.r-legendary { --rc: var(--legendary); } .dart.r-unique { --rc: var(--unique); } .dart.r-apex { --rc: var(--apex); } .dart.r-omega { --rc: var(--omega); }
.dart .thumb { width: 48px; height: 48px; border-radius: 10px; }
.dart-info { min-width: 0; }
.dart-info .name { font: 800 15px/1.15 var(--head); text-transform: uppercase; letter-spacing: .02em; }
.dart-info .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hv { display: inline-block; font: 800 10.5px/1 inherit; text-transform: uppercase; letter-spacing: .04em; color: #1d1405; background: var(--amber); border-radius: 6px; padding: 3px 6px; vertical-align: 2px; }
.chips-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.gchip { display: inline-block; font-size: 11px; font-weight: 700; color: var(--amber2); background: rgba(242,177,52,.10); border: 1px solid rgba(242,177,52,.35); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.dart-dna { text-align: right; display: grid; justify-items: end; }
.dart-dna b { font: 800 19px/1 var(--head); }
.dart-dna > span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dart-dna .sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
ul.plain { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 6px; }
ul.conflicts li::marker { color: var(--amber); }
.focus-view .section h3 { margin-bottom: 4px; }
.mini.r-common { --rc: var(--common); } .mini.r-rare { --rc: var(--rare); } .mini.r-epic { --rc: var(--epic); } .mini.r-legendary { --rc: var(--legendary); } .mini.r-unique { --rc: var(--unique); } .mini.r-apex { --rc: var(--apex); } .mini.r-omega { --rc: var(--omega); }
.dart-info .name, .goal-info .name { white-space: normal; overflow: visible; text-overflow: clip; }
.dart-info .sub .hv { margin-left: 4px; }
.goal-info .sub { white-space: nowrap; }
.goal-info .sub + .sub { white-space: normal; }
.hv { font: 800 10px/1 -apple-system, system-ui, sans-serif; padding: 3px 6px; }
.toast-btn { font: 700 13px/1 -apple-system, system-ui, sans-serif; }
.amber-t { color: var(--amber2); }

/* v1.3: DNA sources */
.src-sum { font: 800 16px/1.2 var(--head); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-radius: 12px; background: #0c160f; border: 1px solid var(--line); border-left: 4px solid var(--acol, var(--muted)); }
.src-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.src-list li { padding: 6px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--acol, var(--muted)); }
.a-wild { --acol: var(--ok); } .a-arena { --acol: #ff8a5c; } .a-strike { --acol: #f2b134; } .a-raid { --acol: #e5413b; } .a-alliance { --acol: #3f8cff; }
.a-sanctuary { --acol: #33c25e; } .a-event { --acol: #b07cff; } .a-fuse { --acol: #9a7cff; } .a-other_region { --acol: #93a596; } .a-unknown { --acol: #93a596; }
.atag { display: inline-block; font: 700 10.5px/1 -apple-system, system-ui, sans-serif; padding: 3px 6px; border-radius: 6px; color: var(--acol); border: 1px solid color-mix(in srgb, var(--acol) 55%, transparent); background: color-mix(in srgb, var(--acol) 12%, transparent); white-space: nowrap; vertical-align: 1px; }
.dart-info .sub.where { color: var(--text); }
.dart-info .sub.where b { color: var(--acol); }
.region-set { display: grid; gap: 6px; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.region-set select { width: 100%; }

/* v1.3: evolution tree */
details.evo { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: #0c160f; }
details.evo > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
details summary::-webkit-details-marker { display: none; }
.evo-tog { display: inline-block; width: 18px; flex: 0 0 18px; text-align: center; color: var(--amber2); font-size: 12px; transition: transform .15s ease; }
.evo-tog::before { content: "▸"; }
details[open] > summary > .evo-tog { transform: rotate(90deg); }
.evo-hint { margin: -2px 12px 6px; }
.evo-tree { padding: 0 8px 10px 4px; display: grid; gap: 4px; }
details.evo-node > summary { list-style: none; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.evo-kids { margin-left: 13px; padding-left: 9px; border-left: 1px dashed #34503c; display: grid; gap: 4px; margin-top: 4px; }
.evo-leaf { padding-left: 20px; }
.evo-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; padding: 5px 8px; border-radius: 10px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 30%, var(--line)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.evo-row.r-common { --rc: var(--common); } .evo-row.r-rare { --rc: var(--rare); } .evo-row.r-epic { --rc: var(--epic); } .evo-row.r-legendary { --rc: var(--legendary); } .evo-row.r-unique { --rc: var(--unique); } .evo-row.r-apex { --rc: var(--apex); } .evo-row.r-omega { --rc: var(--omega); }
.evo-row .thumb { width: 34px; height: 34px; border-radius: 8px; border-width: 1.5px; }
.evo-row .thumb .lvl { display: none; }
.evo-txt { display: grid; min-width: 0; }
.evo-name { font: 800 13.5px/1.15 var(--head); text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evo-sub { font-size: 11.5px; color: var(--muted); }
.evo-lv { color: var(--text); font-weight: 700; }
.evo-no { color: #ff8a80; }
.evo-leaf .evo-row, details.evo-node > summary .evo-row { width: 100%; }

/* v1.4: five tabs (two-line labels so they fit a 320–390px phone) */
.tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 4px 10px 8px; padding: 3px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; font-size: 13px; letter-spacing: .02em; min-width: 0; }
.tab .t-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tab .t-c { font: 700 11px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; opacity: .75; min-height: 11px; }
@media (max-width: 345px) { .tab { font-size: 11.5px; letter-spacing: 0; } }

/* Brawl */
.brawl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.brawl-actions .btn { flex: 1 1 auto; padding: 10px 12px; min-height: 40px; font-size: 14px; }
.brawl-actions .danger { flex: 0 0 auto; }
.bcards { display: grid; gap: 8px; }
.bcard { position: relative; text-align: left; color: inherit; font: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; display: grid; gap: 4px; }
.bcard .name { font-size: 17px; }
.bcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bcard .sub, .bhead .sub { font-size: 12.5px; color: var(--muted); }
.st { flex: none; font: 800 10.5px/1 inherit; letter-spacing: .05em; text-transform: uppercase; border-radius: 6px; padding: 4px 6px; background: #0c160f; border: 1px solid var(--line); color: var(--muted); }
.st-now { color: #0a120c; background: var(--ok); border-color: var(--ok); } .st-upcoming { color: var(--amber2); border-color: var(--amber); }
.is-sample { border: 1px dashed #c58bff; background: repeating-linear-gradient(135deg, var(--card) 0 14px, #1a1b26 14px 28px); }
.sample-tag { justify-self: start; font: 800 10.5px/1 inherit; letter-spacing: .08em; color: #1a0c26; background: #c58bff; border-radius: 6px; padding: 4px 6px; }
.sample-flag { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(197,139,255,.15); border: 1px solid #c58bff; color: #e2c8ff; font-weight: 700; font-size: 13px; }
.bhead { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.bhead h2 { margin: 0 0 4px; font: 800 21px/1.1 var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--amber); }
.rules { margin: 8px 0 0; white-space: pre-wrap; font-size: 13px; color: var(--text); background: #0c160f; border-radius: 10px; padding: 8px 10px; }
.sugg { font: 800 10px/1 inherit; letter-spacing: .08em; color: #1d1405; background: var(--amber); border-radius: 5px; padding: 3px 5px; vertical-align: 2px; }
.lineup { display: grid; gap: 10px; }
.lrow-h { font: 800 12.5px/1 var(--head); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { --rc: var(--common); display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: start; text-align: left; color: inherit; font: inherit; padding: 8px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 14%, var(--card)), var(--card) 60%); border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line)); }
.slot .thumb { width: 44px; height: 44px; border-radius: 9px; }
.slot .name { font-size: 13.5px; }
.slot-txt { min-width: 0; } .slot .sub { font-size: 11.5px; color: var(--muted); }
.why { color: var(--amber2) !important; }
.btags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.btag { --bc: var(--muted); font: 700 10.5px/1 inherit; color: var(--bc); border: 1px solid color-mix(in srgb, var(--bc) 50%, transparent); background: color-mix(in srgb, var(--bc) 12%, transparent); border-radius: 5px; padding: 3px 5px; white-space: nowrap; }
.b-group_attack { --bc: #ff8f5a; } .b-team_heal { --bc: #6fdc6a; } .b-team_buff { --bc: #5fd3e6; } .b-taunt { --bc: #f2b134; } .b-damaging_counter { --bc: #ff6b8a; } .b-counter { --bc: #b9a4c9; } .b-revenge { --bc: #c58bff; }
.tag-chip { --c: var(--bc); }
.brow { --rc: var(--common); display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--rc) 30%, var(--line)); cursor: pointer; color: inherit; text-align: left; font: inherit; width: 100%; }
.brow .thumb { width: 44px; height: 44px; border-radius: 9px; }
.brow .name { font-size: 14px; } .brow .sub { font-size: 12px; color: var(--muted); }
.brow-txt { min-width: 0; }
.brow.unowned { opacity: .62; }
.brow .rank { font: 800 16px/1 var(--head); color: var(--amber2); min-width: 18px; text-align: center; }
.brow:not(:has(.rank)) { grid-template-columns: 44px minmax(0, 1fr) auto; }
.score { font: 800 13px/1 var(--head); color: var(--muted); }
.role { font-weight: 700; } .role-front { color: #f2b134; } .role-back { color: #5fd3e6; }
.bchips { flex-wrap: wrap; margin-bottom: 8px; }
.gchip.bad { color: #ff8a80; border-color: rgba(255,138,128,.4); }
.gchip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font: inherit; }
.bform { display: grid; gap: 12px; margin-top: 10px; }
.bform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.bform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bform .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
textarea { font: inherit; color: var(--text); background: #0c160f; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box; resize: vertical; }
#brawl-sheet textarea { margin: 8px 0; font-size: 14px; }
details.paste { margin: 10px 0; padding: 10px; border-radius: 12px; background: #0c160f; border: 1px solid var(--line); }
details.paste summary { cursor: pointer; }
.paste-res { margin-top: 10px; display: grid; gap: 6px; font-size: 13.5px; }
.paste-res p { margin: 0; }
.linkbtn { background: none; border: 1px solid var(--line); color: var(--amber2); border-radius: 7px; padding: 3px 7px; font: 600 12.5px/1.2 inherit; cursor: pointer; margin: 2px 0; }
.linkbtn.on { background: var(--amber); color: #1d1405; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.chk input { min-height: 0; width: 18px; height: 18px; }
.mini.pick .check { font: 800 18px/1 var(--head); color: var(--ok); width: 28px; text-align: center; }
.mini.picked { background: color-mix(in srgb, var(--ok) 12%, var(--card)); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.mini.picked .check { color: #0a120c; background: var(--ok); border-radius: 50%; height: 28px; line-height: 28px; }
.done-btn { width: 100%; margin-top: 12px; }
.imp { padding: 8px; border-radius: 10px; background: #0c160f; border: 1px solid var(--line); display: grid; gap: 4px; }
.btag-list li { margin-bottom: 6px; }
code { font-size: 11.5px; word-break: break-all; color: var(--amber2); }
/* coins (informational) */
.coins { margin-top: 12px; padding: 10px; border-radius: 12px; background: #0c160f; border: 1px solid var(--line); }
.coins h4 { margin: 0 0 6px; font: 800 13px/1 var(--head); text-transform: uppercase; letter-spacing: .07em; color: #ffd76b; }
.coin-t td:first-child { text-align: left; } .coin-t tr.tot td { font-weight: 800; color: #ffd76b; border-bottom: 0; }
.coin-s { color: #ffd76b; white-space: nowrap; }
/* quick Focus toggle on list cards */
.side { display: flex; align-items: center; }
.qf { min-width: 44px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: #0c160f; color: var(--muted); font: 800 12.5px/1 var(--head); letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.qf.on { color: #1d1405; background: var(--amber); border-color: var(--amber); }
/* Analyze my team */
.team-bar { margin: 0 14px 8px; }
.team-btn { width: 100%; display: flex; align-items: center; gap: 8px; justify-content: flex-start; color: var(--amber2); border-color: rgba(242,177,52,.4); background: linear-gradient(90deg, rgba(242,177,52,.12), var(--card2)); }
.team-btn .muted:last-child { margin-left: auto; }
.cls { display: flex; gap: 8px; flex-wrap: wrap; }
.clsb { padding: 6px 10px; border-radius: 10px; background: #0c160f; border: 1px solid var(--line); font-size: 13px; }
.speeds { display: flex; flex-wrap: wrap; gap: 6px; }
.spd { font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: #0c160f; border: 1px solid var(--line); }
.findings li { list-style: none; margin-left: -18px; padding: 8px 10px; border-radius: 10px; background: #0c160f; border-left: 3px solid var(--line); }
.findings li.good { border-left-color: var(--ok); } .findings li.bad { border-left-color: #ff8a80; }
.findings .why { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.findings .watch { color: var(--amber2); font-size: 12.5px; margin-top: 3px; }
.gchip.linkish { cursor: pointer; font-size: 12.5px; }
.mech-t td { text-align: left !important; vertical-align: top; font-size: 12.5px; }
.mech-t td:nth-child(2) { white-space: nowrap; color: var(--muted); }
.mech-t tr.miss td:first-child { color: #ff8a80; }
.res-wrap { overflow-x: auto; }
.res-t { border-collapse: collapse; font-size: 11.5px; width: 100%; }
.res-t th { font-weight: 600; text-align: left; color: var(--muted); padding: 3px 4px; white-space: nowrap; }
.res-t thead img { width: 26px; height: 26px; border-radius: 6px; display: block; margin: auto; }
.res-t td { text-align: center; padding: 3px 2px; border-radius: 4px; }
.rv0 { color: #55665a; } .rv1 { background: rgba(111,220,106,.12); } .rv2 { background: rgba(111,220,106,.25); } .rv3 { background: rgba(111,220,106,.4); } .rv4 { background: rgba(111,220,106,.6); color: #0a120c; font-weight: 700; }
.res-t td.z { font-weight: 700; }
.bhead .brawl-actions { flex-wrap: nowrap; }
.bhead .brawl-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 13.5px; white-space: nowrap; }
.bhead .brawl-actions .danger { flex: 0 0 44px; }
.res-t { font-size: 10.5px; table-layout: fixed; }
.res-t th:first-child { width: 92px; white-space: normal; line-height: 1.15; }
.res-t thead th { padding: 2px 1px; }
.res-t thead img { width: 22px; height: 22px; }
.res-t td { padding: 3px 0; }
