/* ============================================================
   Party wall — guest upload page (/party) + screen (/party/wall).
   Mobile-first; leans on styles.css for tokens, fonts, .btn,
   .entry-input, .field-label, .brand and .site-tag.
   ============================================================ */

/* ---- upload page ---- */

.party-body {
  min-height: 100dvh;
  margin: 0;
  background: var(--rv-color-canvas);
  color: var(--rv-font-color-normal);
  font-family: var(--rv-font-sans);
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertically center the card, all screens */
  align-items: center;
}

.party-card {
  width: 100%;
  max-width: 430px;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@media (min-width: 560px) {
  .party-card {
    background: var(--rv-color-panel);
    border: 1px solid var(--rv-color-panel-border);
    border-radius: var(--rv-radius-l);
    padding: 32px 28px;
    margin: 24px 0;
  }
}

.party-brand { display: flex; align-items: center; gap: 9px; }
.party-brand .logo-img { height: 20px; width: auto; display: block; }
.party-brand .logo-dark { display: none; }
/* "Party" in a black box, matching the wall */
.party-brand-word {
  font-family: var(--rv-font-mono);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  border: 1px solid rgb(255 255 255 / .22);
  padding: 5px 9px;
  border-radius: 6px;
  line-height: 1;
}
@media (prefers-color-scheme: dark) {
  .party-brand .logo-light { display: none; }
  .party-brand .logo-dark { display: block; }
}
html[data-theme="light"] .party-brand .logo-dark { display: none; }
html[data-theme="light"] .party-brand .logo-light { display: block; }
html[data-theme="dark"] .party-brand .logo-light { display: none; }
html[data-theme="dark"] .party-brand .logo-dark { display: block; }

.party-form { display: flex; flex-direction: column; gap: 16px; }

.field-optional {
  font-family: var(--rv-font-mono);
  font-size: .9em;
  letter-spacing: .04em;
  color: var(--rv-font-color-lighter);
  text-transform: none;
}

.party-drop {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--rv-color-gray-300);
  border-radius: var(--rv-radius-l);
  background: var(--rv-color-gray-50);
  color: var(--rv-font-color-light);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}
.party-drop:hover { border-color: var(--rv-color-gray-400); }
.party-drop:active { transform: scale(.99); }
.party-drop:focus-visible { outline: var(--rv-focus-ring); outline-offset: 2px; }
.party-drop.has-photo { border-style: solid; border-color: var(--rv-color-panel-border); }

.party-previews {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr;
}
.party-previews[data-count="2"] { grid-template-columns: 1fr 1fr; }
.party-previews[data-count="3"] { grid-template-columns: 1fr 1fr; }
.party-previews[data-count="3"] img:first-child { grid-row: span 2; }
.party-previews[data-count="4"] { grid-template-columns: 1fr 1fr; }
.party-previews img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 0;
}

.party-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font: var(--rv-microlabel);
  letter-spacing: var(--rv-microlabel-tracking);
  text-transform: uppercase;
  color: #fff;
  background: rgb(0 0 0 / .55);
  padding: 7px 12px;
  border-radius: var(--rv-radius-full);
  backdrop-filter: blur(4px);
}

.party-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.party-drop-inner svg { width: 30px; height: 30px; }
.party-drop-label {
  font: var(--rv-microlabel);
  letter-spacing: var(--rv-microlabel-tracking);
  text-transform: uppercase;
}

.party-drop-change {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font: var(--rv-microlabel);
  letter-spacing: var(--rv-microlabel-tracking);
  text-transform: uppercase;
  color: #fff;
  background: rgb(0 0 0 / .55);
  padding: 7px 12px;
  border-radius: var(--rv-radius-full);
  backdrop-filter: blur(4px);
}

.party-error {
  color: var(--rv-color-red-500);
  font-size: var(--rv-font-size-small);
  text-align: center;
}

.party-submit { height: 48px; font-size: var(--rv-font-size-medium); }

.party-fineprint {
  font-size: var(--rv-font-size-x-small);
  color: var(--rv-font-color-lighter);
  line-height: 1.55;
  text-align: center;
  margin: 0 6px;
}

.party-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 36px 0 20px;
  text-align: center;
}
.party-done-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--rv-radius-full);
  background: var(--rv-color-alpha-1000);
  color: var(--rv-color-neutral-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.party-done-title {
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: -.01em;
}
.party-done-sub {
  font-size: var(--rv-font-size-x-small);
  color: var(--rv-font-color-lighter);
}


/* ===== wall screen ===== */

.wall-body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: #0a0a0a;
  color: #ebebeb;
  font-family: var(--rv-font-sans);
}
.wall-body.wall-idle { cursor: none; }

