/* Hazzie Brain — "business tycoon" look: deep ink, brass gold, ivory text. */
:root {
  --ink: #0d0f13;
  --panel: #151920;
  --panel-2: #1b2029;
  --line: #2a303b;
  --ivory: #ece6d6;
  --muted: #9a9384;
  --gold: #fcb800;          /* Hazzie logo yellow */
  --gold-soft: rgba(252, 184, 0, 0.13);
  --green: #6fbf8a;
  --red: #e07a5f;
  --amber: #e0b25f;
  /* One font family everywhere: the system's own UI font (Segoe UI on Windows,
     San Francisco on Mac). Nothing to download, always crisp. */
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #1a1f29 0%, var(--ink) 60%) fixed;
  color: var(--ivory); font: 15px/1.5 var(--sans);
}
h2 { font: 600 16px/1.25 var(--display); letter-spacing: 0.01em; margin: 0; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--gold); }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.mark { width: 46px; height: 46px; display: block; border-radius: 10px; background: #000; border: 1px solid var(--line); }
.wordmark { font: 700 17px var(--display); letter-spacing: 0.24em; color: var(--ivory); }
.sub { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.dateblock { text-align: right; }
.label { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.day { font: 600 17px var(--display); }
.clock { font-size: 12px; color: var(--muted); }

/* Sync bar */
.syncbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 28px 0; font-size: 12.5px; color: var(--muted); }
.sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sync b { color: var(--ivory); font-weight: 600; }
.sep { width: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--green); }
.dot.off { background: var(--muted); }
.dot.bad { background: var(--red); }
.lanbox .ghost { margin-left: 8px; }

/* Layout */
.grid { display: grid; gap: 18px; padding: 16px 28px 22px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.donext { grid-column: 1; grid-row: 1; }
.side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 18px; }
.team { grid-column: 1; grid-row: 2; }
.rules { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; padding: 14px 16px; }
  .donext, .side, .team, .rules { grid-column: 1; grid-row: auto; }
  .top, .syncbar { padding-left: 16px; padding-right: 16px; }
}

