@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-sans.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #101216;
  --surface-2: #15181e;
  --surface-3: #1a1e26;
  --line: #22252d;
  --line-2: #2c313b;
  --text: #e7e9ef;
  --text-2: #a2a9b8;
  --text-3: #7f8797;
  --accent: #6f9bff;
  --like: #57cf9a;
  --nope: #e88b8b;
  --star: #f2c14e;
  --discord: #5865f2;
  --radius: 18px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}

/* ------------------------------------------------------------ shared */

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}
.center h1 { font-size: 28px; }
.lead { color: var(--text-2); max-width: 36ch; }
.notice {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  max-width: 40ch;
}
.logo {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #23283a, #14161c);
  color: var(--nope);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.logo.ok { color: var(--like); }
.logo svg { width: 36px; height: 36px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-weight: 600; text-decoration: none; color: var(--text);
  transition: transform 120ms var(--ease-out), background 160ms;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.danger { background: var(--nope); color: #1a0c0c; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.discord { background: var(--discord); color: #fff; border-color: transparent; min-width: 240px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--text-3); padding: 8px; }

.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar.ph { display: inline-grid; place-items: center; background: var(--surface-3); font-weight: 700; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--text-2);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--surface-3); border: 1px solid var(--line-2);
  padding: 10px 16px; border-radius: 12px; pointer-events: none;
  transition: opacity 180ms, transform 220ms var(--ease-out);
  z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--nope); }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.progress { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; }

/* ------------------------------------------------------------ home */

.home { flex: 1; padding: 6px 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.home h2 { font-size: 18px; margin-top: 8px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  display: grid; gap: 2px; justify-items: start; text-align: left;
  padding: 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color 160ms, background 160ms;
}
.mode.on { border-color: var(--text-2); background: var(--surface-2); }
.mode-icon { color: var(--nope); margin-bottom: 4px; }
.mode[data-mode="stars"] .mode-icon { color: var(--star); }
.mode-icon svg { width: 26px; height: 26px; }
.mode-name { font-weight: 700; }
.mode-hint { color: var(--text-3); font-size: 13px; }
.pick h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  transition: background 140ms, border-color 140ms, color 140ms;
}
.chip .n { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip.on .n { color: #555b66; }
.stats { color: var(--text-3); font-size: 13px; }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
  max-width: 560px; margin: 0 auto;
}
.dock.split { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ------------------------------------------------------------ swipe deck */

.stage-wrap { flex: 1; display: flex; padding: 4px 14px 0; min-height: 0; }
.stage-wrap.busy { opacity: 0.5; }
.deck { position: relative; flex: 1; min-height: 420px; }
.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  transition: transform 260ms var(--ease-out);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  --like: 0; --nope: 0;
}
.card.under { transform: scale(0.95) translateY(12px); filter: brightness(0.7); pointer-events: none; }
.card.flat { position: relative; inset: auto; box-shadow: none; }
.media {
  position: relative; flex: 1; min-height: 260px;
  display: grid; place-items: center;
  background: #0d0f13;
}
.card.flat .media { flex: none; height: 46vh; min-height: 240px; }
.media img, .media video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.media.model canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; touch-action: none; }
.hint3d {
  position: absolute; left: 12px; bottom: 10px; z-index: 1;
  font-size: 12px; color: var(--text-3); background: rgba(13,15,19,0.7);
  padding: 4px 8px; border-radius: 8px; pointer-events: none;
}
.media.audio { gap: 14px; align-content: center; }
.play {
  width: 96px; height: 96px; border-radius: 50%;
  border: 0; background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  transition: transform 120ms var(--ease-out);
}
.play:active { transform: scale(0.95); }
.play.playing { background: var(--like); }
.audio-name { color: var(--text-3); font-size: 13px; }
.file-tabs { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.dot { width: 26px; height: 6px; padding: 0; border-radius: 3px; border: 0; background: rgba(255,255,255,0.25); }
.dot.on { background: #fff; }
.info { padding: 14px 16px 16px; display: grid; gap: 4px; }
.info h2 { font-size: 20px; }
.kind { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 600; }
.live { color: var(--like); }
.variant { color: var(--text-2); }
.tags { color: var(--text-3); font-size: 13px; }
.stamp {
  position: absolute; top: 26px; padding: 6px 14px;
  border: 3px solid; border-radius: 10px;
  font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em;
  pointer-events: none; background: rgba(11,12,15,0.55);
}
.stamp.like { left: 22px; color: var(--like); transform: rotate(-12deg); opacity: var(--like); }
.stamp.nope { right: 22px; color: var(--nope); transform: rotate(12deg); opacity: var(--nope); }

.actions {
  display: flex; justify-content: center; align-items: center; gap: 22px;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
}
.round {
  width: 68px; height: 68px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface);
  transition: transform 120ms var(--ease-out), background 160ms;
}
.round:active { transform: scale(0.92); }
.round.like { color: var(--like); }
.round.nope { color: var(--nope); }
.round.small { width: 50px; height: 50px; color: var(--text-2); }
@media (hover: hover) {
  .round.like:hover { background: rgba(87,207,154,0.12); }
  .round.nope:hover { background: rgba(232,139,139,0.12); }
}

/* ------------------------------------------------------------ reason sheet */

.sheet-wrap {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center;
  transition: background 200ms;
}
.sheet-wrap.open { background: rgba(0,0,0,0.45); }
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 12px;
  transform: translateY(100%); transition: transform 260ms var(--ease-out);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet h2 { font-size: 20px; }
.hint { color: var(--text-3); font-size: 13px; }
.reasons .chip.on { background: var(--nope); color: #1a0c0c; }
textarea {
  width: 100%; resize: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; font: inherit;
}
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* ------------------------------------------------------------ stars */

.stars-wrap { flex: 1; padding: 4px 14px 120px; display: grid; gap: 14px; align-content: start; }
.rate { display: grid; gap: 10px; }
.crit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.crit-name { font-weight: 600; font-size: 14px; }
.stars { display: flex; flex: none; }
.star {
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; color: var(--line-2);
  transition: color 120ms, transform 120ms var(--ease-out);
}
.star.on { color: var(--star); }
.star:active { transform: scale(0.88); }
.star svg { width: 28px; height: 28px; }

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