/* Overlordy. A night-shift control room: deep plum black, quiet panels, numbers in mono,
   one violet accent, green for who is here now, yellow for who came by today. */
:root {
  --bg: #0e0b13; --bg-2: #120f19; --panel: #16131e; --panel-2: #1c1826; --panel-3: #241f31;
  --line: rgba(236, 228, 255, .07); --line-2: rgba(236, 228, 255, .13);
  --ink: #f2eef9; --ink-2: #bdb5cc; --ink-3: #847c95; --ink-4: #5d566c;
  --accent: #b692ff; --accent-2: #8b5cf6; --maroon: #4a1340;
  --live: #3ee08f; --recent: #ffd257; --up: #3ee08f; --down: #ff6b81;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --brand: "Unbounded", "Geist", sans-serif;
  --r: 18px; --side: 264px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100svh; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wordmark { font: 700 15px/1 var(--brand); letter-spacing: .14em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: linear-gradient(180deg, #c3a5ff, #9466f5); border-color: transparent; color: #160a2b; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { height: 48px; font-size: 15.5px; border-radius: 13px; }
.btn.danger { color: var(--down); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; color: var(--ink-2); transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--ink); background: var(--panel-2); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.off { color: var(--ink-4); }
.f { display: grid; gap: 7px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.f input, .f select, .inp { height: 46px; width: 100%; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--ink); font: 500 15px var(--sans); transition: border-color .2s, background .2s; }
.f input:focus, .f select:focus, .inp:focus { outline: none; border-color: var(--accent); background: rgba(182, 146, 255, .06); }
select.inp, .f select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ---------- landing ---------- */
.landing { position: fixed; inset: 0; overflow: auto; background: radial-gradient(90% 70% at 30% 30%, #24133a 0%, var(--bg) 60%); }
.l-dots { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .55; }
.l-inner { position: relative; min-height: 100svh; max-width: 1180px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px; }
@media (max-width: 880px) { .l-inner { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; } }
.l-hero { display: grid; justify-items: start; }
@media (max-width: 880px) { .l-hero { justify-items: center; text-align: center; } }
.l-mascot { width: clamp(200px, 30vw, 340px); aspect-ratio: 240 / 250; animation: mIn 1.1s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes mIn { from { opacity: 0; transform: translateY(-60px) scale(.8); } }
.l-brand { display: flex; align-items: center; gap: 14px; margin-top: 8px; animation: fadeUp .8s .35s both; }
.l-logo { width: 44px; height: 44px; filter: drop-shadow(0 8px 20px rgba(120, 30, 110, .5)); }
.l-brand .wordmark { font-size: clamp(30px, 4.6vw, 54px); letter-spacing: .1em; background: linear-gradient(180deg, #fff, #cdb6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-tag { margin: 18px 0 0; color: var(--ink-2); font-size: clamp(16px, 1.6vw, 19px); max-width: 32ch; animation: fadeUp .8s .5s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.l-card { width: 100%; max-width: 420px; justify-self: end; display: grid; gap: 16px; padding: 32px; border-radius: 24px; background: rgba(22, 19, 30, .72); border: 1px solid var(--line-2); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .05); animation: fadeUp .8s .6s both; }
@media (max-width: 880px) { .l-card { justify-self: center; } }
.l-card h1 { margin: 0; font: 700 26px/1.1 var(--sans); letter-spacing: -.02em; }
.l-sub { margin: -8px 0 4px; color: var(--ink-3); }
.l-err { margin: 0; min-height: 20px; color: var(--down); font-size: 14px; }
.l-card .btn { width: 100%; }

/* ---------- mascot ---------- */
.mascot { width: 100%; height: 100%; overflow: visible; }
.m-float { animation: hover 4.2s ease-in-out infinite; transform-origin: 120px 120px; }
@keyframes hover { 0%, 100% { transform: translateY(-6px) rotate(-1.5deg); } 50% { transform: translateY(8px) rotate(1.5deg); } }
.m-shadow { animation: shadow 4.2s ease-in-out infinite; transform-origin: 120px 236px; }
@keyframes shadow { 0%, 100% { transform: scale(.82); opacity: .22; } 50% { transform: scale(1); opacity: .38; } }
.m-tents path { transform-box: fill-box; transform-origin: 50% 0; animation: tent 2.6s ease-in-out infinite; }
.m-tents .t2 { animation-delay: -.6s; } .m-tents .t3 { animation-delay: -1.2s; } .m-tents .t4 { animation-delay: -1.8s; }
@keyframes tent { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.m-eye { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 5.5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.m-pupil { transition: transform .25s ease-out; }
.m-buds circle { animation: bud 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bud { 50% { filter: brightness(1.25); transform: scale(1.08); } }
.mascot.happy .m-mouth { d: path("M106 146q14 16 28 0"); }
@media (prefers-reduced-motion: reduce) { .m-float, .m-shadow, .m-tents path, .m-buds circle { animation: none; } }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
.s-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; text-decoration: none; }
.s-brand svg { width: 32px; height: 32px; }
.s-main a, .s-foot > a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; transition: background .2s, color .2s; }
.s-main a svg, .s-foot > a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.s-main a:hover, .s-foot > a:hover { background: var(--panel); color: var(--ink); }
.s-main a.on, .s-foot > a.on { background: var(--panel-2); color: var(--ink); }
.s-label { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 10px 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.s-hint { font-weight: 400; color: var(--ink-4); }
.s-sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.s-site { position: relative; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 10px; border-radius: 11px; cursor: pointer; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; user-select: none; }
.s-site:hover { background: var(--panel); color: var(--ink); }
.s-site.on { background: var(--panel-2); color: var(--ink); }
.s-site .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.s-site .nm { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.s-site .nm b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-site .nm small { color: var(--ink-4); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-site .lv { font: 600 12px var(--mono); color: var(--live); display: flex; align-items: center; gap: 5px; }
.s-site .lv i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.8s ease-out infinite; }
.s-site .lv.zero { color: var(--ink-4); } .s-site .lv.zero i { background: var(--ink-4); animation: none; }
.s-site .grip { width: 16px; height: 16px; color: var(--ink-4); opacity: 0; transition: opacity .2s; cursor: grab; fill: currentColor; }
.s-site:hover .grip { opacity: 1; }
.s-site.sortable-ghost { opacity: .35; }
.s-site.sortable-chosen { background: var(--panel-3); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); }
.s-add { color: var(--ink-3); font-size: 13.5px; }
.s-add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.s-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 14px; }
.s-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel); font-size: 13px; color: var(--ink-2); }
.s-me .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #6c2b8f, #3a0f35); font-weight: 700; color: #f1ddff; }
.s-me .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-me button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; display: grid; }
.s-me button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 clamp(16px, 3vw, 36px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.t-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.t-title h1 { margin: 0; font: 700 20px/1.1 var(--sans); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-title .dom { color: var(--ink-3); font-size: 13.5px; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.t-title .dom svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.t-actions { display: flex; align-items: center; gap: 10px; }
.live-chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(62, 224, 143, .08); border: 1px solid rgba(62, 224, 143, .22); color: var(--live); font-size: 13px; }
.live-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.8s ease-out infinite; }
.live-chip b { font: 600 15px var(--mono); }
.live-chip span { color: color-mix(in srgb, var(--live) 70%, var(--ink-2)); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(62, 224, 143, .6); } 100% { box-shadow: 0 0 0 9px rgba(62, 224, 143, 0); } }
.only-m { display: none; }
.view { padding: clamp(18px, 3vw, 36px); display: grid; gap: clamp(16px, 2vw, 22px); max-width: 1500px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); box-shadow: 30px 0 80px rgba(0, 0, 0, .6); }
  .app.menu .side { transform: none; }
  .only-m { display: inline-grid; }
  .live-chip span { display: none; }
  .s-site .grip { opacity: 1; }
}

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2vw, 22px); min-width: 0; position: relative; }
.panel h2, .panel h3 { margin: 0; font: 600 15px/1.3 var(--sans); color: var(--ink); letter-spacing: -.005em; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.p-head .sub { color: var(--ink-3); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: inherit; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 22px); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 22px); }
@media (max-width: 1200px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid3, .grid2 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: clamp(12px, 1.6vw, 18px); }
.kpi { padding: 18px 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 6px; min-width: 0; }
.kpi .lab { color: var(--ink-3); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi .val { font: 600 clamp(26px, 2.6vw, 34px)/1.05 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .chg { font: 500 12.5px var(--mono); color: var(--ink-3); }
.kpi .chg.up { color: var(--up); } .kpi .chg.down { color: var(--down); }
.kpi.live .val { color: var(--live); }
.kpi.live .lab i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.8s ease-out infinite; }
.kpi.flash .val { animation: flash .9s ease-out; }
@keyframes flash { 0% { color: #fff; text-shadow: 0 0 18px var(--accent); } }

/* Range tabs, like an exchange chart */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.tabs button { border: 0; background: none; height: 30px; min-width: 40px; padding: 0 10px; border-radius: 8px; color: var(--ink-3); font: 600 12.5px var(--mono); cursor: pointer; transition: background .2s, color .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--panel-3); color: var(--ink); }
.seg-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.seg-tabs a { padding: 12px 4px; margin-right: 18px; text-decoration: none; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s, border-color .2s; }
.seg-tabs a:hover { color: var(--ink); }
.seg-tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Chart */
.chart { position: relative; height: 300px; touch-action: pan-y; }
.chart.sm { height: 180px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-4); font: 500 11px var(--mono); }
.chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; pointer-events: none; padding: 9px 12px; border-radius: 10px; background: rgba(28, 24, 38, .96); border: 1px solid var(--line-2); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); opacity: 0; transition: opacity .15s; }
.chart .tip b { display: block; font: 600 15px var(--mono); }
.chart .tip span { color: var(--ink-3); }
.chart.hovering .tip { opacity: 1; }
.c-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.c-big { display: grid; gap: 4px; }
.c-big .val { font: 600 clamp(30px, 3.4vw, 44px)/1 var(--mono); letter-spacing: -.035em; }
.c-big .chg { font: 600 14px var(--mono); }
.c-big .chg.up { color: var(--up); } .c-big .chg.down { color: var(--down); }
.c-ctl { display: flex; gap: 10px; flex-wrap: wrap; }

