:root {
  --night: #16132e;
  --night-deep: #100e24;
  --panel: #211d45;
  --panel-hi: #2c2759;
  --line: #3a3470;
  --text: #f4efe6;
  --muted: #a39fc4;
  --red: #ff4655;
  --red-soft: rgba(255, 70, 85, .16);
  --mint: #35e6a8;
  --mint-soft: rgba(53, 230, 168, .16);
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: Barlow, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: var(--night);
  color: var(--text);
  font: 16px/1.5 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 20px 150px; }
.loading { color: var(--muted); padding: 80px 0; }

/* ---------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 18px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: .01em; }
.logo-mark { display: flex; gap: 3px; }
.logo-mark i { width: 6px; height: 22px; background: var(--red); transform: skewX(-14deg); }
.logo-mark i:nth-child(n+4) { opacity: .35; }
.account { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.account img { width: 34px; height: 34px; border-radius: 50%; }
.account a { color: var(--muted); text-decoration: none; padding: 6px 2px; white-space: nowrap; }
.account a:hover { color: var(--text); }

.online { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.online .faces { display: flex; }
.online .faces img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--night); margin-left: -8px; }
.online .faces img:first-child { margin-left: 0; }
.online b { color: var(--mint); font-weight: 600; }
.online strong { color: var(--text); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(53,230,168,.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(53,230,168,0); } }

/* ---------- day strip */
.days {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 4px 20px 14px; margin: 0 -20px; scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 74px; scroll-snap-align: start;
  background: var(--panel); border: 1px solid transparent; border-radius: 12px;
  padding: 10px 0 11px; text-align: center; position: relative;
  transition: background .15s, border-color .15s;
}
.day:hover { background: var(--panel-hi); }
.day .wd { font-size: 13px; color: var(--muted); }
.day .num { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.05; }
.day .pips { display: flex; justify-content: center; gap: 3px; margin-top: 6px; }
.day .pips i { width: 7px; height: 7px; border-radius: 2px; background: var(--line); }
.day .pips i.on { background: var(--red); }
.day.ready .pips i.on { background: var(--mint); }
.day.ready { border-color: rgba(53,230,168,.45); }
.day.sel { background: var(--text); color: var(--night); }
.day.sel .wd { color: #56527a; }
.day.sel .pips i { background: #cfc9dd; }
.day .me-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.day.gap { margin-left: 14px; }

/* ---------- lobby (the hero) */
.lobby {
  position: relative; margin-top: 18px; padding: 28px 28px 30px;
  background: radial-gradient(900px 340px at 20% 0%, rgba(255,70,85,.13), transparent 70%), var(--night-deep);
  border-radius: 20px; overflow: hidden;
}
.lobby.ready { background: radial-gradient(900px 340px at 20% 0%, rgba(53,230,168,.16), transparent 70%), var(--night-deep); }
.lobby-date { font-size: 15px; color: var(--muted); margin: 0; }
.lobby h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(46px, 9vw, 96px);
  line-height: .92; margin: 6px 0 10px; letter-spacing: -.005em; text-transform: uppercase;
}
.lobby.ready h1 { color: var(--mint); }
.lobby .sub { margin: 0 0 26px; color: var(--muted); font-size: 17px; max-width: 60ch; }
.lobby .sub strong { color: var(--text); font-weight: 600; }

.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; max-width: 760px; }
.slot {
  aspect-ratio: 3 / 4; border-radius: 14px; position: relative; overflow: hidden;
  background: var(--panel); display: flex; flex-direction: column; justify-content: flex-end;
}
.slot.empty { background: transparent; border: 2px dashed var(--line); align-items: center; justify-content: center; color: var(--line); font-family: var(--display); font-weight: 800; font-size: 34px; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(16,14,36,.92)); }
.slot.empty::after { display: none; }
.slot .nm { position: relative; z-index: 1; padding: 0 10px 2px; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .tm { position: relative; z-index: 1; padding: 0 10px 10px; font-size: 13px; color: var(--muted); }
.slot.you { box-shadow: inset 0 0 0 3px var(--red); }
.slot .live { position: absolute; top: 9px; left: 9px; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(16,14,36,.7); }
.lobby.ready .slot { box-shadow: inset 0 0 0 3px var(--mint); }
.more { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* the lock-in moment */
.lobby.lock .slot { animation: lockin .5s cubic-bezier(.2,.9,.3,1.3) both; }
.lobby.lock .slot:nth-child(2) { animation-delay: .06s; }
.lobby.lock .slot:nth-child(3) { animation-delay: .12s; }
.lobby.lock .slot:nth-child(4) { animation-delay: .18s; }
.lobby.lock .slot:nth-child(5) { animation-delay: .24s; }
@keyframes lockin { 0% { transform: scale(.86); filter: brightness(2.2); } 100% { transform: none; filter: none; } }

/* ---------- timeline */
.section-title { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 38px 0 4px; }
.section-note { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.timeline { position: relative; }
.axis, .track-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; }
.axis .ticks { position: relative; height: 22px; font-size: 12px; color: var(--muted); }
.axis .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis .ticks span.first { transform: none; }
.axis .ticks span.last { transform: translateX(-100%); }
.track-row { padding: 7px 0; }
.track-row .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.track-row .who img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.track-row .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 15px; }
.track { position: relative; height: 26px; background: var(--panel); border-radius: 7px; }
.track .grid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.04); }
.bar { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: var(--red); display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 600; color: #fff; overflow: hidden; white-space: nowrap; min-width: 6px; }
.bar.allday { background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #e83c4b 10px 20px); }
.track-row.you .bar { box-shadow: 0 0 0 2px var(--text); }
.heat-row { padding: 0 0 10px; }
.heat-row .who { font-weight: 600; font-size: 14px; color: var(--muted); }
.heat { position: relative; height: 34px; border-radius: 8px; overflow: hidden; background: var(--panel); }
.heat i { position: absolute; top: 0; bottom: 0; }
.heat .best { position: absolute; top: 0; bottom: 0; box-shadow: inset 0 0 0 2px var(--mint); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--night); }
.now-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); z-index: 2; pointer-events: none; }
.now-line::before { content: "now"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; }
.empty-day { background: var(--panel); border-radius: 14px; padding: 22px; color: var(--muted); }

