@font-face { font-family: "Geist"; src: url("fonts/Geist-VF.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --line: #e4e4e0;
  --ink: #16181b;
  --muted: #7c8087;
  --accent: #1f5eff;
  --r: 12px;
  --pad: clamp(16px, 3.4vw, 56px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Geist", system-ui, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.4; min-height: 100svh;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

/* offline download: a thin line at the very top, gone when done */
.load { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10; }
.load i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s, opacity .6s; }
.load.done i { opacity: 0; }

/* header */
.top {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: clamp(20px, 3vw, 40px) var(--pad) 8px;
}
.top > div:first-child { margin-right: auto; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 44px); font-weight: 650; letter-spacing: -.02em; line-height: 1.05; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.days { display: flex; background: #ebebe7; border-radius: 999px; padding: 4px; }
.days button {
  border: 0; background: transparent; border-radius: 999px; cursor: pointer;
  padding: 8px 18px; min-height: 44px; font-size: 15px; font-weight: 550; color: var(--muted);
}
.days button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.ready { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ready:empty { display: none; }
.icon {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
}
.icon:hover { border-color: var(--ink); }

/* team grid */
.list {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  padding: 16px var(--pad) 32px; align-content: start;
}
.brk {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  color: var(--muted); font-size: 13px; padding: 2px;
}
.brk::before, .brk::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.team {
  text-align: left; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center;
  padding: 18px; min-height: 96px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.team:hover { border-color: #c9c9c4; }
.team:focus-visible, .team.sel { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,94,255,.15); }
.team .num { grid-row: 1 / span 2; font-size: 40px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; min-width: 1.3em; color: var(--muted); }
.team.sel .num, .team.now .num { color: var(--accent); }
.team .names { font-size: 17px; font-weight: 600; line-height: 1.25; }
.team .time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile { position: relative; display: grid; }
.tile.nofile .team { background: transparent; border-style: dashed; }
.tile.nofile .names, .tile.nofile .num { opacity: .55; }
.more {
  display: none; position: absolute; top: 8px; right: 6px; width: 40px; height: 40px;
  place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.canUpload .more { display: grid; }
.canUpload .team { padding-right: 48px; }
.more:hover, .more:focus-visible { background: #efefec; color: var(--ink); outline: none; }
.prog { position: absolute; left: 12px; right: auto; bottom: 0; height: 3px; width: 0; max-width: calc(100% - 24px); background: var(--accent); border-radius: 3px; transition: width .2s; }
.tile.busy .team { pointer-events: none; }
.tile.busy .names { opacity: .5; }

.pop {
  position: fixed; z-index: 20; min-width: 180px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.pop[hidden] { display: none; }
.pop p { margin: 8px 12px 10px; font-size: 14px; color: var(--muted); }
.pop button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 12px; min-height: 44px; border-radius: 8px; font-size: 15px; font-weight: 550;
}
.pop button:hover, .pop button:focus-visible { background: #f1f1ee; outline: none; }
.pop button.primary { background: var(--ink); color: #fff; text-align: center; }
.pop button.primary:hover, .pop button.primary:focus-visible { background: #000; }
.team.now { border-color: var(--accent); }

.note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; }
.note:empty { display: none; }

/* viewer */
.viewer { position: fixed; inset: 0; background: #000; z-index: 50; user-select: none; touch-action: none; }
.viewer[hidden] { display: none; }
.stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
#pdfCanvas { display: none; max-width: 100%; max-height: 100%; }
.pptxHost { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; display: none; background: transparent; }
.pptxHost .slideBox { display: none; }
.pptxHost .slideBox.on { display: block; }
.pptxHost .pptx-preview-wrapper { height: auto !important; overflow: visible !important; background: transparent !important; }
.pptxHost .pptx-preview-slide-wrapper { margin: 0 !important; }
.black { position: absolute; inset: 0; background: #000; z-index: 3; }
.black[hidden] { display: none; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #aaa; z-index: 2; padding: 24px; text-align: center; }
.loading[hidden] { display: none; }
.loading span { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #333; border-top-color: #fff; animation: spin .8s linear infinite; }
.loading p { margin: 0; font-size: 16px; max-width: 32em; }
.loading p:empty { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.hud { position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: opacity .35s; color: #fff; }
.hud.idle { opacity: 0; }
.hud.idle * { cursor: none; }
.vnum, .count {
  position: absolute; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.5); border-radius: 999px; padding: 6px 14px;
}
.vnum { left: 16px; top: 16px; }
.vnum:empty, .count:empty { display: none; }
.count { right: 16px; bottom: 16px; }
.close {
  position: absolute; right: 16px; top: 16px; pointer-events: auto; cursor: pointer;
  width: 48px; height: 48px; display: grid; place-items: center;
  background: rgba(0,0,0,.5); border: 0; border-radius: 50%; color: #fff;
}
.close:hover { background: rgba(255,255,255,.25); }
.nav { position: absolute; top: 80px; bottom: 60px; width: 22%; background: transparent; border: 0; pointer-events: auto; cursor: pointer; }
.nav.prev { left: 0; } .nav.next { right: 0; }

@media (max-width: 700px) {
  .top { gap: 12px; }
  .top > div:first-child { flex-basis: 100%; }
  .team .num { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }
