:root {
  --bg: #0e1120; --surface: #171b2e; --surface-2: #1f2440; --line: #2b3154;
  --text: #eef0fa; --muted: #9aa1c3; --faint: #6b7299;
  --accent: #22c55e; --accent-2: #f59e0b; --danger: #ef4444; --info: #60a5fa;
  --radius: 16px; --nav-h: 64px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Rubik', system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--info); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* layout */
.shell { padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; position: sticky; top: 0; z-index: 20; background: rgba(14,17,32,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.logo span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { position: fixed; bottom: 0; inset-inline: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; }
.nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.nav button .ic { font-size: 20px; line-height: 1; }
.nav button.on { color: var(--accent); }
@media (min-width: 900px) {
  .with-nav { display: grid; grid-template-columns: 220px 1fr; }
  .nav { position: sticky; top: 0; height: 100dvh; flex-direction: column; justify-content: flex-start; padding: 80px 12px 12px; gap: 4px; border-top: 0; border-inline-start: 1px solid var(--line); }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
  .nav button.on { background: var(--surface-2); }
  .shell { padding: 24px 28px 40px; }
  .topbar { grid-column: 1 / -1; }
}

/* cards & bits */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.glow { background: linear-gradient(160deg, #1d2a3a, var(--surface) 60%); border-color: #2c4a3d; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.btn.primary { background: var(--accent); color: #05210f; }
.btn.warn { background: var(--accent-2); color: #2a1800; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #5b2330; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.big { font-size: 18px; padding: 16px 20px; min-height: 56px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--accent); color: #05210f; border-color: var(--accent); font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.badge { font-size: 12px; border-radius: 6px; padding: 2px 7px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.badge.out { background: #3a1820; color: #fca5a5; }
.badge.founder { background: #3b2e0a; color: #fcd34d; }
.badge.live { background: #0d3320; color: #86efac; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: 17px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.bar.thin { height: 6px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.big-num { font-size: 44px; font-weight: 800; line-height: 1; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.empty { text-align: center; color: var(--faint); padding: 22px 8px; font-size: 14px; }

/* hero */
.hero { padding: 34px 4px 10px; }
.hero h1 { font-size: 34px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; }
.rules { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.rule .e { font-size: 26px; }
.rule h3 { margin: 6px 0 4px; }
.rule p { margin: 0; font-size: 13px; color: var(--muted); }

/* member card */
.member .head { display: flex; gap: 12px; align-items: center; }
.member.out { opacity: .55; }
.member .share { font-size: 26px; font-weight: 800; }
.member p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--faint); }
.timeline .miss .dot, .timeline .out .dot { background: var(--danger); }
.timeline .done .dot { background: var(--accent); }
.timeline .join .dot { background: var(--accent-2); }

/* categories */
.cat { cursor: pointer; transition: transform .15s; }
.cat:active { transform: scale(.98); }
.cat .ico { font-size: 28px; }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-inline: -16px; padding-inline: 16px; align-items: flex-start; }
.col { flex: 0 0 82%; max-width: 320px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: border-color .15s, background .15s; }
@media (min-width: 900px) { .board { margin-inline: 0; padding-inline: 0; } .col { flex: 0 0 280px; } }
.col.drop { border-color: var(--accent); background: #15261f; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.col-head .count { margin-inline-start: auto; }
.tcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; }
.tcard .t { font-weight: 600; }
.tcard .meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tcard.done .t { text-decoration: line-through; color: var(--muted); }
.tcard.doing { border-inline-start: 4px solid var(--accent-2); }
.tcard.lifted { opacity: .3; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(-3deg) scale(1.04); box-shadow: var(--shadow); width: 260px; }
.status { font-size: 12px; border-radius: 6px; padding: 2px 7px; }
.status.todo { background: #24304f; color: #a5b4fc; }
.status.doing { background: #3b2e0a; color: #fcd34d; }
.status.done { background: #0d3320; color: #86efac; }
.fab { position: fixed; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); inset-inline-start: 16px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #05210f; font-size: 30px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; z-index: 25; }
@media (min-width: 900px) { .fab { bottom: 24px; inset-inline-start: auto; inset-inline-end: 24px; } }

/* schedule */
.day { padding: 12px 14px; }
.day.today { border-color: var(--accent); }
.day.off { opacity: .6; }
.day-row { display: grid; grid-template-columns: 28px 1fr 70px; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.day-row .plan { color: var(--muted); font-size: 12px; }

/* clock */
.clock { text-align: center; }
.ring { width: 170px; height: 170px; margin: 6px auto 12px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .inner { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .inner b { font-size: 30px; font-weight: 800; }
.timer { font-variant-numeric: tabular-nums; direction: ltr; }

/* forms & modal */
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; min-height: 46px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; }
input[type=time] { direction: ltr; padding: 8px; min-height: 40px; }
.field + .field { margin-top: 14px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(5,7,15,.7); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .2s; }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }
.modal .x { background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }
.agreement { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-height: 40dvh; overflow-y: auto; font-size: 14px; }
.steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); }
.steps i.on { background: var(--accent); }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 9px 6px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--surface-2); color: var(--text); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 0; cursor: pointer; }
.daypick button.on { background: var(--accent); color: #05210f; border-color: var(--accent); font-weight: 700; }
#toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--surface-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); display: none; max-width: 90vw; }
#toast.err { border-color: var(--danger); }
.warnbox { background: #3a1820; border: 1px solid #5b2330; color: #fecaca; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.okbox { background: #0d3320; border: 1px solid #14532d; color: #bbf7d0; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
@keyframes pop { 50% { transform: scale(1.15) } }
.pop { animation: pop .35s; }

/* strikes, meetings, admin */
.pips { display: inline-flex; gap: 4px; direction: ltr; }
.pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.pips i.on { background: var(--danger); border-color: var(--danger); }
.btn.mini { min-height: 32px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.dotn { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; margin-inline-start: -6px; vertical-align: top; text-align: center; }
.log { margin-top: 10px; font-size: 14px; }
.log summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.log > div { padding: 5px 0; border-top: 1px solid var(--line); }
.voided { opacity: .5; text-decoration: line-through; }
.voided .badge, .voided .btn { text-decoration: none; }
.code { font-size: 24px; font-weight: 700; letter-spacing: 4px; text-align: center; width: 100%; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
.code-sm { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }
.att { opacity: .3; filter: grayscale(1); }
.att.in { opacity: 1; filter: none; outline: 2px solid var(--accent); border-radius: 50%; }
.good { color: #86efac; } .bad { color: #fca5a5; }
.warnbox.amber { background: #3b2e0a; border-color: #6b4e0a; color: #fde68a; }
.okbox.blue { background: #1c2747; border-color: #3b4a80; color: #c7d2fe; }
.tablewrap { overflow-x: auto; margin-inline: -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.tbl th { text-align: start; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; }
.tbl td { padding: 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.status.review { background: #1c2747; color: #a5b4fc; }
.status.todo { background: #24283f; color: #aab0cf; }
.tcard.review { border-inline-start: 4px solid var(--info); }
@media (min-width: 800px) { .rules { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 899px) { .nav button { font-size: 11px; } }

/* the board scrolls inside itself, never the page */
html, body { overflow-x: hidden; }
.shell, .with-nav > * { min-width: 0; }
.board { margin-inline: 0; padding-inline: 0; }

/* live and social */
.avatar { position: relative; }
.avatar[data-user] { cursor: pointer; }
.avatar.online::after { content: ''; position: absolute; bottom: -1px; inset-inline-start: -1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.feed { margin-top: 12px; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed-item .post { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.feed-item .sys { color: var(--muted); }
.feed-item.strike .sys, .feed-item.out .sys { color: #fca5a5; }
.feed-item.done .sys, .feed-item.bonus .sys { color: #86efac; }
.reacts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: 13px; opacity: .55; min-height: 28px; }
.react:hover, .react.on { opacity: 1; }
.react.on { border-color: var(--accent); background: #0d3320; }
.react b { font-weight: 600; }
#toast { cursor: default; animation: up .25s; }

/* profile pictures */
.avatar { overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .em { font-size: 1.25em; line-height: 1; }
.avatar.xl { width: 104px; height: 104px; font-size: 46px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--line); }
.picker { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); margin: 12px 0; }
.picker .pv { display: flex; align-items: center; gap: 16px; }
.picker .pv-name { font-size: 22px; font-weight: 800; }
.faces { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.faces button { width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent; background: var(--surface-2); font-size: 22px; cursor: pointer; }
.faces button.on { border-color: var(--accent); }

/* rules and agreement: readable everywhere, and a plain list inside the sign-up window */
.rules { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.rule h3 { font-size: 17px; }
.rule p { font-size: 15px; line-height: 1.55; color: #c3c8e2; }
.modal .rules { grid-template-columns: 1fr; gap: 8px; }
.modal .rule { display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; align-items: start; padding: 14px; }
.modal .rule .e { grid-row: span 2; font-size: 30px; }
.modal .rule h3 { margin: 0 0 4px; font-size: 18px; }
.modal .rule p { font-size: 16px; }
.agreement { font-size: 16px; line-height: 1.8; max-height: 60dvh; padding: 18px; color: var(--text); }
@media (min-width: 640px) { .modal { max-width: 680px; } }

/* votes */
.prop .p-ic { font-size: 26px; line-height: 1.1; }
.prop h3 { font-size: 16px; line-height: 1.35; }
.prop.closed { opacity: .8; }
.prop .reason { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.votebar { position: relative; height: 12px; border-radius: 99px; background: var(--surface-2); display: flex; justify-content: space-between; overflow: visible; }
.votebar .y { background: var(--accent); border-radius: 99px 0 0 99px; height: 100%; }
[dir=rtl] .votebar .y { border-radius: 0 99px 99px 0; }
.votebar .n { background: var(--danger); border-radius: 0 99px 99px 0; height: 100%; }
[dir=rtl] .votebar .n { border-radius: 99px 0 0 99px; }
.votebar b { position: absolute; top: -4px; width: 2px; height: 20px; background: #fff; opacity: .8; }
.voter { position: relative; display: inline-flex; }
.voter i { position: absolute; bottom: -4px; inset-inline-end: -4px; font-style: normal; font-size: 11px; font-weight: 800; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); }
.voter.no i { background: var(--danger); }
.btn.danger-on { background: var(--danger); color: #fff; }
