/* Netfall: a drafting table under a cool light (light) and a night arena (dark). house.css loads first. */
:root {
  --bg: #EEF0F7; --panel: #FFFFFF; --panel-2: #F3F4FA; --line: #DCDFEB; --text: #1B1D2E; --muted: #626882;
  --accent: #5B4BD6; --accent-ink: #FFFFFF; --me: #0E9BB5; --them: #E5484D; --gold: #C98A12; --good: #1E9E64; --bad: #D0384B;
  --cell: #F6F7FC; --cell-line: #D5D9E8; --ok: rgba(30, 158, 100, .16); --nope: rgba(208, 56, 75, .12);
  --h-bg: var(--panel-2); --h-panel: var(--panel); --h-panel2: var(--panel-2); --h-line: var(--line); --h-text: var(--text); --h-muted: var(--muted);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E0F19; --panel: #171A2A; --panel-2: #1D2135; --line: #2B3150; --text: #EEF0FA; --muted: #9AA1BE;
  --accent: #A99BFF; --accent-ink: #14122A; --me: #3FD3EA; --them: #FF7A7E; --gold: #F5C451; --good: #4ADE95; --bad: #FF6F7F;
  --cell: #1A1E31; --cell-line: #30375A; --ok: rgba(74, 222, 149, .16); --nope: rgba(255, 111, 127, .14);
  --h-on: #0E0F19;
  --h-bg: var(--panel-2); --h-panel: var(--panel); --h-panel2: var(--panel-2); --h-line: var(--line); --h-text: var(--text); --h-muted: var(--muted);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--h-sans); line-height: 1.45; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