/* accent tints for the backdrop + highlights */
:root { --wall-accent: #ebebeb; }
.wall-body.accent-warm { background: #120c0a; }
.wall-body.accent-cool { background: #080d12; }
.wall-body.accent-mono { background: #000; }
.accent-warm { --wall-accent: #f6b17a; }
.accent-cool { --wall-accent: #7db6ff; }
.accent-mono { --wall-accent: #fff; }

.wall-frame { display: flex; height: 100dvh; width: 100vw; }
.wall-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.wall-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* brand lockup, top-left: Reve wordmark + "Party" in a black box */
.wall-brand {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);   /* centered on the main screen */
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: none;
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / .6));  /* legible over photos */
}
.wall-brand-mark { height: 22px; display: block; }
.wall-brand-tag, .wall-empty-tag {
  font-family: var(--rv-font-mono);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  border: 1px solid rgb(255 255 255 / .28);
  padding: 5px 9px;
  border-radius: 6px;
  line-height: 1;
}

/* ---- scrollers ---- */
.wall-track { will-change: transform; }
.wall-track-y { display: flex; flex-direction: column; }
.wall-track-x { display: flex; flex-direction: row; height: 100%; align-items: center; }
.wall-track-static.wall-track-y { justify-content: center; height: 100%; }
.wall-track-static.wall-track-x { justify-content: center; width: 100%; }

/* ---- individual photo ---- */
.wall-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #141414;
  flex: 0 0 auto;
}
.wall-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* caption: name (Reve sans) + @instagram (Reve mono) over a gradient scrim */
.wall-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 22px 12px 10px;
  background: linear-gradient(0deg, rgb(0 0 0 / .62), transparent);
  pointer-events: none;
}
.wall-name {
  font-family: var(--rv-font-sans);
  font-weight: 500;
  font-size: clamp(.85rem, 1vw, 1.05rem);
  line-height: 1.2;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-ig {
  font-family: var(--rv-font-mono);
  font-size: clamp(.62rem, .72vw, .78rem);
  letter-spacing: .02em;
  color: rgb(255 255 255 / .72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wall-item.is-cam::before {
  content: "REVE CAM";
  position: absolute;
  top: 9px;
  left: 10px;
  z-index: 2;
  font: var(--rv-microlabel);
  letter-spacing: .11em;
  color: #0a0a0a;
  background: var(--wall-accent);
  padding: 4px 7px;
  border-radius: 5px;
}
.wall-item.flash { animation: wall-flash-in 900ms ease-out; }
@keyframes wall-flash-in {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.wall-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--rv-radius-full);
  background: rgb(0 0 0 / .62);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.wall-authed .wall-item:hover .wall-x { display: flex; }

/* ---- grid: justified rows (contain) ---- */
.wall-grid-inner.fit-contain { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.wall-row { display: flex; gap: 10px; justify-content: center; }

/* ---- grid: FILL the screen (cover mosaic) ---- */
.wall-grid-inner.fit-cover {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 8px;
  padding: 8px;
}
.wall-grid-inner.fit-cover .wall-item {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.wall-grid-inner.fit-cover .wall-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 700ms ease;
}
.wall-grid-inner.fit-cover .wall-item img.on { opacity: 1; }

/* ---- river ---- */
.wall-river-inner { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.wall-river-inner .wall-item { border-radius: 12px; }

/* ---- live count in the QR rail (Reve typography) ---- */
.wall-qr-count {
  display: flex;
  gap: 20px;
  align-items: baseline;
  justify-content: center;
}
.wall-qr-count span {
  font-family: var(--rv-font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #a6a6a6;
}
.wall-qr-count b {
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: 1.7rem;
  color: var(--wall-accent);
  margin-right: 6px;
}

/* ---- side rail (QR + leaderboard) ---- */
.wall-rail {
  flex: 0 0 28%;
  max-width: 28%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* center the QR when it's the only rail content */
  gap: 18px;
  padding: 22px;
  background: #101010;
  border-left: 1px solid #1e1e1e;
  overflow: hidden;
}
.wall-rail:has(.wall-rail-board:not([hidden])) { justify-content: flex-start; }
.side-w-s .wall-rail { flex-basis: 22%; max-width: 22%; }
.side-w-l .wall-rail { flex-basis: 36%; max-width: 36%; }

.wall-rail-qr {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.wall-qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: 100%;
  display: flex;
  justify-content: center;
}
.wall-qr-box svg, .wall-empty-qr svg { display: block; width: 100%; height: auto; }
.wall-qr-label {
  font-family: var(--rv-font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a6a6a6;
}

.wall-rail-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.rail-board-head { display: flex; flex-direction: column; gap: 6px; }
.rail-board-title {
  font-family: var(--rv-font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 2.4rem);
  letter-spacing: -.01em;
  color: #fff;
}
.rail-board-counts { font-size: clamp(.8rem, 1.1vw, 1.05rem); color: #a6a6a6; }
.rail-board-counts b { color: var(--wall-accent); }
.rail-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1vh, 12px);
  overflow: hidden;
}
.rail-board-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: clamp(5px, 1vh, 12px);
  border-bottom: 1px solid #1e1e1e;
  font-size: clamp(.9rem, 1.3vw, 1.35rem);
}
.rail-board-row.is-lead .rb-name { color: var(--wall-accent); }
.rb-rank { width: 1.4em; color: #6a6a6a; font-family: var(--rv-font-mono); font-size: .78em; }
.rb-name { flex: 1 1 auto; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-hint { color: #6a6a6a; font-family: var(--rv-font-mono); font-size: .62em; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-count { color: var(--wall-accent); font-family: var(--rv-font-display); font-size: 1.05em; }
.rail-board-empty { color: #6a6a6a; font-size: 1rem; }

/* ---- empty state ---- */
.wall-empty {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #0a0a0a;
}
.wall-empty-logo { height: 30px; }
.wall-empty-qr { background: #fff; border-radius: 16px; padding: 18px; }
.wall-empty-qr svg { width: min(42vh, 300px); }
.wall-empty-label {
  font-family: var(--rv-font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a6a6a6;
}

/* ===== admin control panel ===== */

.admin-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--rv-color-canvas);
  color: var(--rv-font-color-normal);
  font-family: var(--rv-font-sans);
}
.admin-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--rv-color-canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rv-color-panel-border);
}
.admin-tag {
  font-family: var(--rv-font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--rv-color-alpha-1000);
  color: var(--rv-color-neutral-0);
  padding: 4px 8px;
  border-radius: 6px;
  align-self: center;
}
.admin-top-actions { display: flex; align-items: center; gap: 12px; }
.admin-live {
  font-family: var(--rv-font-mono);
  font-size: var(--rv-font-size-x-small);
  color: var(--rv-font-color-lighter);
  white-space: nowrap;
}

.admin-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--hq-stack-gap);
}
.admin-card {
  background: var(--rv-color-panel);
  border: 1px solid var(--rv-color-panel-border);
  border-radius: var(--rv-radius-l);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-card .field-label { margin: 0; }

/* segmented control */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--rv-color-gray-100);
  padding: 4px;
  border-radius: var(--rv-radius-m);
}
.seg button {
  flex: 1 1 auto;
  min-width: max-content;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--rv-font-color-light);
  font-family: inherit;
  font-size: var(--rv-font-size-small);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.seg button:hover { color: var(--rv-font-color-normal); }
.seg button.is-on {
  background: var(--rv-color-panel);
  color: var(--rv-font-color-normal);
  box-shadow: var(--rv-shadow-dialog);
}

.admin-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: var(--rv-font-size-small);
  color: var(--rv-font-color-light);
}
.admin-slider input[type=range] { width: 100%; accent-color: var(--rv-color-alpha-1000); }
.admin-slider output {
  font-family: var(--rv-font-mono);
  font-size: var(--rv-font-size-x-small);
  color: var(--rv-font-color-lighter);
  min-width: 3ch;
  text-align: right;
}

.admin-toggles { display: flex; flex-direction: column; gap: 10px; }
.admin-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--rv-font-size-small);
  cursor: pointer;
}
.admin-toggle input { width: 18px; height: 18px; accent-color: var(--rv-color-alpha-1000); }

.admin-hint {
  font-size: var(--rv-font-size-x-small);
  color: var(--rv-font-color-lighter);
  line-height: 1.5;
  margin: 0;
}
.admin-row { display: flex; gap: 8px; align-items: center; }
.admin-row .entry-input { flex: 1 1 auto; }

.admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.admin-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--rv-radius-s);
  overflow: hidden;
  background: var(--rv-color-gray-100);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-thumb.is-cam { outline: 2px solid var(--rv-color-blue-600); outline-offset: -2px; }
.admin-thumb-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--rv-radius-full);
  background: rgb(0 0 0 / .6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}
.admin-thumb:hover .admin-thumb-x, .admin-thumb-x:focus-visible { opacity: 1; }

.admin-danger #admin-clear {
  color: var(--rv-color-red-500);
  border-color: color-mix(in srgb, var(--rv-color-red-500) 40%, transparent);
}
.admin-danger #admin-clear:hover:not(:disabled) {
  background: color-mix(in srgb, var(--rv-color-red-500) 12%, transparent);
  border-color: var(--rv-color-red-500);
}

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  background: var(--rv-color-alpha-1000);
  color: var(--rv-color-neutral-0);
  padding: 11px 18px;
  border-radius: var(--rv-radius-full);
  font-size: var(--rv-font-size-small);
  box-shadow: var(--rv-shadow-dialog);
}
