:root {
  --bg:        #0f0e0c;
  --bg-2:      #17150f;
  --panel:     #1b1813;
  --panel-2:   #221e18;
  --panel-3:   #2a251d;
  --line:      #322c22;
  --line-soft: #262119;

  --ink:       #f2ece0;
  --ink-2:     #c3b8a4;
  --muted:     #8d8272;
  --faint:     #5f5749;

  --gold:      #ddb75d;
  --gold-hi:   #f0d38e;
  --gold-dim:  #6b5827;

  --good:      #6cc48a;
  --good-dim:  #1e3a2a;
  --warn:      #d8a24a;
  --bad:       #d76f5c;
  --bad-dim:   #3a221d;
  --solo:      #ddb75d;
  --split:     #6b9dc4;

  --r:  10px;
  --r-lg: 14px;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 50% -10%, #211d15 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad  { color: var(--bad); }
h1, h2, h3 { letter-spacing: -0.015em; }

/* ═════════════════════════════════════════════════ login */

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 40px 34px;
  width: min(370px, 100%); text-align: center; box-shadow: var(--shadow);
}
.login h1 { margin: 0; font-size: 27px; }
.login .sub { margin: 5px 0 26px; color: var(--muted); font-size: 13px; }
.login input, .login button {
  width: 100%; padding: 12px 14px; border-radius: 9px; font-size: 15px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.login input:focus { outline: 2px solid var(--gold-dim); outline-offset: 1px; }
.login button {
  margin-top: 12px; background: var(--gold); color: #231c09;
  font-weight: 650; border: 0; cursor: pointer;
}
.login button:hover { background: var(--gold-hi); }
.login .err { color: var(--bad); font-size: 13px; margin: 14px 0 0; }

/* ═════════════════════════════════════════════════ chrome */

header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: rgba(15,14,12,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 22px; height: 22px; color: var(--gold); }
.name { font-size: 16px; font-weight: 620; letter-spacing: -0.01em; }

.tag {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel-2);
}
.tag.armed { color: var(--good); border-color: #2c5039; background: var(--good-dim); }
.tag.dry   { color: var(--gold); border-color: var(--gold-dim); background: #241d0d; }

.head-right { display: flex; align-items: center; gap: 20px; }
.wallet {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.25; cursor: pointer;
}
.wallet .label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.wallet .mono { font-size: 11px; color: var(--muted); }
.wallet strong { font-size: 14px; font-variant-numeric: tabular-nums; }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 40px; height: 23px; border-radius: 999px;
  background: var(--panel-3); border: 1px solid var(--line);
  position: relative; transition: background .18s, border-color .18s;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--muted); transition: transform .18s, background .18s;
}
.switch input:checked + .track { background: var(--good-dim); border-color: #2c5039; }
.switch input:checked + .track .knob { transform: translateX(17px); background: var(--good); }
.switch-label { font-size: 13px; color: var(--ink-2); }

main { max-width: 1560px; margin: 0 auto; padding: 20px 26px 64px; display: grid; gap: 16px; }

/* Board left, controls right — the shape ore.com uses, and the reason the
   page no longer strands half the viewport. */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}
.sidebar { display: grid; gap: 16px; position: sticky; top: 74px; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) { .sidebar { grid-template-columns: 1fr; } }

.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,0) 120px),
    linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 55%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow);
  position: relative;
}
/* a one-pixel lit edge along the top, which is what stops a dark panel
   reading as a flat rectangle */
.panel::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09) 22%, rgba(255,255,255,.09) 78%, transparent);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 620; }
.panel-sub { margin: 6px 0 16px; font-size: 13px; color: var(--muted); max-width: 68ch; }
.panel-sub.tight { margin-bottom: 10px; }
.panel-sub em { color: var(--ink-2); font-style: italic; }
.panel-sub code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--gold); }

/* ═════════════════════════════════════════════════ verdict */

.verdict-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 26px; border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(255,255,255,.05), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.verdict-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--muted); transition: background .3s;
}
.verdict-card.go::before   { background: var(--good); }
.verdict-card.pass::before { background: var(--faint); }
.verdict-card.idle::before { background: var(--gold-dim); }

