/* Buying website styles. Every colour, size and radius comes from tokens.css. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: var(--text-body-size);
  line-height: 1.4;
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

h1 { font-size: var(--text-title-large-size); font-weight: var(--text-title-large-weight); line-height: 1.2; }
h2 { font-size: var(--text-title-large-size); font-weight: var(--text-title-large-weight); line-height: 1.2; }

.muted { color: var(--color-text-secondary); }
.strong { font-weight: var(--text-body-strong-weight); }
.overline {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-overline-size);
  font-weight: var(--text-overline-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.overline.accent { color: var(--color-accent-text); }

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 var(--space-xxl);
  background: var(--color-panel);
  border-bottom: 1px solid var(--color-border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-window-title-size);
  font-weight: var(--text-window-title-weight);
}
.signed-in { color: var(--color-info); font-weight: var(--text-body-strong-weight); }

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-xxl);
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-xxl);
}
@media (max-width: 820px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: var(--space-lg); }
}

.show { display: flex; flex-direction: column; gap: var(--space-lg); }
.show-heading { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-danger);
  color: var(--color-on-danger);
  font-size: var(--text-caption-size);
  font-weight: 700;
}
.live-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-on-danger); }

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.card.empty, .empty { text-align: center; padding: var(--space-xxl); }
.card.empty { gap: var(--space-xs); }

.price-row { display: flex; align-items: baseline; gap: var(--space-lg); }
.price {
  color: var(--color-accent);
  font-size: var(--text-price-size);
  font-weight: var(--text-price-weight);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stock { color: var(--color-text-secondary); font-weight: var(--text-body-strong-weight); }
.stock.sold-out { color: var(--color-danger-text); }
.hint { color: var(--color-text-secondary); }

.button {
  min-height: 36px;
  padding: 0 var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-raised);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--text-body-strong-weight);
  cursor: pointer;
  transition: filter var(--motion-transition) ease-out, background var(--motion-transition) ease-out;
}
.button:hover:not(:disabled) { background: var(--color-selected); }
.button.primary {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
}
.button.primary:hover:not(:disabled) { background: var(--color-accent); filter: brightness(1.06); }
.button.primary:active:not(:disabled) { filter: brightness(0.94); }
.button.ghost { background: transparent; }
.button.large { min-height: 44px; font-size: 14px; }
.button:disabled { opacity: 0.4; cursor: default; }

:focus-visible { outline: 2px solid rgb(255 138 76 / 0.6); outline-offset: 2px; }

.notice {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-caption-size);
}
.notice.success { background: var(--color-success-tint); color: var(--color-success); }
.notice.danger { background: var(--color-danger-tint); color: var(--color-danger-text); }
.notice.info { background: var(--color-info-tint); color: var(--color-info-text); }

.purchases { display: flex; flex-direction: column; gap: var(--space-sm); }
.purchases li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-lg);
  min-height: 44px;
  border-bottom: 1px solid var(--color-border-subtle);
}
.status { color: var(--color-text-secondary); font-size: var(--text-caption-size); font-weight: 600; }
.status.success { color: var(--color-success); }
.status.danger { color: var(--color-danger-text); }

.account form { display: flex; flex-direction: column; gap: var(--space-md); }
.account .actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.tabs { display: flex; gap: var(--space-xs); }
.tab {
  height: 30px;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  cursor: pointer;
}
.tab.selected { background: var(--color-selected); color: var(--color-text); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.field label { color: var(--color-text-secondary); font-size: var(--text-caption-size); }
.field input {
  height: 36px;
  width: 100%;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
}
.field input:focus { outline: 1px solid var(--color-accent); border-color: var(--color-accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* The seller's live video: 16:9 on black, a second camera inset in the corner. */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-video-black, #000);
  border-radius: 10px;
  overflow: hidden;
}
.video-stage { position: absolute; inset: 0; }
.video-stage video.main { width: 100%; height: 100%; object-fit: contain; }
.video-stage video.inset {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  width: 132px;
  height: 74px;
  object-fit: cover;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border);
}
.video-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-secondary);
}
.video-sound { position: absolute; left: var(--space-md); bottom: var(--space-md); }
.video-overlay {
  position: absolute;
  left: var(--space-md);
  bottom: var(--space-md);
  max-width: calc(100% - 2 * var(--space-md));
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: color-mix(in srgb, var(--color-panel) 92%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
}
.video-overlay .strong:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-viewers {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-caption-size, 12px);
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-panel) 80%, transparent);
  border-radius: var(--radius-sm, 6px);
}
/* The sound button moves up when the lot is drawn below it. */
.video:has(.video-overlay) .video-sound { bottom: calc(var(--space-md) * 2 + 36px); }
.video-overlay .accent { color: var(--color-accent); }

