/* App styles. Scenes build DOM once; these classes only describe look + layout.
   Kept low-specificity (single classes) to avoid selectors cancelling out. */

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s4) var(--s3);
}

.scene {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  animation: scene-in 180ms ease both;
}

@keyframes scene-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --- brand ------------------------------------------------------------------ */
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s2);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 33px;
  letter-spacing: -0.02em;
}
.brand-sub {
  color: var(--ink-soft);
  font-size: 16px;
}

/* --- generic controls ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-ctrl);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

/* Inline icons (Lucide + the Google mark). Inherit text color & align with text. */
.icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon svg { display: block; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary.is-ready { background: #1f7a4d; }

.btn-ghost {
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--line);
}

.field-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.text-input {
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--paper-raised);
  padding: 12px 14px;
  font-size: 18px;
  text-align: center;
}
.text-input:focus { outline: none; border-color: var(--ink); }

/* --- START ------------------------------------------------------------------ */
.start-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  width: 100%;
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
  padding: var(--s4) var(--s3);
  min-height: 200px;
  justify-content: flex-end;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease;
  text-align: left;
}
.choice-card:hover { transform: translateY(-2px); }
.choice-create:hover { border-color: var(--pink); }
.choice-join:hover { border-color: var(--blue); }
.choice-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.choice-meta { color: var(--ink-soft); font-size: 15px; }

.join-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}
.join-actions { display: flex; gap: var(--s2); }

/* --- code (input + display) ------------------------------------------------- */
.code { display: flex; gap: var(--s1); }
.code-cell {
  width: 56px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  background: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}
.code-cell:focus { outline: none; border-color: var(--ink); }
.code-cell--static {
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.code--display .code-cell--static { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --- ROOM ------------------------------------------------------------------- */
.room { gap: var(--s2); }
.room-actions { margin-top: var(--s1); }
.presence {
  display: flex;
  align-items: center;
  gap: var(--s1);
  margin-top: var(--s2);
  color: var(--ink-soft);
  font-size: 15px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--on { background: #1f7a4d; }
.dot--waiting {
  background: transparent;
  border: 2px solid var(--ink-soft);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.3; } }

/* --- PROFILE ---------------------------------------------------------------- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  width: 100%;
}
.profile-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.profile-panel--peer.is-empty { opacity: 0.5; }
.peer-name { font-size: 20px; font-weight: 600; min-height: 28px; }
.peer-ready { color: #1f7a4d; font-weight: 600; min-height: 22px; }

.swatches { display: flex; gap: var(--s2); }
.swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--line);
  transition: transform 120ms ease;
}
.swatch--pink { background: var(--pink); }
.swatch--blue { background: var(--blue); }
.swatch.is-selected { transform: scale(1.08); border-color: var(--ink); }
.swatch--peer { width: 40px; height: 40px; }
.swatch--peer[data-color="pink"] { background: var(--pink); }
.swatch--peer[data-color="blue"] { background: var(--blue); }
.ready-btn { margin-top: var(--s1); }

/* --- LAYOUT ----------------------------------------------------------------- */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  width: 100%;
  max-width: 520px;
}
.layout-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s4) var(--s3);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.layout-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(23, 24, 28, 0.1); }
/* selection borders shared by layout cards + theme tiles */
.layout-card.is-selected,
.theme-tile.is-selected { border-width: 2px; }
.layout-card[data-pick-color="pink"],
.theme-tile[data-pick-color="pink"] { border-color: var(--pink); }
.layout-card[data-pick-color="blue"],
.theme-tile[data-pick-color="blue"] { border-color: var(--blue); }
/* both players on the same card -> split P1/P2 border (set via inline border-image) */
.layout-card.is-pair,
.theme-tile.is-pair { border-style: solid; }