/* Lists */
.rows { display: grid; gap: 2px; }
.row { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 14px; overflow: hidden; }
.row .bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 9px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.row .k { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.row .n { position: relative; font: 500 13px var(--mono); color: var(--ink-2); }
.empty-note { color: var(--ink-3); font-size: 14px; padding: 18px 4px; }

/* Site cards on Command */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 1.8vw, 20px); }
.scard { display: grid; gap: 14px; padding: 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .25s, transform .25s, background .25s; position: relative; overflow: hidden; }
.scard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--c); opacity: .9; }
.scard:hover { border-color: var(--line-2); transform: translateY(-2px); background: var(--panel-2); }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-top b { font-size: 16px; font-weight: 650; }
.sc-top small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.sc-live { display: flex; align-items: center; gap: 6px; font: 600 13px var(--mono); color: var(--live); }
.sc-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.8s ease-out infinite; }
.sc-live.zero { color: var(--ink-4); } .sc-live.zero i { background: var(--ink-4); animation: none; }
.sc-nums { display: flex; gap: 22px; }
.sc-nums div { display: grid; gap: 2px; }
.sc-nums b { font: 600 22px var(--mono); letter-spacing: -.02em; }
.sc-nums span { font-size: 12px; color: var(--ink-3); }
.sc-spark { height: 46px; }
.sc-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* Map */
.map { position: relative; width: 100%; aspect-ratio: 240 / 94.67; border-radius: 14px; overflow: hidden; background: radial-gradient(100% 120% at 50% 0%, #1a1424, #110e18); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .land { fill: none; stroke: #3b3450; stroke-width: .55; stroke-linecap: round; }
.map .pin { position: absolute; width: 0; height: 0; }
.map .pin i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--recent); box-shadow: 0 0 8px 1px rgba(255, 210, 87, .55); opacity: var(--o, .85); }
.map .pin.live i { left: -4px; top: -4px; width: 8px; height: 8px; background: var(--live); box-shadow: 0 0 12px 2px rgba(62, 224, 143, .7); opacity: 1; }
.map .pin.live::after { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--live); animation: ring 2.2s ease-out infinite; }
.map .pin.new::before { content: ""; position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--live); animation: arrive 1.6s ease-out forwards; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
@keyframes arrive { from { transform: scale(.1); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.map .tipm { position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: rgba(28, 24, 38, .95); border: 1px solid var(--line-2); font-size: 12px; transform: translate(-50%, -140%); white-space: nowrap; }
.map-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.map-legend .g { background: var(--live); box-shadow: 0 0 8px var(--live); } .map-legend .y { background: var(--recent); box-shadow: 0 0 8px var(--recent); }
.mapfull { position: fixed; inset: 0; z-index: 80; background: #0b0910; display: grid; grid-template-rows: auto 1fr; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.mf-bar { display: flex; align-items: center; gap: 16px; padding: 16px clamp(16px, 3vw, 32px); flex-wrap: wrap; }
.mf-bar h2 { margin: 0; font: 700 20px var(--sans); flex: 1; }
.mf-stats { display: flex; gap: 22px; }
.mf-stats div { display: grid; }
.mf-stats b { font: 600 22px var(--mono); }
.mf-stats span { font-size: 12px; color: var(--ink-3); }
.mf-body { position: relative; display: grid; place-items: center; padding: 0 clamp(8px, 2vw, 24px) 24px; min-height: 0; }
.mf-body .map { width: min(100%, calc((100svh - 120px) * 2.535)); background: none; }

/* Activity feed */
.feed { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; scrollbar-width: thin; }
.fi { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; font-size: 13.5px; animation: feedIn .5s cubic-bezier(.2, .8, .2, 1); }
.fi:hover { background: var(--panel-2); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); background: rgba(182, 146, 255, .12); } }
.fi .d { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.fi .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.fi .t b { color: var(--ink); font-weight: 600; }
.fi time { font: 500 11.5px var(--mono); color: var(--ink-4); }

/* Tables: live poker tables, events */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); }
.tbl tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--ink-2); }
.badge.live { background: rgba(62, 224, 143, .12); color: var(--live); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

/* Setup help */
.code { position: relative; display: block; padding: 14px 52px 14px 16px; border-radius: 12px; background: #0b0910; border: 1px solid var(--line); font: 500 13px/1.6 var(--mono); color: #d8c8ff; white-space: pre-wrap; word-break: break-all; }
.code button { position: absolute; top: 8px; right: 8px; }
.connect { display: grid; gap: 12px; padding: 22px; border-radius: var(--r); border: 1px dashed var(--line-2); background: rgba(182, 146, 255, .04); }
.connect h3 { margin: 0; font-size: 16px; }
.connect p { margin: 0; color: var(--ink-2); }

/* Settings */
.set-sec { display: grid; gap: 14px; }
.set-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.set-row b { display: block; font-weight: 600; }
.set-row small { color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.color-in { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: none; padding: 4px; cursor: pointer; }
.acc-grid { display: grid; gap: 8px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); }
.acc-row select { height: 36px; width: 140px; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); cursor: pointer; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background .25s; }
.switch.on { background: color-mix(in srgb, var(--accent-2) 70%, transparent); }
.switch.on::after { transform: translateX(18px); background: #fff; }

/* Toasts, milestones, confetti */
.toasts { position: fixed; z-index: 90; top: 82px; right: clamp(12px, 3vw, 28px); display: grid; gap: 10px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(28, 24, 38, .96); border: 1px solid var(--line-2); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7); animation: toastIn .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.toast.out { animation: toastOut .35s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast .tm { width: 54px; height: 56px; }
.toast b { display: block; font-size: 15px; }
.toast span { color: var(--ink-2); font-size: 13.5px; }
.toast.big { border-color: color-mix(in srgb, var(--recent) 50%, transparent); box-shadow: 0 0 0 1px rgba(255, 210, 87, .2), 0 30px 60px -16px rgba(0, 0, 0, .8), 0 0 60px -10px rgba(255, 210, 87, .35); }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; width: 100%; height: 100%; }

.loading { color: var(--ink-3); padding: 30px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font: 700 clamp(24px, 2.6vw, 32px)/1.1 var(--sans); letter-spacing: -.025em; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); }
.flag { font-size: 15px; margin-right: 2px; }

/* Feedback */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-2); color: #fff; font: 600 11.5px/20px var(--mono); text-align: center; font-style: normal; }
.fb-list { display: grid; gap: 10px; }
.fb { display: grid; gap: 8px; padding: 16px 18px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.fb.new { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.fb p { margin: 0; white-space: pre-wrap; color: var(--ink); font-size: 15px; line-height: 1.55; }
.fb .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.fb .meta a { color: var(--accent); text-decoration: none; }
.fb .meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--panel-3); color: var(--ink-2); }
.status-pill.ok { background: rgba(62, 224, 143, .12); color: var(--live); }