.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--muted); }
.pill { font-size: 12px; color: var(--gold); background: var(--gold-soft); padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.badge { display: inline-block; font: 700 10px var(--sans); letter-spacing: 0.08em; color: var(--ink); background: var(--muted); border-radius: 4px; padding: 1px 6px; vertical-align: 2px; margin-left: 4px; }

/* Do This Next */
.ranklist { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.ranklist li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.ranklist li:first-child { border-top: 0; }
.ranklist li::before { content: counter(r); font: 600 15px var(--display); font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; padding-top: 2px; }
.ranklist li:nth-child(-n+3)::before { color: var(--gold); }
.ranklist .title { font-weight: 600; }
.ranklist .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ranklist .who { font-size: 12px; color: var(--ivory); opacity: 0.75; margin-top: 2px; }
.kind { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 8px; vertical-align: 1px; }
.k-lead, .k-money { color: var(--gold); border-color: rgba(252,184,0,.4); }
.k-job { color: var(--amber); }
.score { position: relative; font: 600 13px var(--sans); font-variant-numeric: tabular-nums; color: var(--gold); background: var(--gold-soft); border-radius: 6px; padding: 2px 8px; min-width: 38px; text-align: center; white-space: nowrap; cursor: help; }
.score:hover::after, .score:focus::after {
  content: attr(data-tip); position: absolute; right: 0; top: 24px; z-index: 5; width: max-content; max-width: 280px;
  background: var(--ink); border: 1px solid var(--gold); color: var(--ivory); border-radius: 8px;
  padding: 8px 10px; font: 12px/1.4 var(--sans); white-space: normal; text-align: left;
}

/* Action buttons */
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.act {
  background: transparent; border: 1px solid var(--line); color: var(--ivory); border-radius: 7px;
  font: 500 12.5px var(--sans); padding: 4px 10px; cursor: pointer; white-space: nowrap; list-style: none;
}
.act:hover { border-color: var(--gold); color: var(--gold); }
.act.primary { background: var(--gold); border-color: var(--gold); color: #111; font-weight: 600; }
.act.primary:hover { filter: brightness(1.08); color: #111; }
.snooze { position: relative; }
.snooze summary::-webkit-details-marker { display: none; }
.snooze .menu {
  position: absolute; z-index: 6; top: 30px; left: 0; display: flex; flex-direction: column; min-width: 160px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.snooze .menu button { background: none; border: 0; color: var(--ivory); text-align: left; padding: 7px 10px; border-radius: 6px; font: 13px var(--sans); cursor: pointer; }
.snooze .menu button:hover { background: var(--gold-soft); color: var(--gold); }
.donetoday { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.donetoday summary { cursor: pointer; font: 600 13px var(--sans); color: var(--muted); display: flex; gap: 8px; align-items: center; list-style: none; }
.donetoday summary::-webkit-details-marker { display: none; }
.donetoday summary::before { content: '▸'; color: var(--gold); }
.donetoday[open] summary::before { content: '▾'; }
.donetoday .simple { margin-top: 6px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); border: 1px solid var(--gold); color: var(--ivory); border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; max-width: min(92vw, 560px); display: flex; gap: 12px; align-items: center;
  transition: opacity .2s, transform .2s; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast b { color: var(--gold); }
.toast span { line-height: 1.45; }

/* Quests */
.quests { list-style: none; margin: 0; padding: 0; }
.quests li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.check { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-weight: 700; flex: none; }
.check:hover:not(:disabled) { border-color: var(--gold); }
.check.on { background: var(--gold); border-color: var(--gold); }
.quests .name { flex: 1; }
.pts { font-size: 11px; color: var(--muted); margin-left: 4px; }
.quests li.done .name { color: var(--muted); text-decoration: line-through; }
.streak { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.streak.hot { color: var(--gold); }

/* Simple lists */
.simple { list-style: none; margin: 0; padding: 0; }
.simple li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: start; }
.simple li:first-child { border-top: 0; }
.simple .meta { font-size: 12.5px; color: var(--muted); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.tag.bad { color: #fff; background: var(--red); border-color: var(--red); font-weight: 700; }
.tag.hot { color: var(--ink); background: var(--gold); border-color: var(--gold); font-weight: 700; }
.ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; font-size: 12px; padding: 3px 9px; cursor: pointer; white-space: nowrap; }
.ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* Production pulse */
.teamhead, .member { display: grid; grid-template-columns: 1fr 52px 52px 70px; gap: 8px; align-items: center; }
.teamhead { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; text-align: right; padding-bottom: 4px; }
.teamgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.teamcol h3 { font: 600 12.5px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 6px 0 4px; }
.member { padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.member .role { font-size: 11.5px; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.num.bad { color: var(--red); font-weight: 700; }
.num.warn { color: var(--amber); font-weight: 700; }

/* Settings */
.rules summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary h2::before { content: '▸ '; color: var(--gold); }
.rules details[open] summary h2::before { content: '▾ '; }
.grp { font: 600 12.5px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 22px 0 10px; }
.rulelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.rule { background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.rule label { display: block; font-weight: 600; font-size: 13.5px; }
.rule p { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.rule input { width: 100%; max-width: 100%; background: var(--panel); color: var(--ivory); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13.5px; margin-top: 6px; }
.rule input[type=number] { width: 100px; }
.rule input:focus { outline: none; border-color: var(--gold); }
.eff { font-size: 11px; color: var(--muted); margin-top: 6px; }
.lanbox { margin-top: 14px; font-size: 13px; color: var(--muted); background: var(--ink); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
.lanbox b { color: var(--ivory); }

.foot { padding: 8px 28px 28px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Login (LAN viewers) */
.loginpage { display: grid; place-items: center; padding: 16px; }
.loginbox { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.loginbox input { background: var(--ink); color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
.gold { background: var(--gold); color: var(--ink); border: 0; border-radius: 8px; padding: 10px; font-weight: 700; cursor: pointer; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* v0.4.0: online version */
.who-line { margin-top: 6px; font-size: 12px; color: var(--muted); }
.who-line .ghost { margin-left: 6px; }
.userlist { margin: 10px 0; }
.userform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.userform input, .userform select { background: var(--ink); color: var(--ivory); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12px; }
.keybox { background: #000; color: var(--ivory); border-radius: 6px; padding: 8px 10px; font-size: 12px; overflow-x: auto; margin: 8px 0; user-select: all; }
a.ghost, label.ghost { display: inline-block; text-decoration: none; margin-left: 8px; }
.upl { cursor: pointer; }