/* the strip motif: black strip with white photo slots */
.mini-strip {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--ink);
  border-radius: var(--r-frame);
}
.mini-strip--vertical { grid-template-columns: 1fr; width: 62px; }
.mini-strip--grid { grid-template-columns: 1fr 1fr; width: 122px; }
.mini-slot {
  background: var(--paper-raised);
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: scale(0.6);
  animation: slot-in 340ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes slot-in { to { opacity: 1; transform: none; } }

.layout-card.is-selected .mini-strip { animation: strip-pop 320ms ease; }
@keyframes strip-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.layout-cap {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.ready-dots { display: flex; gap: 10px; }
.ready-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  transition: background 180ms ease, transform 180ms ease;
}
.ready-dot[data-color="pink"] { border-color: var(--pink); }
.ready-dot[data-color="blue"] { border-color: var(--blue); }
.ready-dot.is-ready { transform: scale(1.15); }
.ready-dot.is-ready[data-color="pink"] { background: var(--pink); }
.ready-dot.is-ready[data-color="blue"] { background: var(--blue); }

/* --- THEME (swipe gallery) -------------------------------------------------- */
.scene.theme { gap: var(--s2); }
.theme-track {
  display: flex;
  gap: var(--s3);
  width: 100%;
  max-width: 520px;
  padding: var(--s2) var(--s1);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  justify-content: safe center; /* center when few; don't clip the start when many */
  scrollbar-width: none;
}
.theme-track::-webkit-scrollbar { display: none; }
.theme-tile {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  scroll-snap-align: center;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.theme-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(23, 24, 28, 0.1); }
.theme-tile.is-selected .theme-strip { animation: strip-pop 320ms ease; }

.theme-strip {
  display: grid;
  gap: 6px;
  padding: 8px 8px 14px;
  border-radius: var(--r-frame);
  box-shadow: inset 0 0 0 1px rgba(23, 24, 28, 0.08); /* edge for light themes */
}
.theme-strip[data-layout="vertical"] { grid-template-columns: 1fr; width: 84px; }
.theme-strip[data-layout="grid"] { grid-template-columns: 1fr 1fr; width: 134px; }
.theme-slot {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #cdd2db, #b9bfca);
}
.theme-footer {
  grid-column: 1 / -1;
  height: 7px;
  margin-top: 2px;
  border-radius: 1px;
}
.theme-cap {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.gallery-dots { display: flex; gap: 8px; }
.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--line);
  transition: background 160ms ease, transform 160ms ease;
}
.gallery-dot.is-active { background: var(--ink-soft); transform: scale(1.25); }

/* --- BOOTH ------------------------------------------------------------------ */
.scene.booth { gap: var(--s2); max-width: 880px; }

.shot-counter {
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 200ms ease;
}
.shot-counter.is-on { opacity: 1; }

.booth-stage { position: relative; width: 100%; }

.booth-feeds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  width: 100%;
}
.booth-feed {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--ink);
  border-radius: var(--r-frame);
  overflow: hidden;
}
.booth-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* hidden full-res camera source (feeds the preview + the real photos) */
.src-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.feed-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-raised);
}
.feed-tag[data-color="pink"] { background: var(--pink); color: #fff; }
.feed-tag[data-color="blue"] { background: var(--blue); color: #fff; }

.feed-status {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s2);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  background: var(--ink);
}
.booth-feed.cam-pending .feed-status { display: flex; }
.booth-feed.is-live .feed-status { display: none; }

.countdown {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 120px;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.countdown.is-on { display: flex; }
.countdown.pop { animation: count-pop 1000ms ease-out; }
@keyframes count-pop {
  0% { opacity: 0; transform: scale(1.6); }
  20% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.85; transform: scale(0.92); }
}

.booth-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.booth-flash.fire { animation: flash 420ms ease-out; }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }

.booth-thumbs,
.edit-pool {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  justify-content: center;
  min-height: 4px;
}
.edit-pool { margin-top: var(--s2); }
.booth-thumb {
  width: 96px;
  aspect-ratio: 2 / 1;
  border-radius: var(--r-frame);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  animation: thumb-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.booth-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes thumb-in { from { opacity: 0; transform: scale(0.85) translateY(6px); } to { opacity: 1; transform: none; } }

.booth-gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  background: rgba(248, 249, 251, 0.92);
  backdrop-filter: blur(4px);
  z-index: 50;
}
.booth-gate.is-hidden { display: none; }
.gate-text { color: var(--ink-soft); font-size: 15px; text-align: center; max-width: 320px; }