/* Chat: the pinned message, the messages, and the box to write in. */
.chat { display: flex; flex-direction: column; gap: var(--space-md); }
.chat-pinned {
  padding: var(--space-md);
  background: var(--color-raised);
  border-radius: var(--radius-md);
}
.chat-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  height: 320px;
  overflow-y: auto;
}
.chat-message { line-height: 1.4; overflow-wrap: anywhere; }
.chat-name { color: var(--color-info); font-weight: 600; }
.chat-name.seller { color: var(--color-accent-text); }
.chat-form { display: flex; gap: var(--space-sm); }
.chat-form input { flex: 1; min-width: 0; }
.chat-form input {
  height: 36px;
  padding: 0 var(--space-md);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
}
.chat-form input:focus { outline: 1px solid var(--color-accent); border-color: var(--color-accent); }
/* The account and the chat stack in the side column. */
.account-column { display: flex; flex-direction: column; gap: var(--space-lg); }


/* The item on sale: picture, what it is, what it costs, the way to buy. */
.item-card-wrap { display: flex; flex-direction: column; gap: var(--space-sm); }
.item-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  min-height: 176px;
  box-sizing: border-box;
}
.item-image {
  width: 144px;
  height: 144px;
  flex: none;
  border-radius: var(--radius-lg);
  background: var(--color-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}
.item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-md); }
.item-top { display: flex; flex-direction: column; gap: 6px; }
.item-status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.item-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}
.item-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-secondary); display: inline-block; }
.item-card.selling .item-status { color: var(--color-text); }
.item-card.selling .item-dot { background: var(--color-danger); animation: item-pulse 1.6s ease-in-out infinite; }
.item-card.sold-out .item-dot { background: var(--color-danger-text); }
.item-card.sold-out .item-status { color: var(--color-danger-text); }
.item-qty { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; }
.item-title {
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
  color: var(--color-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.item-detail {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); }
.item-price-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-price-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--color-text-secondary); }
.item-price {
  font-size: 26px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.item-card.sold-out .item-price { color: var(--color-text-secondary); text-decoration: line-through; }
.item-buy {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 22px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: filter var(--motion-transition) ease-out;
}
.item-buy:hover:not(:disabled) { filter: brightness(1.06); }
.item-buy:active:not(:disabled) { filter: brightness(0.94); }
.item-buy:disabled { background: var(--color-raised); color: var(--color-text-secondary); cursor: default; }
.item-buy:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.item-buy-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: right;
  max-width: 50%;
}
/* Waiting for the show, and nothing on sale: the frame without a price. */
.item-card.idle .item-top, .item-card.loading .item-top { justify-content: center; height: 100%; }
.item-card.idle .item-body, .item-card.loading .item-body { justify-content: center; }
.item-card.loading .item-title {
  height: 22px;
  width: 60%;
  border-radius: var(--radius-sm);
  background: var(--color-raised);
}
.item-card.loading .item-image { animation: item-fade 1.2s ease-in-out infinite alternate; }
@keyframes item-pulse { 50% { opacity: 0.35; } }
@keyframes item-fade { from { opacity: 0.6; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .item-card.selling .item-dot, .item-card.loading .item-image { animation: none; }
}
/* Phones: a smaller picture beside the same text. */
@media (max-width: 480px) {
  .item-card { gap: var(--space-md); padding: var(--space-md); min-height: 0; }
  .item-image { width: 96px; height: 96px; }
  .item-price { font-size: 22px; line-height: 24px; }
  .item-buy { padding: 0 16px; }
}

/* The header: the store's name links home; Sign in opens the account menu. */
a.brand { color: var(--color-text); text-decoration: none; }
.brand-logo { border-radius: var(--radius-sm); object-fit: cover; }
.button.pill { border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button.large.pill { border-radius: 22px; padding: 0 22px; font-size: 15px; }
a.button { color: var(--color-text); }
a.button.primary { color: var(--color-on-accent); }
.top-bar .signed-in { border-color: transparent; }
.top-bar { position: relative; }
.account-menu {
  position: absolute;
  right: var(--space-xxl);
  top: calc(100% + 8px);
  z-index: 10;
  width: min(360px, calc(100vw - 2 * var(--space-lg)));
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  border-radius: var(--radius-lg);
}
/* The menu's ×, in its top-right corner; the panel's first line leaves room for it. */
.account-menu .menu-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.account-menu .menu-close:hover { background: var(--color-selected); color: var(--color-text); }
.account-menu .menu-close:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.account-menu .card > :first-child { padding-right: 28px; }
.site { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1; width: 100%; }
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-xl) var(--space-xxl);
  font-size: var(--text-caption-size);
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: var(--text-body-strong-weight); color: var(--color-accent-text); text-decoration: none; margin-bottom: var(--space-md); }
.back-link::before { content: "‹"; font-size: 18px; line-height: 1; }
.back-link:hover { color: var(--color-accent); }

