/* Shared design of every Stan screen: mobile first, one pastel per group, violet for actions. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
  --ink: #1e1b2e;
  --ink-soft: #4a4560;
  --muted: #7a7590;
  --paper: #ffffff;
  --action: #5b3fd0;
  --action-soft: #efebff;
  --action-faint: #f4f1ff;
  --pink: #ffe0ea;
  --lilac: #e6deff;
  --mint: #d3f5e4;
  --sky: #d9e8ff;
  --sun: #fff0b8;
  --peach: #ffe3cf;
  --dispute-ink: #b34700;
  --radius-card: 24px;
  --radius-photo: 18px;
  --radius-control: 16px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* An element marked hidden stays hidden, whatever display its own rule asks for. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--ink); }
a:hover { color: var(--action); }

h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }

/* A screen is one column that fills the phone and stays readable on a desktop. */
.screen { min-height: 100dvh; max-width: 480px; margin: 0 auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* Buttons: 44px or taller so they are easy to hit with a thumb. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--radius-control); background: var(--action); color: #fff; font: 700 16px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { color: #fff; filter: brightness(1.08); }
.btn-soft { background: var(--action-soft); color: var(--action); }
.btn-soft:hover { color: var(--action); }

/* Member photocard: pastel frame, 3:4 photo, name and status chip. */
.card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: var(--radius-card); background: var(--pink); color: var(--ink); text-decoration: none; }
.card-pink { background: var(--pink); }
.card-lilac { background: var(--lilac); }
.card-mint { background: var(--mint); }
.card-sky { background: var(--sky); }
.card-sun { background: var(--sun); }
.card-peach { background: var(--peach); }
.photo { aspect-ratio: 3 / 4; border-radius: var(--radius-photo); background: rgba(255, 255, 255, 0.8); object-fit: cover; width: 100%; }
.card-name { padding: 0 6px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* Status chips: owned, free, interested and in dispute. */
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px; padding: 4px 12px; border-radius: 999px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.chip-owned { background: var(--action); color: #fff; }
.chip-eye { color: var(--action); }
.chip-dispute { background: var(--sun); color: var(--dispute-ink); }

/* On a desktop the same screens sit beside a sidebar instead of under a bottom bar. */
@media (min-width: 900px) {
  .screen { max-width: 720px; padding-top: 32px; }
}

/* Start screen: the name, one sentence and the way in, centered on the phone. */
.start { justify-content: center; }
.start-body { display: flex; flex-direction: column; gap: 16px; }
.start-body[hidden] { display: none; }
.start-lead { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.btn-google { background: #fff; color: var(--ink); border: 1.5px solid var(--action-soft); box-shadow: 0 1px 2px rgba(30, 27, 46, 0.06); }
.btn-google:hover { color: var(--ink); background: var(--action-faint); filter: none; }

/* A notice for something that went wrong, shown above the action that retries it. */
.notice { margin: 0; padding: 12px 16px; border-radius: var(--radius-control); background: var(--sun); color: var(--dispute-ink); font-size: 14px; font-weight: 600; }
.notice[hidden] { display: none; }

/* Navigation: a bottom bar on the phone, a sidebar on a desktop. */
.view { padding-bottom: 104px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 20px 20px; padding: 6px; background: var(--action-faint); border-radius: 20px; max-width: 440px; margin-inline: auto; width: calc(100% - 40px); }
.tabbar a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 16px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.tabbar a:hover { color: var(--action); }
.tabbar a[aria-current="page"] { background: var(--action); color: #fff; font-weight: 700; }
.tabbar[hidden] { display: none; }

@media (min-width: 900px) {
  .view { margin-left: 240px; padding-bottom: 28px; }
  .tabbar { top: 0; right: auto; bottom: 0; left: 0; width: 220px; max-width: none; margin: 0; padding: 24px 12px; grid-template-columns: 1fr; grid-auto-rows: 48px; align-content: start; border-radius: 0; }
  .tabbar a { justify-content: flex-start; padding: 0 16px; font-size: 15px; }
}

/* Lists of things to pick, and stacked screens. */
.stack { display: flex; flex-direction: column; gap: 16px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.list-item { width: 100%; min-height: 64px; padding: 0 20px; border: 0; border-radius: var(--radius-card); background: var(--lilac); color: var(--ink); font: 700 18px var(--font); letter-spacing: -0.02em; text-align: left; cursor: pointer; }
.list-item:hover { filter: brightness(0.97); }

/* Forms. */
.label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: -8px; }
.field { height: 56px; box-sizing: border-box; padding: 0 18px; border: 0; border-radius: var(--radius-control); background: var(--action-faint); color: var(--ink); font: 400 16px var(--font); outline: none; }
.field:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.back { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: 24px; text-decoration: none; }
.list-row { padding: 16px 20px; border-radius: var(--radius-control); background: var(--action-faint); font-weight: 600; }
.invite-link { margin: 0; padding: 16px; border-radius: 18px; background: var(--action-faint); color: var(--ink-soft); font-size: 14px; word-break: break-all; }

.page-head { display: flex; flex-direction: column; gap: 4px; }
.small { font-size: 13px; }
.btn-small { min-height: 44px; }
.add { min-height: 52px; display: flex; align-items: center; justify-content: center; border: 2px dashed #B9A9F5; border-radius: 20px; color: var(--action); font-size: 14px; font-weight: 700; text-decoration: none; }

/* Members. */
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-grid .card { text-decoration: none; color: var(--ink); }
.photo-grid .photo { width: 100%; object-fit: cover; }
.preview { width: 100%; max-height: 320px; object-fit: cover; border-radius: 28px; }
.file { font: 400 14px var(--font); }
.btn-link { background: none; color: var(--muted); }
.btn-danger-text { color: #C2255C; }
.btn-danger { background: #C2255C; color: #fff; }
.dialog { display: flex; flex-direction: column; gap: 14px; padding: 24px 20px 20px; border-radius: 28px; background: #fff; box-shadow: 0 8px 40px rgba(30, 27, 46, 0.25); }
.dialog h2 { margin: 0; font-size: 22px; }
.dialog p { margin: 0; color: var(--ink-soft); line-height: 1.5; font-size: 14px; }

/* Group view: toggle, carousel and status chips. */
.bar { display: flex; align-items: center; gap: 8px; }
.segmented { flex-grow: 1; display: flex; padding: 4px; border-radius: 14px; background: var(--action-faint); }
.segmented button { flex: 1 1 0; min-height: 36px; border: 0; border-radius: 11px; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--action); color: #fff; font-weight: 700; }
.plus { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--action-soft); color: var(--action); font-size: 22px; font-weight: 700; text-decoration: none; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip-owned { background: var(--action); color: #fff; }
.chip-eye { background: #fff; color: var(--action); }
.chip-free { background: #fff; color: var(--ink-soft); }
.chip-dispute { background: var(--sun); color: var(--dispute-ink); }
.counter { align-self: flex-end; background: var(--action-faint); color: var(--action); font-weight: 700; }
.carousel .card-large { display: flex; flex-direction: column; padding: 10px; border-radius: 32px; text-decoration: none; color: var(--ink); }
.carousel .card-large .photo { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 24px; background: rgba(255, 255, 255, 0.8); }
.carousel .card-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.steps { display: flex; justify-content: center; gap: 12px; }
.step { min-height: 44px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--action-faint); color: var(--action); font: 700 14px var(--font); cursor: pointer; }
.step:disabled { opacity: 0.4; cursor: default; }

/* Photocard. */
.card-full { padding: 12px; border-radius: 36px; }
.card-full .photo { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 26px; background: rgba(255, 255, 255, 0.8); }
.card-title { display: flex; flex-direction: column; gap: 2px; }
.card-title h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.actions { display: flex; flex-direction: column; gap: 10px; }

.btn-icon { background: var(--action-soft); color: var(--action); }
.icon { display: inline-flex; }

.turn { margin: 0; padding: 4px 20px 0 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; }

/* My members. */
.panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 24px; }
.panel h2 { margin: 0; display: flex; align-items: center; justify-content: space-between; font-size: 18px; letter-spacing: -0.02em; }
.count { padding: 4px 12px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.mini .photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; background: rgba(255, 255, 255, 0.8); }
.mini .card-name { font-size: 13px; font-weight: 600; padding: 0 2px; }

.mini input[type="radio"] { position: absolute; opacity: 0; }
.mini { position: relative; cursor: pointer; }
.mini:has(input:checked) .photo { outline: 3px solid var(--action); outline-offset: 2px; }

/* Trades. */
.trade-row { display: grid; grid-template-columns: 56px auto 56px 1fr; align-items: center; gap: 8px; padding: 10px; border-radius: 18px; background: #fff; color: var(--ink); text-decoration: none; }
.trade-row .photo { width: 56px; height: 72px; object-fit: cover; border-radius: 12px; background: rgba(0, 0, 0, 0.06); }
.trade-text { display: flex; flex-direction: column; gap: 2px; padding-left: 6px; }
.trade-arrow { font-size: 18px; font-weight: 700; }
.proposal .card-full .photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; }

/* Status as an icon alone. */
.chip-icon { justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0; flex: none; }
.chip-theirs { background: #fff; color: var(--ink-soft); }

/* Group cards: large, with the members' photos. */
.group-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; color: var(--ink); text-decoration: none; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-card .card-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-photo { position: relative; display: block; }
.tile .photo { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: rgba(255, 255, 255, 0.8); }
.tile .chip-icon { position: absolute; right: 4px; bottom: 4px; width: 26px; height: 26px; }
.tile .chip-icon svg { width: 14px; height: 14px; }
.member-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card .card-name, .group-card .member-name { color: var(--ink); }

/* Loading skeleton. */
.skeleton { display: block; border-radius: 16px; background: linear-gradient(90deg, #ece8fa 25%, #f6f4fd 50%, #ece8fa 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-title { height: 34px; width: 55%; }
.sk-card { height: 150px; border-radius: 28px; }
.sk-row { height: 64px; border-radius: 22px; }
.sk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sk-tile { aspect-ratio: 3 / 4; border-radius: 28px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Micro animations: short, soft, and always switched off for people who prefer less motion. */
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.5); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.view > :not([data-skeleton]) { animation: screen-in 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.card { animation: card-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.card:nth-child(2) { animation-delay: 50ms; }
.card:nth-child(3) { animation-delay: 100ms; }
.card:nth-child(4) { animation-delay: 150ms; }
.card:nth-child(5) { animation-delay: 200ms; }
.card:nth-child(n + 6) { animation-delay: 250ms; }
.chip-icon { animation: pop 320ms cubic-bezier(0.3, 1.4, 0.5, 1) both; }

.btn, .card, .add, .tabbar a { transition: transform 120ms ease, background-color 200ms ease, color 200ms ease, filter 200ms ease; }
.btn:active { transform: scale(0.97); }
.card:active { transform: scale(0.98); }
.add:active { transform: scale(0.98); }
.tabbar a:active { transform: scale(0.94); }

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

/* Choices such as the turn mode: a radio button with a title and a hint. */
.choices { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-control); background: var(--action-faint); cursor: pointer; }
.choice input { margin-top: 4px; accent-color: var(--action); }
.choice span { display: flex; flex-direction: column; gap: 2px; }