/* --- EDIT (strip builder) --------------------------------------------------- */
.scene.edit { gap: var(--s2); max-width: 820px; }
.edit-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s3);
  width: 100%;
  align-items: start;
}
.edit-left { min-width: 0; }
.edit-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
}

.edit-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s1);
}
.edit-pool-item {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  overflow: hidden;
  background: var(--paper-raised);
  aspect-ratio: 2 / 1;
  transition: transform 120ms ease, opacity 140ms ease, border-color 120ms ease;
}
.edit-pool-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-pool-item:hover { transform: translateY(-2px); border-color: var(--ink); }
.edit-pool-item.is-placed { opacity: 0.32; }

.edit-strip {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-frame);
  box-shadow: inset 0 0 0 1px rgba(23, 24, 28, 0.08), var(--shadow-soft);
}
.edit-strip[data-layout="vertical"] { grid-template-columns: 200px; }
.edit-strip[data-layout="grid"] { grid-template-columns: 160px 160px; }

.edit-slot {
  position: relative;
  padding: 0;
  border: none;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.18);
}
.edit-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-slot.is-empty img { display: none; }
.slot-plus {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(127, 127, 127, 0.7);
}
.edit-slot.is-empty .slot-plus { display: flex; }

/* --- DOWNLOAD --------------------------------------------------------------- */
.scene.download { gap: var(--s2); }
.dl-preview { display: flex; justify-content: center; }
.dl-canvas {
  max-height: 56vh;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-frame);
  box-shadow: var(--shadow-soft);
}
.dl-actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.dl-hd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s1);
  margin-top: var(--s1);
}
.dl-badge { font-size: 14px; font-weight: 600; color: #1f7a4d; }
.btn-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 6px;
}
.btn-link:hover { color: var(--ink); }
.dl-restart { margin-top: var(--s1); }

/* --- placeholder (phase 2 stub) --------------------------------------------- */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s1);
}
.placeholder-tag {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  letter-spacing: -0.02em;
}
.placeholder-note { color: var(--ink-soft); }

/* --- toast ------------------------------------------------------------------ */
#toast {
  position: fixed;
  left: 50%;
  bottom: var(--s4);
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--r-ctrl);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
#toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- cursors overlay (Design.md §3) ----------------------------------------- */
#cursors {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.cursor {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.cursor-arrow {
  display: block;
  width: 26px;
  height: 26px;
  background: var(--pink);
  clip-path: polygon(0 0, 0 78%, 26% 60%, 44% 100%, 60% 92%, 42% 54%, 74% 54%);
  filter: drop-shadow(1px 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);
}
.cursor[data-color="pink"] .cursor-arrow { background: var(--pink); }
.cursor[data-color="blue"] .cursor-arrow { background: var(--blue); }

/* same-color pair: 2nd player gets a dashed white ring instead of a new hue */
.cursor--alt::before {
  content: "";
  position: absolute;
  left: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  border: 2px dashed #fff;
  border-radius: 50%;
  opacity: 0.9;
}

.cursor-tag {
  position: absolute;
  left: 22px;
  top: 18px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.cursor[data-color="pink"] .cursor-tag { background: var(--pink-tint); }
.cursor[data-color="blue"] .cursor-tag { background: var(--blue-tint); }
.cursor--showtag .cursor-tag { opacity: 1; transform: none; }

.cursor-pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  transform: translate(-50%, -50%);
  animation: cursor-pulse 480ms ease-out forwards;
}
.cursor-pulse[data-color="blue"] { border-color: var(--blue); }
@keyframes cursor-pulse {
  from { opacity: 0.7; width: 8px; height: 8px; }
  to   { opacity: 0; width: 44px; height: 44px; }
}

