:root {
  --bg: #14110f; --card: #1f1a17; --card2: #29231f; --line: #3a322c;
  --text: #f4ece3; --muted: #a89c90; --gold: #e8b86a; --gold-ink: #2a1d07;
  --green: #7fb069; --red: #e07a6a; --blue: #7fb2e0;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf5ee; --card: #fff; --card2: #f3ebe0; --line: #e2d6c6;
    --text: #2b231c; --muted: #7a6c5e; --gold: #b9791a; --gold-ink: #fff;
    --green: #4d8a3a; --red: #c0503f; --blue: #2f6fa8;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img, svg, video { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.15rem; }
a { color: var(--gold); }

#app { max-width: 1100px; margin: 0 auto; padding: 0 16px 96px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
.brand { font-weight: 700; letter-spacing: .02em; }
.who { color: var(--muted); font-size: .85rem; }

/* nav: bottom bar on phones, top row on wide screens */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.nav a { flex: 1; text-align: center; padding: 12px 4px; color: var(--muted); text-decoration: none; font-size: .85rem; min-height: 48px; }
.nav a[aria-current="page"] { color: var(--gold); font-weight: 600; }
@media (min-width: 720px) {
  .nav { position: static; border: 0; background: none; gap: 4px; margin-bottom: 8px; }
  .nav a { flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; }
  .nav a[aria-current="page"] { background: var(--card2); }
  #app { padding-bottom: 48px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* hero countdown */
.hero { text-align: center; padding: 24px 16px; background:
  radial-gradient(120% 120% at 50% 0%, rgba(232,184,106,.18), transparent 60%), var(--card); }
.hero .big { font-size: clamp(4rem, 22vw, 7.5rem); font-weight: 800; line-height: 1; color: var(--gold); }
.hero .label { font-size: 1.05rem; margin-top: 4px; }
.hero .sub { color: var(--muted); margin-top: 6px; }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring-text { font-size: 1.6rem; font-weight: 700; }

/* timeline */
.timeline { position: relative; display: flex; gap: 4px; margin: 14px 0 6px; }
.seg { position: relative; height: 12px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.seg > i { position: absolute; inset: 0 auto 0 0; background: var(--green); }
.seg.now { outline: 2px solid var(--gold); }
.phase-names { display: flex; gap: 4px; font-size: .72rem; color: var(--muted); }
.phase-names span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tasks */
.board { display: grid; gap: 14px; }
@media (min-width: 720px) { .board { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.col h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.task { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; min-height: 48px; }
.task:hover { border-color: var(--gold); }
.task.done .t { text-decoration: line-through; color: var(--muted); }
.task .t { font-weight: 600; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.pill { background: var(--card2); border-radius: 999px; padding: 2px 9px; }
.pill.over { background: rgba(224,122,106,.2); color: var(--red); }
.pill.me { background: rgba(232,184,106,.2); color: var(--gold); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }

/* forms and buttons */
label { display: block; font-size: .82rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 90px; resize: vertical; }
.btn { background: var(--gold); color: var(--gold-ink); border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; min-height: 44px; }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px 24px; }
@media (min-width: 720px) { .scrim { align-items: center; } .modal { border-radius: 20px; } }
.comment { background: var(--card2); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.comment b { font-size: .85rem; }

.list-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.linkbox { background: var(--card2); border: 1px dashed var(--gold); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; font-size: .85rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 30; }

.locked { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.locked p { color: var(--muted); max-width: 32ch; }