.verdict-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.verdict-icon {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--panel-3); border: 1px solid var(--line);
}
.verdict-card.go .verdict-icon { background: var(--good-dim); border-color: #2c5039; }
.verdict-text h2 { margin: 0 0 3px; font-size: 19px; font-weight: 620; }
.verdict-text p  { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.verdict-text .num { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

.verdict-clock { position: relative; flex: none; width: 92px; text-align: center; }
.ring { width: 80px; height: 80px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-bg { stroke: var(--panel-3); }
.ring-fg {
  stroke: var(--gold);
  stroke-dasharray: 213.6; stroke-dashoffset: 213.6;
  transition: stroke-dashoffset .5s linear, stroke .3s;
}
.ring-fg.hot { stroke: var(--good); }
.ring-inner {
  position: absolute; inset: 0 0 auto 0; height: 80px;
  display: grid; place-content: center; gap: 0;
}
.ring-num { font-size: 22px; font-weight: 640; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-unit { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ring-caption { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ═════════════════════════════════════════════════ layout */

.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ═════════════════════════════════════════════════ board */

.board-key { display: flex; gap: 12px; flex-wrap: wrap; }
.board-key .k { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.chip { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chip.above { background: var(--good); }
.chip.pos   { background: var(--warn); }
.chip.neg   { background: var(--bad); }
.chip.excl  { background: var(--panel-3); border: 1px solid var(--line); }

.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

.tile {
  position: relative; aspect-ratio: 1 / .78; border-radius: 10px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 9px 11px 10px;
  display: grid;
  grid-template-areas: 'idx solo' 'mine mine' 'total miners';
  grid-template-rows: auto 1fr auto;
  align-items: center;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer; overflow: hidden;
  transition: transform .12s ease, border-color .2s, box-shadow .25s, background .3s;
}
.tile:hover { transform: translateY(-1px); border-color: var(--faint); }

.t-idx {
  grid-area: idx; font-size: 10.5px; color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.t-solo { grid-area: solo; justify-self: end; font-size: 10px; color: transparent; }
.tile.is-solo .t-solo { color: var(--solo); }

.t-mine {
  grid-area: mine; align-self: center; font-size: 13px; font-weight: 620;
  color: var(--good); font-variant-numeric: tabular-nums; min-height: 1em;
}
.t-total {
  grid-area: total; font-size: 17px; font-weight: 620; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.t-miners {
  grid-area: miners; justify-self: end; font-size: 10px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* the pool we would mine — a lit outline, not a fill, so the numbers stay readable */
.tile.in-pool {
  border-color: var(--gold-dim);
  box-shadow: inset 0 0 0 1px rgba(221,183,93,.28), 0 0 18px -8px rgba(221,183,93,.5);
  background:
    linear-gradient(180deg, rgba(221,183,93,.09), rgba(221,183,93,.02) 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.tile.in-pool .t-total { color: var(--ink); }

.tile.ours { border-color: #2c5039; box-shadow: inset 0 0 0 1px rgba(108,196,138,.35); }
.tile.off { opacity: .34; }
.tile.off .t-total { text-decoration: line-through; }

/* the settled winner, held through the intermission */
.tile.winner {
  border-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(221,183,93,.26), rgba(221,183,93,.06) 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 0 0 1px var(--gold), 0 0 34px -6px rgba(221,183,93,.55);
  animation: winner-in .45s ease-out;
  z-index: 1;
}
.tile.winner .t-total { color: var(--gold-hi); }
@keyframes winner-in {
  0%   { transform: scale(.94); box-shadow: 0 0 0 0 rgba(221,183,93,0); }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.t-flag {
  position: absolute; inset: auto 0 0 0; text-align: center;
  font-size: 8.5px; font-weight: 800; letter-spacing: .14em;
  color: #231c09; background: var(--gold);
  padding: 1.5px 0; opacity: 0; transition: opacity .25s;
}
.tile.winner .t-flag { opacity: 1; }

.board-hint {
  margin: 13px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.board-hint b { color: var(--ink-2); }
.board-hint b.gold { color: var(--gold); }

.board-foot {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px;
  font-size: 11.5px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot.solo { background: var(--solo); }
.dot.split { background: var(--split); }
.dot.ours { background: var(--good); }

/* ═════════════════════════════════════════════════ why */

.why-rows { display: grid; gap: 1px; background: var(--line-soft); border-radius: 9px; overflow: hidden; margin-top: 10px; }
.why-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 12px; font-size: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--panel-2);
}
.why-row .k { color: var(--muted); }
.why-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.why-row.accent { background: var(--panel-3); }
.why-row.accent .v { color: var(--gold); }
.why-row .v.good { color: var(--good); }
.why-row .v.bad  { color: var(--bad); }

.why-note {
  margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  border-left: 2px solid var(--line); padding-left: 11px;
}
.why-note b { color: var(--ink-2); font-weight: 600; }

/* ═════════════════════════════════════════════════ rotation */

.rotate-strips { display: grid; gap: 8px; margin-top: 4px; }
.strip-row { display: flex; align-items: center; gap: 12px; }
.strip-label { font-size: 11px; color: var(--muted); width: 108px; flex: none; }
.strip-label b { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.strip { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; flex: 1; min-width: 0; }
.strip i {
  height: 20px; border-radius: 3px; background: var(--panel-3);
  display: grid; place-items: center; font-size: 8px; font-style: normal; color: var(--faint);
}
.strip i.solo { background: #3a2f13; color: var(--solo); }
.strip-row.next .strip i { opacity: .6; height: 14px; }
.rotate-fact { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.rotate-fact b { color: var(--gold); }

/* ═════════════════════════════════════════════════ params */

.param-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-top: 12px;
}
@media (max-width: 1180px) and (min-width: 781px) { .param-grid { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .param-grid { grid-template-columns: 1fr; } }
.param label { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 6px; }
.param .hint { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.param .hint.warn { color: var(--warn); }
.live-hint { color: var(--ink-2); }

input, select {
  width: 100%; padding: 9px 11px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus { outline: 2px solid var(--gold-dim); outline-offset: 1px; border-color: var(--gold-dim); }
.with-unit { position: relative; display: flex; align-items: center; }
.with-unit input { padding-right: 46px; }
.with-unit span { position: absolute; right: 11px; font-size: 12px; color: var(--muted); pointer-events: none; }
#fixed-wrap.off { opacity: .35; pointer-events: none; }

.tiles-advanced { margin-top: 20px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.tiles-advanced summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.tiles-advanced summary::marker { color: var(--faint); }
.tiles-advanced .count { color: var(--faint); font-size: 11px; margin-left: 6px; }
.tile-picker { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; max-width: 540px; margin-top: 10px; }
.tile-picker button {
  padding: 6px 0; font-size: 11px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tile-picker button.on { background: var(--gold); color: #231c09; border-color: var(--gold); font-weight: 650; }
.tile-actions { display: flex; gap: 8px; margin-top: 9px; }
.tile-actions button, .actions button {
  padding: 8px 14px; font-size: 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.tile-actions button:hover, .actions button:hover { background: var(--panel-3); }
.unsaved {
  margin: 18px 0 0; padding: 9px 12px; border-radius: 8px;
  background: #2a2210; border: 1px solid var(--gold-dim);
  color: var(--gold); font-size: 12.5px;
}
.actions .primary.pending { animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(221,183,93,0); } 50% { box-shadow: 0 0 0 4px rgba(221,183,93,.18); } }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.actions .primary { background: var(--gold); color: #231c09; border: 0; font-weight: 650; padding: 9px 18px; }
.actions .primary:hover { background: var(--gold-hi); }
.saved { color: var(--good); font-size: 12px; }

/* ═════════════════════════════════════════════════ stats & tables */

.stat-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.stat {
  flex: 1 1 130px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 70%), var(--panel-2);
}
.stat label { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { font-size: 17px; font-weight: 620; font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
td { font-variant-numeric: tabular-nums; }
td.note { white-space: normal; color: var(--muted); font-size: 11.5px; max-width: 250px; }
.pill { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.pill.go { background: var(--good-dim); color: var(--good); }
.pill.no { background: var(--panel-3); color: var(--muted); }

.log { max-height: 290px; overflow-y: auto; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; margin-top: 10px; }
.log .line { padding: 4px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.log .ts { color: var(--faint); margin-right: 10px; }
.log .warn { color: var(--warn); }
.log .error { color: var(--bad); }

@media (max-width: 640px) {
  main { padding: 14px; }
  .verdict-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .tile-picker { grid-template-columns: repeat(7, 1fr); }
  .strip-label { width: 80px; }
  .strip i { font-size: 0; }
}

/* ═════════════════════════════════════════════════ pools */

.pools { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0 6px; }
.pool {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 70%),
    var(--panel-2);
  position: relative;
}
.pool.chosen { border-color: var(--gold-dim); background: linear-gradient(180deg, #241d0d, var(--panel-2)); }
.pool.chosen::after {
  content: 'chosen'; position: absolute; top: 9px; right: 10px;
  font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.pool-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 9px; }
.pool-name { font-size: 12.5px; font-weight: 650; text-transform: capitalize; }
.pool-tiles { font-size: 10.5px; color: var(--muted); }
.pool-cost {
  font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em; line-height: 1.1;
}
.pool-cost span { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 5px; letter-spacing: 0; }
.pool-margin { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pool-crowd { font-size: 10.5px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }

.sub-head {
  margin: 18px 0 0; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}

.tile .crowd-amt {
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tile.is-solo  .crowd-amt { color: var(--solo); }
.tile.is-split .crowd-amt { color: var(--split); }
.tile.picked { border-color: var(--gold); }
.tile.picked::after { content: none; }

.chip.solo  { background: var(--solo); }
.chip.split { background: var(--split); }
.chip.mine  { background: transparent; border: 2px solid var(--gold); }

@media (max-width: 560px) { .pools { grid-template-columns: 1fr; } }

.excl-note { margin-top: 10px; color: var(--warn); }
