/* SHOTTY on the web. Same tokens as the iPhone app (Shared/Theme.swift ← CaseUp light theme):
   white ground, ink, grey steps, pills — and neon as a fill only, with ink on it. */

/* Latin and digits only, so Hangul falls through to the system face, as in the app. */
@font-face { font-family: "Supreme"; src: url("fonts/Supreme-Medium.woff2") format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0020-007E; }
@font-face { font-family: "Supreme"; src: url("fonts/Supreme-Bold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0020-007E; }
@font-face { font-family: "Supreme"; src: url("fonts/Supreme-Extrabold.woff2") format("woff2"); font-weight: 800 900; font-display: swap; unicode-range: U+0020-007E; }

:root {
  --s2: #F4F4F5; --s3: #EBEBED; --s4: #E1E1E4;
  --ink: #0B0B0C; --ink2: #3C3C43; --mute: #86868B; --faint: #C2C2C7;
  --neon: #CCFF00; --danger: #FF6961; --hair: rgba(0, 0, 0, .08);
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 24px;
  --system: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Segoe UI", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --caps: "Supreme", var(--system);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 15px/1.5 var(--system); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
p, h1, h2, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.viewer :focus-visible { outline-color: var(--neon); }

.caps { font-family: var(--caps); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.grow { flex: 1; }
.pressable, .chip, .neon, .round, .tile { transition: transform .12s ease-out; }
.chip:active, .neon:active, .round:active, .tile:active { transform: scale(.97); }

/* ---- signed out ---- */
.gate {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px var(--gutter); text-align: center;
}
.gate .wordmark { font-size: clamp(44px, 9vw, 72px); margin-bottom: 4px; }
.gate-text { font-size: 17px; font-weight: 600; max-width: 26em; white-space: pre-line; }
.gate-note { font-size: 13px; color: var(--mute); max-width: 30em; white-space: pre-line; }
.gate-note a { color: var(--ink2); text-underline-offset: 3px; }
#sign-in { min-height: 44px; margin-top: 10px; }
#sign-in:empty { display: none; }

/* ---- home ---- */
.top {
  display: flex; align-items: center; gap: 10px;
  max-width: 1480px; margin: 0 auto; padding: 22px var(--gutter) 2px;
}
.wordmark { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.015em; }
.count { font-size: 13px; color: var(--mute); margin-left: 4px; align-self: flex-end; padding-bottom: 3px; }
.sync { width: 7px; height: 7px; border-radius: 50%; align-self: flex-end; margin-bottom: 9px; background: transparent; transition: background .2s; }
.sync[data-state="busy"] { background: var(--faint); }
.sync[data-state="error"] { background: var(--danger); }

.neon {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 28px; border-radius: 999px;
  background: var(--neon); color: var(--ink); text-decoration: none;
  font-size: 16px; font-weight: 800; letter-spacing: .06em;
}
.neon.small { height: 36px; padding: 0 18px; font-size: 13px; }
.neon.wide { width: 100%; }
.neon:disabled { opacity: .35; cursor: default; transform: none; }
.round {
  width: 36px; height: 36px; border-radius: 50%; background: var(--s3);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.round svg { fill: var(--ink); }

/* One translucent bar; the chips travel under it. */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.bar { max-width: 1480px; margin: 0 auto; padding: 12px var(--gutter); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px; max-width: 16em;
  background: var(--s3); color: var(--ink2);
  font-family: var(--caps); font-size: 13px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip[aria-pressed="true"] { background: var(--neon); color: var(--ink); font-weight: 700; }
.chip.more { padding: 0 12px; letter-spacing: .1em; }

.grid {
  display: flex; align-items: flex-start; gap: clamp(10px, 1.6vw, 20px);
  max-width: 1480px; margin: 0 auto; padding: 6px var(--gutter) 96px;
}
.column { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: clamp(16px, 2vw, 26px); }
.tile { display: block; width: 100%; text-align: left; }
.thumb {
  display: block; position: relative; overflow: hidden; border-radius: 6px; background: var(--s3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); transition: background .15s; }
.tile:hover .thumb::after { background: rgba(0, 0, 0, .06); }
.well {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: .09em;
}
.reason { margin-top: 8px; font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: 8px; display: flex; gap: 5px; align-items: baseline; color: var(--mute); font-size: 11px; white-space: nowrap; overflow: hidden; }
.reason + .meta { margin-top: 3px; }
.meta .caps { font-size: 10px; letter-spacing: .08em; }
.meta span:last-child { overflow: hidden; text-overflow: ellipsis; }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 96px 32px; text-align: center; }
.empty .badge { width: 64px; height: 64px; border-radius: 50%; background: var(--neon); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty .badge svg { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty h2 { font-size: 22px; font-weight: 800; }
.empty p { color: var(--mute); white-space: pre-line; }

/* ---- viewer: black, like the app. Nothing is drawn over the player. ---- */
.viewer {
  position: fixed; inset: 0; z-index: 10; background: #000; color: #fff;
  display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr) min(400px, 36vw);
}
.viewer-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.viewer-bar .caps { font-size: 12px; color: rgba(255, 255, 255, .6); margin: 0 8px; }
.viewer .round { background: rgba(255, 255, 255, .12); }
.viewer .round svg { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viewer .round:disabled { opacity: .3; cursor: default; }
.stage { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px 24px; }
.player { position: relative; background: #000; border-radius: var(--r-m); overflow: hidden; }
.player iframe { border: 0; }
.player.wide { width: min(100%, calc((100svh - 100px) * 16 / 9)); aspect-ratio: 16 / 9; }
.player.tall { height: 100%; max-width: 100%; aspect-ratio: 9 / 16; }
.player.wide iframe, .player.tall iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.player.card { width: min(100%, 420px); height: 100%; display: flex; justify-content: center; align-items: flex-start; border-radius: 0; }
.player.card .instagram-media { width: 100%; min-width: 326px; height: 620px; background: #fff; border-radius: 3px; transform-origin: top center; }
.player.still { width: min(100%, 520px); }
.player.still .thumb { background: rgba(255, 255, 255, .08); }
.player.still .well { color: rgba(255, 255, 255, .4); font-size: 14px; }

.panel { overflow-y: auto; padding: 4px 24px 28px 8px; display: flex; flex-direction: column; gap: 14px; }
.panel .meta { margin: 0; color: rgba(255, 255, 255, .6); font-size: 12px; flex-wrap: wrap; white-space: normal; }
.panel .title { font-size: 14px; color: rgba(255, 255, 255, .72); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.why {
  width: 100%; min-height: 74px; resize: none; field-sizing: content;
  padding: 14px 16px; border: 0; border-radius: var(--r-l);
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 18px; font-weight: 700; line-height: 1.4;
}
.why::placeholder { color: rgba(255, 255, 255, .35); font-weight: 600; }
.label { font-size: 11px; letter-spacing: .11em; color: var(--mute); }
.panel .label { color: rgba(255, 255, 255, .45); margin-top: 6px; }
.panel .chip { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .82); }
.panel .chip[aria-pressed="true"] { background: var(--neon); color: var(--ink); }
.panel .neon { margin-top: 10px; }
.danger { align-self: center; padding: 8px 14px; border-radius: 999px; color: var(--danger); font-size: 14px; font-weight: 600; }
.danger.armed { background: var(--danger); color: #fff; }

/* ---- sheets (add a link, name a folder) ---- */
.backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .4);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s ease;
}
.sheet {
  width: min(100%, 460px); max-height: 100%; overflow-y: auto; padding: 22px;
  background: #fff; border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 14px;
  animation: rise .28s var(--ease);
}
.sheet-title { font-size: 17px; font-weight: 800; letter-spacing: .03em; }
.sheet h2.plain { font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.field {
  width: 100%; padding: 13px 16px; border: 0; border-radius: var(--r-m); background: var(--s2); resize: none;
  font-size: 16px; field-sizing: content;
}
.field::placeholder { color: var(--faint); }
textarea.field { min-height: 76px; font-weight: 600; }
.link-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-m); background: var(--s2); min-width: 0; }
.link-card .thumb { flex: none; width: 56px; height: 56px; border-radius: var(--r-s); }
.link-card .well { font-size: 8px; }
.link-card div:last-child { min-width: 0; }
.link-card .caps { display: block; font-size: 11px; letter-spacing: .09em; }
.link-card small { display: block; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { font-size: 13px; color: var(--mute); }
.row { display: flex; gap: 8px; justify-content: flex-end; }
.plain-btn { height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 600; background: var(--s3); }
.plain-btn.ink { background: var(--ink); color: #fff; }

.menu {
  position: fixed; z-index: 30; min-width: 168px; padding: 6px; background: #fff; border-radius: var(--r-l);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16), 0 0 0 1px var(--hair); animation: fade .12s ease;
}
.menu button { display: block; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; font-size: 14px; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--s2); outline: none; }
.menu button.destructive { color: var(--danger); }
.menu-note { padding: 8px 12px 10px; font-size: 12px; color: var(--mute); max-width: 240px; white-space: pre-line; }
#sign-out { padding: 0 6px 6px; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: 32px; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; animation: rise .25s var(--ease);
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.toast { animation-name: toast; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Narrow: the player on top, the notes under it. */
@media (max-width: 820px) {
  .viewer { grid-template: auto minmax(0, 46svh) minmax(0, 1fr) / minmax(0, 1fr); }
  .stage { padding: 0 12px 12px; }
  .player.wide { width: min(100%, calc(46svh * 16 / 9)); }
  .panel { padding: 8px 16px 28px; }
  .wordmark { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