html { touch-action: manipulation; }
a { color: inherit; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.layout { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* header mark: a cube's net */
.hbrand .logo .mark { width: 28px; height: 28px; flex: none; }
.mark path { stroke-linejoin: round; stroke-width: 1.6; stroke: var(--text); }
.mark .m-a { fill: #FFCE40; } .mark .m-b { fill: #2EC4B6; } .mark .m-c { fill: #FF5C9A; } .mark .m-d { fill: #8B5CF6; }
@media (max-width: 440px) { .hbar { gap: 6px; } .hicons { gap: 3px; } .hicon { width: 30px; height: 30px; border-radius: 10px; position: relative; } .hicon svg { width: 16px; height: 16px; }
  .hicon::before { content: ""; position: absolute; inset: -7px -3px; }
  .hbrand .logo { font-size: 22px; gap: 5px; } .hbrand .logo .mark { width: 20px; height: 20px; } }
@media (max-width: 380px) { .hbrand .logo { font-size: 20px; } .hbrand .logo .mark { display: none; } .hbrand .by { letter-spacing: .1em; } }
@media (max-width: 350px) { .hbar { flex-wrap: wrap; row-gap: 6px; } .hicons { margin-left: auto; } }

.dayline { text-align: center; color: var(--muted); font-size: .85rem; margin: 2px 0 8px; }
.dayline b { color: var(--text); }
.stage { display: grid; gap: 16px; }

/* hud */
.hud { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; min-height: 50px; }
.hud .lbl { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); line-height: 1; margin-bottom: 2px; }
.hud b { font: 700 1.35rem/1.05 var(--h-serif); font-variant-numeric: tabular-nums; }
.hud small { color: var(--muted); font-weight: 600; }
.hlives { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.hlives svg { width: 18px; height: 18px; }
.hlives .on { fill: var(--them); } .hlives .off { fill: none; stroke: var(--line); stroke-width: 2; }
.hwins { text-align: right; }
.hcoins { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border-radius: 99px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); }
.hcoins b.bump, .hud b.bump { animation: bump .35s var(--h-spring); display: inline-block; }
@keyframes bump { 40% { transform: scale(1.18); } }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE9A8, #E2A72E 60%, #A8740F); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); display: inline-block; }

/* coach line */
.coach { margin: 0; display: flex; gap: 8px; align-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 8px 6px 8px 14px; font-weight: 600; font-size: .92rem; animation: hUp .4s var(--h-ease) both; }
.coach span { flex: 1; }
.coach-x { border: 0; background: transparent; color: inherit; width: 40px; height: 40px; font-size: 22px; cursor: pointer; border-radius: 10px; flex: none; }
.opp { font-size: .9rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.opp b { color: var(--text); }
.opp .tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.opp .mini { display: inline-flex; gap: 2px; }
.opp .mini canvas { width: 24px; height: 24px; }

/* shop */
.draft { display: grid; gap: 16px; }
.shophead, .trayhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shophead h2, .trayhead h2 { font: 700 1.25rem/1 var(--h-serif); margin: 0; }
.shophead small, .trayhead small { font: 600 .75rem/1 var(--h-sans); color: var(--muted); margin-left: 6px; letter-spacing: .02em; }
.hint { color: var(--muted); font-size: .82rem; text-align: right; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .15s var(--h-spring), opacity .15s; }
.btn:hover { background: var(--panel-2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .cost { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: radial-gradient(circle at 35% 30%, #FFE9A8, #E2A72E 60%, #A8740F); color: #3A2600; font-size: .78rem; font-weight: 800; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.shop { list-style: none; margin: -8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.slot { position: relative; }
.slot > button.item { width: 100%; height: 100%; min-height: 128px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 1px 2px rgba(20, 25, 60, .06); cursor: grab; padding: 8px 4px; transition: border-color .15s, transform .15s var(--h-spring); display: flex; flex-direction: column; align-items: center; gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.slot > button.item:hover { border-color: var(--accent); }
.slot > button.item:active { transform: scale(.97); }
.cell.full:hover { border-color: var(--accent); }
@media (hover: none) { .slot > button.item:hover, .cell.full:hover { border-color: var(--line); } }
.slot.sel > button.item { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.slot.frozen > button.item { background: linear-gradient(180deg, rgba(120, 190, 255, .22), transparent 60%), var(--panel); border-color: #7AB8FF; }
.slot.poor > button.item { opacity: .55; }
.slot.empty { border: 1.5px dashed var(--line); border-radius: 16px; min-height: 128px; opacity: .6; }
.slot.kind-o > button.item, .slot.kind-c > button.item { background: var(--panel-2); }
.slot canvas, .slot .glyph { width: 48px; height: 48px; display: block; pointer-events: none; }
.glyph svg { width: 48px; height: 48px; }
.slot .nm { font-size: .78rem; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; text-align: center; font-weight: 600; pointer-events: none; overflow-wrap: anywhere; hyphens: auto; }
.slot .tier { display: flex; gap: 2px; pointer-events: none; }
.slot .tier i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); display: block; }
.slot .price { position: absolute; top: 6px; left: 6px; pointer-events: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 800; color: #3A2600; background: radial-gradient(circle at 35% 30%, #FFE9A8, #E2A72E 60%, #A8740F); }
.slot .frz { position: absolute; top: -6px; right: -6px; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.slot .frz span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); }
.slot .frz svg { width: 15px; height: 15px; fill: none; stroke: #4A90D9; stroke-width: 2; stroke-linecap: round; }
.slot.frozen .frz span { background: #4A90D9; border-color: #4A90D9; }
.slot.frozen .frz svg { stroke: #fff; }
.glyph svg * { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.glyph svg .f1 { fill: #FF5C9A; } .glyph svg .f2 { fill: #2EC4B6; } .glyph svg .f3 { fill: #FFCE40; } .glyph svg .f4 { fill: #8B5CF6; }
.sellzone { border-radius: 14px; border: 2px dashed var(--them); color: var(--them); font-weight: 700; display: grid; place-items: center; min-height: 108px; grid-column: 1 / -1; }
.sellzone.over { background: var(--nope); }

/* tray */
.traywrap { position: relative; }
.tray { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 8px; aspect-ratio: 4 / 3; }
.cell { position: relative; min-width: 0; min-height: 0; border-radius: 16px; background: transparent; border: 1.5px dashed var(--cell-line); transition: background .15s, border-color .15s; display: grid; place-items: center; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding: 0; min-height: 44px; }
.cell.full { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 1px 2px rgba(20, 25, 60, .06); }
.cell.charm { background: var(--panel-2); }
.cell canvas { margin-bottom: 10%; pointer-events: none; max-width: 100%; max-height: 100%; }
.cell .glyph { width: 60%; height: 60%; pointer-events: none; }
.cell .glyph svg { width: 100%; height: 100%; }
.cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cell.can { background: var(--ok); border-color: var(--good); }
.cell.cant { background: var(--nope); }
.cell.over.can { box-shadow: 0 0 0 3px var(--good); }
.cell.over.cant { box-shadow: 0 0 0 3px var(--bad); }
.cell .ord { position: absolute; left: 7px; top: 5px; font-size: .75rem; font-weight: 700; color: var(--muted); pointer-events: none; }
.cell .shells { position: absolute; left: 6px; top: 20px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.cell .shells i { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); display: block; }
.cell .bst { position: absolute; left: 16px; top: 4px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; color: var(--gold); pointer-events: none; }
.cell .cnm { position: absolute; left: 6px; right: 6px; bottom: 5px; font-size: .72rem; line-height: 1.1; text-align: center; color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.pop canvas { animation: pop .45s var(--h-spring); }
@keyframes pop { 0% { transform: scale(.4) rotate(-20deg); } 60% { transform: scale(1.12); } }
.bonds { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.bonds line { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.bonds circle { fill: var(--panel); stroke: var(--accent); stroke-width: 1.6; }
.bonds text { font: 700 9px/1 var(--h-sans); fill: var(--accent); text-anchor: middle; dominant-baseline: central; }

/* trait badges: top right of a tray cell, under the name on a shop card; filled when the trait is on */
.tbs { position: absolute; right: 4px; top: 4px; display: flex; flex-direction: column; gap: 2px; }
.tbs.inl { position: static; flex-direction: row; justify-content: center; margin-top: 1px; }
.tb { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1.5px solid var(--tbc, var(--line)); box-sizing: border-box; }
.tb svg { width: 11px; height: 11px; }
.tb svg * { fill: none; stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tb svg .f1 { fill: #FF8FB8; } .tb svg .f2 { fill: #7FD8C9; } .tb svg .f3 { fill: #FFD873; } .tb svg .f4 { fill: #B79CF5; }
.tb.on { background: var(--tbc); }
.tb.on svg * { stroke: #fff; }
.tb:not(.on) { opacity: .8; }
.tb-plat { --tbc: #D9A21B; } .tb-arch { --tbc: #E0457F; } .tb-prism { --tbc: #1AA88E; } .tb-stell { --tbc: #F07A1A; }
.tb-chiral { --tbc: #8A5BE0; } .tb-poly4 { --tbc: #2E95D8; } .tb-comp { --tbc: #6B6F86; }
:root[data-theme="dark"] .tb-comp { --tbc: #C9CCDD; }
.slot .tbs { pointer-events: none; }
.cell .tbs { pointer-events: auto; }
/* traits */
.traits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 6px; }
.traits li { display: flex; }
.trait { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; color: var(--muted); }
.trait .ti { width: 30px; height: 30px; flex: none; }
.trait .ti svg { width: 30px; height: 30px; }
.trait .tt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.trait .tn { font-size: .86rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.trait .tn b { font-variant-numeric: tabular-nums; }
.trait small { font-size: .78rem; line-height: 1.25; color: var(--muted); }
.trait .pips { display: inline-flex; gap: 2px; }
.trait .pips i { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--muted); display: block; }
.trait .pips i.on { background: var(--gold); border-color: var(--gold); }
.trait.none { opacity: .55; }
.trait.lv1, .trait.lv2, .trait.lv3 { border-color: var(--gold); }
.trait.lv2 { background: linear-gradient(90deg, rgba(245, 196, 81, .16), transparent), var(--panel); }
.trait.lv3 { background: linear-gradient(90deg, rgba(245, 196, 81, .34), rgba(245, 196, 81, .06)), var(--panel); }
.card .chip.role { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.card ul li.on { color: var(--text); }
.trait.up { animation: bump .45s var(--h-spring); }

/* the info card */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; align-items: start; animation: hUp .25s var(--h-ease) both; }
.card .pic { grid-row: span 3; width: 64px; height: 64px; }
.card .pic canvas, .card .pic .glyph, .card .pic .glyph svg { width: 64px; height: 64px; }
.card .pic canvas.spin { cursor: grab; touch-action: none; }
.card .pic canvas.spin:active { cursor: grabbing; }
.card h3 { margin: 0; font: 700 1.15rem/1.15 var(--h-serif); }
.card .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.card .chip { font-size: .76rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.card .chip.on { border-color: var(--gold); color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: .88rem; grid-column: 1 / -1; }
.card p.ab { color: var(--text); }
.card p.ab b { color: var(--accent); }
.card p.el-poison b { color: #4F9E36; } .card p.el-fire b { color: #E0621A; } .card p.el-frost b { color: #3D8FD1; } .card p.el-storm b { color: #8A5BE0; }
.card p.el-spring b { color: #1E9E64; } .card p.el-gravity b { color: #5662C2; } .card p.el-ward b { color: #C98A12; }
.card dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 2px; }
.card dl div { background: var(--panel-2); border-radius: 10px; padding: 6px 4px; text-align: center; }
.card dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.card dd { margin: 0; font: 700 1.05rem/1.2 var(--h-serif); font-variant-numeric: tabular-nums; }
.card .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card ul { grid-column: 1 / -1; margin: 2px 0 0; padding-left: 18px; color: var(--muted); font-size: .85rem; }
.card ul b { color: var(--text); }
.go { margin-top: 2px; }
.go.wait { opacity: .6; }

/* arena */
.arena-wrap { position: relative; display: grid; gap: 8px; }
.vs { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; }
.vs .them { color: var(--them); } .vs .me { color: var(--me); }
#arena { width: 100%; height: auto; display: block; border-radius: 20px; background: var(--panel-2); touch-action: pan-y; }
.bctl { display: flex; gap: 8px; justify-content: center; }
.banner { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(300px, 86%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 16px; text-align: center; box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .5); display: grid; gap: 6px; animation: hPop2 .5s var(--h-spring) both; }
@keyframes hPop2 { from { opacity: 0; transform: translate(-50%, -42%) scale(.9); } }
.banner b { font: 700 2.2rem/1 var(--h-serif); }
.banner b.win { color: var(--good); } .banner b.loss { color: var(--bad); } .banner b.draw { color: var(--gold); }
.banner span { color: var(--muted); font-size: .9rem; }
.banner .hcta { margin-top: 6px; height: 48px; }

.abox { position: relative; }
.bctl .btn { min-width: 64px; justify-content: center; }
/* the battle log: below the arena on phones, beside it on wide screens */
.blog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 12px; }
.blog summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; gap: 6px; }
.blog summary small { color: var(--muted); font-weight: 600; }
.logbox { max-height: 232px; overflow-y: auto; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px); mask-image: linear-gradient(to bottom, transparent 0, #000 20px); padding-top: 12px; }
#log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lg { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: baseline; font-size: .84rem; line-height: 1.35; padding: 4px 8px; border-radius: 8px; border-left: 3px solid transparent; cursor: pointer; }
.lg { border-left: 0; } .lg.me { box-shadow: inset 3px 0 0 var(--me); } .lg.them { box-shadow: inset 3px 0 0 var(--them); }
.lg.key { background: var(--panel-2); font-weight: 600; }
.lg .li { text-align: center; color: var(--muted); }
.lg.me .li { color: var(--me); } .lg.them .li { color: var(--them); }
.lg .x { color: var(--gold); font-weight: 700; font-size: .72rem; }
.lg time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 3.2em; }
.recap { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.recap h3 { margin: 2px 0 4px; font: 700 1.05rem/1.2 var(--h-serif); }
.recap p { margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.rc { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.rc li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 8px; align-items: center; font-size: .78rem; cursor: pointer; }
.rc li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc li i { display: block; height: 7px; border-radius: 4px; background: var(--me); }
.rc li.them i { background: var(--them); }
.rc li b { font-variant-numeric: tabular-nums; }
@media (min-width: 980px) {
  .layout { max-width: 1060px; }
  .arena-wrap:not([hidden]) { display: grid; grid-template-columns: minmax(0, 600px) 320px; grid-template-areas: "vs vs" "box log" "ctl log"; gap: 8px 16px; justify-content: center; align-items: start; }
  .stage:has(.arena-wrap:not([hidden])) { max-width: 940px; }
  .arena-wrap .vs { grid-area: vs; } .arena-wrap .abox { grid-area: box; } .arena-wrap .bctl { grid-area: ctl; } .arena-wrap .blog { grid-area: log; }
  .arena-wrap .logbox { max-height: 520px; }
}

/* drag ghost */
.ghost-drag { position: fixed; left: 0; top: 0; width: 64px; height: 64px; pointer-events: none; z-index: 80; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
.ghost-drag canvas, .ghost-drag .glyph, .ghost-drag .glyph svg { width: 64px; height: 64px; }

/* end card */
.hsum .big small { font: 600 1.1rem/1 var(--h-sans); color: var(--muted); letter-spacing: 0; }
.sumteam { width: 100%; max-width: 320px; height: auto; display: block; margin: 10px auto 0; }
footer.foot { display: flex; justify-content: center; gap: 18px; padding: 26px 0 30px; font-size: .85rem; color: var(--muted); }
.ad-inline { margin-top: 16px; }

/* live matches */
.mp { display: grid; gap: 10px; max-width: 600px; margin: 0 auto; }
.mp-set { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; font-size: .88rem; color: var(--muted); }
.mp-set select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 8px; font: inherit; }
.mpstrip { display: flex; flex-wrap: wrap; gap: 6px; }
.mpp { min-height: 44px; transition: box-shadow .15s; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.mpp b { font-size: .82rem; color: var(--text); }
.mpp small { font-size: .7rem; color: var(--muted); }
.mpp.me { border-color: var(--me); }
.mpp.on { box-shadow: 0 0 0 2px var(--accent); }
.mpp.out { opacity: .5; }
.mpstrip .mini { flex-basis: 100%; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .82rem; }
.mpstrip .mini canvas, .mpstrip .mini .glyph, .mpstrip .mini .glyph svg { width: 30px; height: 30px; }
.mphp { position: relative; display: block; width: min(120px, 30vw); height: 18px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.mphp i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--them); display: block; }
.mphp b { position: relative; font: 700 .78rem/18px var(--h-sans); padding-left: 8px; }
.mpw { font-weight: 700; font-size: .82rem; margin-left: 6px; align-self: center; }
.hud b.hot { color: var(--bad); }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 22px; padding: 22px; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); background: var(--panel); color: var(--text); }
.dlg::backdrop { background: rgba(10, 12, 30, .5); }
.dlg h2 { font-family: var(--h-serif); font-weight: 700; margin: 0 0 10px; font-size: 1.6rem; }
.dlg p { color: var(--muted); }
.dlg p b { color: var(--text); }
.dlg > form:first-child { position: sticky; top: 0; height: 0; z-index: 3; }
.dlg .x { position: absolute; top: -16px; right: -14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel); font-size: 26px; cursor: pointer; color: var(--muted); touch-action: manipulation; }
.lede { font-style: italic; opacity: .82; line-height: 1.55; }
.more summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.traitlist { padding-left: 18px; color: var(--muted); font-size: .88rem; }
.traitlist b { color: var(--text); }
.hrep { text-align: center; }
.hlink { min-height: 40px; padding: 10px 8px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; background: var(--panel-2); border-radius: 12px; padding: 10px; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font: 700 1.4rem/1.2 var(--h-serif); font-variant-numeric: tabular-nums; }

@media (min-width: 900px) {
  .layout { max-width: 1040px; }
  .stage { grid-template-columns: minmax(0, 1fr); max-width: 600px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .coach, .card, .banner, .cell.pop canvas, .trait.up, .hcoins b.bump, .hud b.bump { animation: none; }
}

/* phones: the trait panel is one column of compact rows */
@media (max-width: 520px) { .traits { grid-template-columns: 1fr; gap: 6px; } .trait { min-height: 48px; padding: 6px 12px 6px 8px; } .trait .ti, .trait .ti svg { width: 26px; height: 26px; } }

/* footprints: a big piece spans its cells; the ghost shows where a dragged piece would go */
.cell.big canvas { margin-bottom: 6%; }
#foot { position: absolute; border-radius: 16px; pointer-events: none; border: 2px dashed var(--good); background: var(--ok); }
#foot.no { border-color: var(--bad); background: var(--nope); }
.slot .fp { display: grid; gap: 2px; margin-top: 2px; pointer-events: none; }
.slot .fp.f21 { grid-template-columns: repeat(2, 7px); } .slot .fp.f22 { grid-template-columns: repeat(2, 7px); }
.slot .fp i { width: 7px; height: 7px; border-radius: 2px; background: var(--muted); opacity: .6; display: block; }
.recipe { margin: -8px 0 0; font-size: .85rem; color: var(--muted); }
.recipe:empty { display: none; }
/* choosing between a compound and a fusion */
.card.choose { grid-template-columns: 1fr; }
.card .opts { display: grid; gap: 8px; }
.card .opt { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left; }
.card .opt:hover { border-color: var(--accent); }
.card .opt canvas { width: 56px; height: 56px; flex: none; }
.card .opt span { display: grid; gap: 2px; } .card .opt small { color: var(--muted); font-size: .8rem; }
/* the Atlas */
.atlas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.atlas li { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 12px; background: var(--panel-2); }
.atlas li canvas { width: 40px; height: 40px; flex: none; }
.atlas .op { color: var(--muted); font-weight: 700; }
.atlas .at { display: grid; gap: 1px; margin-left: 6px; min-width: 0; }
.atlas .at b { font-size: .9rem; } .atlas .at small { color: var(--muted); font-size: .76rem; } .atlas .at .ln { font-style: italic; }
.atlas li:not(.found) .at b { color: var(--muted); }
