:root {
  --bg: #080a0e;
  --ink: #eef2f7;
  --dim: #8b97a8;
  --line: #1e2530;
  --lime: #b6ff3c;
  --gold: #ffd166;
  --radius: 16px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 380px at 50% -80px, rgba(182, 255, 60, 0.13), transparent 70%),
    radial-gradient(620px 420px at 88% 18%, rgba(120, 90, 255, 0.10), transparent 72%),
    radial-gradient(700px 500px at 0% 100%, rgba(60, 200, 190, 0.06), transparent 70%);
}

a { color: inherit; }

:focus-visible { outline: 2px solid rgba(182, 255, 60, 0.75); outline-offset: 2px; }

/* ---------- header ---------- */

.top {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-pot { width: 34px; height: 34px; color: var(--lime); flex: none; filter: drop-shadow(0 0 12px rgba(182, 255, 60, 0.35)); }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: 0.04em; }
.brand-text small { font-size: 11px; color: var(--dim); letter-spacing: 0.16em; margin-top: 2px; }

.day {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 12px;
  color: var(--lime);
  background: rgba(182, 255, 60, 0.08);
  border: 1px solid rgba(182, 255, 60, 0.28);
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
}
.day b { font-variant-numeric: tabular-nums; color: #eaffcf; letter-spacing: 0.02em; }

/* ---------- hero ---------- */

main { max-width: 880px; margin: 0 auto; padding: 0 20px 64px; }

.hero { padding: 46px 0 24px; }

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 6.2vw, 46px);
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0 0 26px;
  max-width: 620px;
  color: #a9b4c4;
  font-size: 15.5px;
  line-height: 1.8;
}
.sub b { color: var(--lime); font-weight: 700; }

.join { max-width: 620px; }

.field {
  display: flex;
  gap: 10px;
  padding: 6px;
  background: #0d1116;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus-within {
  border-color: rgba(182, 255, 60, 0.55);
  box-shadow: 0 0 0 4px rgba(182, 255, 60, 0.08);
}

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
}
.field input::placeholder { color: #5d6878; }

.field button {
  flex: none;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #0b0f08;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 0 22px;
  min-height: 46px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.2s;
}
.field button:hover { filter: brightness(1.07); }
.field button:active { transform: translateY(1px); }
.field button:disabled { opacity: 0.55; cursor: progress; filter: none; transform: none; }

.hint { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.65; color: #6f7c8e; }
.hint.error { color: #ff9090; }
.hint.ok { color: var(--lime); }

.archive-note {
  margin: -4px 0 14px;
  font-size: 12px;
  color: #8b97a8;
  line-height: 1.6;
}
.archive-note b { color: #cfd8e3; font-weight: 600; }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 6px 0 30px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #11161d, #0c1014);
}
.stat span { font-size: 11.5px; color: var(--dim); letter-spacing: 0.04em; }
.stat b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- day tabs ---------- */

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.day-tab {
  flex: none;
  border: 1px solid var(--line);
  background: #0f1319;
  color: #9aa6b7;
  font: inherit;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.day-tab:hover { border-color: #33404f; color: #cfd8e3; }
.day-tab.is-live { color: var(--lime); border-color: rgba(182, 255, 60, 0.3); }
.day-tab.is-active {
  background: rgba(182, 255, 60, 0.1);
  border-color: rgba(182, 255, 60, 0.55);
  color: #eaffcf;
}

/* ---------- board ---------- */

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.board-head h2 { margin: 0; font-size: 18px; letter-spacing: 0.02em; }

.tools { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); }
.updated { font-variant-numeric: tabular-nums; white-space: nowrap; }

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: #c3ccd9;
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ghost:hover { border-color: rgba(182, 255, 60, 0.4); color: var(--lime); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.card {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #11161d 0%, #0c1014 100%);
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.card:hover { border-color: #2c3746; transform: translateY(-1px); }
.card.flash { animation: flash 1.8s ease; }

@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(182, 255, 60, 0); }
  18% { box-shadow: 0 0 0 3px rgba(182, 255, 60, 0.35); }
  60% { box-shadow: 0 0 0 2px rgba(182, 255, 60, 0.12); }
}

.top-row {
  display: grid;
  grid-template-columns: 40px 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.rank {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  color: #4b5768;
  font-variant-numeric: tabular-nums;
}
.rank[data-rank="1"] { color: var(--gold); text-shadow: 0 0 18px rgba(255, 209, 102, 0.45); }
.rank[data-rank="2"] { color: #cfd8e3; }
.rank[data-rank="3"] { color: #d9986a; }

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  background: #1a212b;
  border: 1px solid #232c38;
  display: block;
}

.ident { min-width: 0; }
.name {
  font-size: 16.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--dim);
}
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #9fb0c4;
  background: #1a212b;
  border-radius: 6px;
  padding: 1px 7px;
}

.score { text-align: right; min-width: 0; }
.score b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.score small { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.score b.pending { font-size: 15px; font-weight: 700; color: #8b97a8; letter-spacing: 0.02em; }
.card.is-pending { opacity: 0.82; }

.track {
  position: relative;
  height: 8px;
  margin: 14px 0 0;
  border-radius: 999px;
  background: #171d26;
}
.fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3ddc84, var(--lime));
  box-shadow: 0 0 12px rgba(182, 255, 60, 0.22);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #7b8798;
  border: 1px solid #232c38;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.pill.done { color: #d6ff9a; border-color: rgba(182, 255, 60, 0.38); background: rgba(182, 255, 60, 0.09); }
.pill.next { color: #cfd8e3; border-color: #33404f; }

.empty {
  border: 1.5px dashed #232c38;
  border-radius: 18px;
  padding: 44px 20px;
  text-align: center;
  color: var(--dim);
}
.empty-pot { width: 56px; height: 56px; color: #2f3a49; margin-bottom: 6px; }
.empty h3 { margin: 6px 0; font-size: 17px; color: #cfd8e3; }
.empty p { margin: 0; font-size: 13.5px; }

.skeleton { margin: 0; padding: 20px 0; text-align: center; font-size: 13px; color: var(--dim); }

.fine { margin: 24px 0 0; text-align: center; font-size: 11.5px; line-height: 1.7; color: #55606f; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid #2b3646;
  background: #161d26;
  color: #e7eef7;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 120, 120, 0.45); color: #ffc9c9; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .top-row { grid-template-columns: 34px 44px minmax(0, 1fr); row-gap: 10px; }
  .avatar { width: 44px; height: 44px; border-radius: 11px; }
  .score { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .score small { margin: 0; }
}

@media (max-width: 560px) {
  .top { padding-top: 20px; }
  .hero { padding-top: 34px; }
  .br-m { display: none; }
  .field { flex-direction: column; }
  .field button { width: 100%; }
  .day { padding: 6px 10px; font-size: 11px; }
  .brand-text small { letter-spacing: 0.1em; }
}

@media (max-width: 400px) {
  .brand-text small { display: none; }
  .brand-pot { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