/* The home page. */
.home-page { max-width: 1120px; margin: 0 auto; padding: var(--space-xxl); }
.home { display: flex; flex-direction: column; gap: 32px; }
.home-banner {
  aspect-ratio: 3 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-panel);
  border: 1px solid var(--color-border-subtle);
}
.home-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-intro { display: flex; flex-wrap: wrap; gap: var(--space-xxl); align-items: flex-end; }
.home-intro.overlaps { margin-top: -72px; padding: 0 var(--space-xxl); }
.home-logo {
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 20px;
  object-fit: cover;
  background: var(--color-raised);
  border: 4px solid var(--color-bg);
}
.home-name { flex: 999 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.home-name h1 { font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -0.01em; }
.home-name p { font-size: 16px; }

.live-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
  border-radius: 16px;
  background: var(--color-accent-tint);
  border: 1px solid #5A3A28;
}
.live-cover, .upcoming-cover { aspect-ratio: 16 / 9; flex: none; border-radius: 10px; background: var(--color-video-black); overflow: hidden; }
.live-cover { width: 192px; }
.live-cover img, .upcoming-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-now-text { flex: 999 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.live-now-text h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.live-now-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.live-now-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); }

.home-columns { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.upcoming { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.home-columns.single .upcoming { flex-basis: 100%; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.section-heading h2, .about h2 { font-size: 20px; font-weight: 700; }
.upcoming-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.upcoming-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  border: 1px solid var(--color-border-subtle);
}
.date-block { width: 56px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: var(--color-raised); }
.date-block .weekday { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--color-accent); }
.date-block .day { font-size: 22px; line-height: 26px; font-weight: 800; }
.date-block .month { font-size: 11px; color: var(--color-text-secondary); }
.upcoming-cover { width: 112px; border-radius: var(--radius-md); }
.upcoming-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upcoming-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-item .button { flex: none; }
.upcoming-empty {
  padding: var(--space-xxl);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  border: 1px dashed var(--color-border);
  color: var(--color-text-secondary);
  text-align: center;
}

.about { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-lg); }
.about-text { color: #D0D0D6; white-space: pre-line; }
.about-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.about-photos img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; display: block; background: var(--color-panel); }
.about-details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  border: 1px solid var(--color-border-subtle);
}
.about-details dt { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--color-text-secondary); text-transform: uppercase; }
.about-details dd { margin: 2px 0 0; }

/* Phones: one column; the list hides its covers to keep the titles. */
@media (max-width: 600px) {
  .home-page { padding: var(--space-lg); }
  .home { gap: var(--space-xxl); }
  .home-intro.overlaps { margin-top: -40px; padding: 0 var(--space-md); }
  .home-logo { width: 72px; height: 72px; border-radius: 16px; border-width: 3px; }
  .home-name h1 { font-size: 24px; line-height: 30px; }
  .live-cover { width: 100%; }
  .live-now .button { width: 100%; }
  .upcoming-cover { display: none; }
  .upcoming-item { gap: var(--space-md); padding: 10px; }
  .account-menu { right: var(--space-lg); }
  .site-footer { padding: var(--space-lg); }
}

/* A field's rule while it is unmet, or what is wrong with it. */
.field-note { display: block; margin-top: 4px; font-size: var(--text-caption-size); color: var(--color-text-secondary); }
.field-note.error { color: var(--color-danger-text); }
.field.invalid input { border-color: var(--color-danger-border); }

/* Coming soon: the store's name and message, centred, nothing to buy. */
.coming-soon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: 48px var(--space-xxl);
  text-align: center;
  border-radius: 16px;
  background: var(--color-panel);
  border: 1px solid var(--color-border-subtle);
}
.coming-soon-card h1 { font-size: 30px; line-height: 36px; font-weight: 800; }
.coming-soon-card .muted { font-size: 16px; }
.coming-soon-message { font-size: 18px; max-width: 520px; white-space: pre-line; }
.home-banner + .coming-soon-card { margin-top: -56px; margin-left: var(--space-xxl); margin-right: var(--space-xxl); }
@media (max-width: 600px) {
  .home-banner + .coming-soon-card { margin: -32px var(--space-md) 0; }
  .coming-soon-card { padding: 32px var(--space-lg); }
}

/* Testing mode: a band above everything, on every page. */
.testing-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-warning);
  color: #1A1405;
  font-weight: var(--text-body-strong-weight);
  text-align: center;
}
.testing-banner-label {
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  background: #1A1405;
  color: var(--color-warning);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