/* ---------- plan dock */
.dock {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 5;
  width: min(1080px, 100%); padding: 0 20px calc(16px + env(safe-area-inset-bottom));
}
.dock-inner {
  background: rgba(33, 29, 69, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,.5);
}
.dock-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.dock-head p { margin: 0; font-size: 15px; color: var(--muted); }
.dock-head p strong { color: var(--text); font-weight: 600; }
.dock-head .leave { background: none; border: 0; color: var(--red); font-weight: 600; font-size: 14px; padding: 2px 0; white-space: nowrap; }
.dock-head .leave:hover { text-decoration: underline; }
.presets { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset {
  flex: 1 0 auto; min-width: 96px; border: 1px solid var(--line); background: var(--night);
  border-radius: 12px; padding: 8px 12px; text-align: left; line-height: 1.25; transition: border-color .15s, background .15s;
}
.preset:hover { border-color: var(--muted); }
.preset b { display: block; font-weight: 700; font-size: 15px; }
.preset small { color: var(--muted); font-size: 13px; }
.preset.on { background: var(--red); border-color: var(--red); }
.preset.on small { color: rgba(255,255,255,.85); }
.preset:disabled { opacity: .55; cursor: default; }
.custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.custom label { font-size: 14px; color: var(--muted); }
.custom select { background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.custom .save { background: var(--text); color: var(--night); border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; }
.custom .hint { flex-basis: 100%; font-size: 13px; color: var(--muted); }

/* ---------- login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.login h1 { font-family: var(--display); font-weight: 900; font-size: clamp(60px, 13vw, 140px); line-height: .88; margin: 26px 0 16px; text-transform: uppercase; }
.login p { color: var(--muted); font-size: 18px; max-width: 46ch; margin: 0 0 30px; }
.login .slots { max-width: 520px; }
.discord { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: #5865f2; color: #fff; text-decoration: none; padding: 14px 24px; border-radius: 12px; font-weight: 700; font-size: 17px; }
.discord:hover { background: #4b57d6; }
.notice { align-self: flex-start; background: var(--red-soft); border-left: 3px solid var(--red); padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 15px; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -140%); z-index: 10;
  background: var(--text); color: var(--night); font-weight: 600; padding: 10px 18px; border-radius: 999px;
  transition: transform .25s; visibility: hidden; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.bad { background: var(--red); color: #fff; }

/* ---------- small screens */
@media (max-width: 640px) {
  .shell { padding: 0 16px 190px; }
  .days { padding: 4px 16px 14px; margin: 0 -16px; }
  .account span { display: none; }
  .lobby { padding: 22px 16px 22px; border-radius: 16px; }
  .slots { gap: 6px; }
  .slot { border-radius: 10px; }
  .slot .nm { font-size: 11px; padding: 0 5px 6px; }
  .slot .tm { display: none; }
  .slot.empty { font-size: 24px; }
  .axis, .track-row { grid-template-columns: 34px 1fr; gap: 8px; }
  .track-row .who span { display: none; }
  .heat-row .who { font-size: 0; }
  .dock { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .dock-inner { padding: 12px; }
  .preset { min-width: 84px; padding: 7px 10px; }
}

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