/* --- account (avatar button + overlay + history) ---------------------------- */
.avatar-btn {
  position: fixed;
  top: var(--s2);
  right: var(--s2);
  z-index: 60;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  transition: transform 120ms ease, border-color 120ms ease;
}
.avatar-btn:hover { transform: translateY(-1px); border-color: var(--ink-soft); }
/* guest: a Lucide user glyph; signed in: the email initial */
.avatar-btn.is-guest { color: var(--ink-soft); }

.acct-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--s4) var(--s2);
  background: rgba(23, 24, 28, 0.32);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.acct-overlay.is-open { display: flex; animation: scene-in 160ms ease both; }

.acct-panel {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}
.acct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.acct-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 4px;
}
.acct-close:hover { color: var(--ink); }

.acct-identity { display: flex; flex-direction: column; gap: var(--s1); }
.acct-email-row { display: flex; gap: var(--s1); }
.acct-email-row .acct-email { max-width: none; flex: 1; text-align: left; font-size: 15px; }
.acct-email-row .btn { white-space: nowrap; }
.acct-or { text-align: center; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.06em; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-google:hover:not(:disabled) { border-color: var(--ink-soft); }

.acct-empty-mark .icon { color: var(--line); }

.acct-note { font-size: 13px; color: var(--ink-soft); }
.acct-note.is-ok { color: #1f7a4d; }
.acct-sep { height: 1px; background: var(--line); margin: var(--s1) 0; }
.acct-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--s1);
}
.acct-thumb {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  transition: transform 120ms ease, border-color 120ms ease;
}
.acct-thumb:hover { transform: translateY(-2px); border-color: var(--ink); }
.acct-thumb img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  display: block;
  background: var(--paper);
}
.acct-thumb-missing {
  width: 100%;
  height: 130px;
  background: repeating-linear-gradient(45deg, var(--line), var(--line) 6px, transparent 6px, transparent 12px);
}
.acct-thumb-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
}
.acct-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s1);
  padding: var(--s4) 0;
}
.acct-empty-mark { font-size: 34px; color: var(--line); }

.acct-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s3);
  background: rgba(23, 24, 28, 0.62);
  animation: scene-in 140ms ease both;
}
.acct-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  max-height: 92vh;
}
.acct-lightbox-inner img {
  max-height: 80vh;
  max-width: 100%;
  border-radius: var(--r-frame);
  box-shadow: var(--shadow-soft);
}
.acct-lightbox-actions { display: flex; gap: var(--s1); }
.acct-lightbox-actions .btn { text-decoration: none; }
.acct-del:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); }

/* --- payment success -------------------------------------------------------- */
.pay-success {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s3) var(--s2);
  background: rgba(23, 24, 28, 0.32);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: scene-in 160ms ease both;
}
.pay-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.pay-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pink-tint);
  color: #1f7a4d;
}
.pay-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.pay-sub { margin: 0; color: var(--ink-soft); font-size: 15px; }
.pay-downloads {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  width: 100%;
  margin-top: var(--s1);
}
.pay-downloads .btn { width: 100%; text-decoration: none; }
.pay-card .acct-sep { width: 100%; }
.pay-cta { display: flex; flex-direction: column; align-items: center; gap: var(--s1); width: 100%; }
.pay-cta .btn { width: 100%; }
.pay-cta-note { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* --- responsive ------------------------------------------------------------- */
@media (max-width: 560px) {
  .start-choices,
  .profile-grid { grid-template-columns: 1fr; }
  .code-cell { width: 46px; height: 60px; font-size: 28px; }
  .acct-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .scene { animation: none; }
  .dot--waiting,
  .cursor-pulse,
  .mini-slot { animation: none; }
  .mini-slot { opacity: 1; transform: none; }
  .layout-card.is-selected .mini-strip,
  .theme-tile.is-selected .theme-strip,
  .booth-thumb { animation: none; }
  .countdown.pop { animation: count-pop-reduced 1000ms steps(1) both; }
  .booth-flash.fire { animation: none; }
  @keyframes count-pop-reduced { 0%, 100% { opacity: 1; transform: none; } }
  .btn,
  .choice-card,
  .layout-card,
  .theme-tile,
  .gallery-dot,
  .ready-dot,
  .edit-pool-item,
  .cursor-tag { transition: none; }
}
