/* One stylesheet for all four pages. Guests are on a phone, in a dark room,
   on wifi that is being shared by two hundred people. Everything here is
   sized for a thumb and weighs nothing. */

:root {
  color-scheme: dark;
  --bg: #12100f;
  --panel: #1c1a18;
  --panel-2: #262320;
  --line: #35302b;
  --ink: #f6f1ea;
  --ink-dim: #a89e93;
  --accent: #ffb84d;
  --accent-ink: #1a1512;
  --good: #6fcf7f;
  --radius: 14px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body { padding: 0 var(--pad) 120px; max-width: 720px; margin: 0 auto; }

h1 { font-size: 1.35rem; margin: 20px 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 28px 0 10px; }
p  { margin: 6px 0; }

.muted { color: var(--ink-dim); font-size: 0.9rem; }
.center { text-align: center; }
.hide { display: none !important; }

header.bar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding-top: 18px;
}

/* ---------------------------------------------------------- missions --- */

.mission {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin: 10px 0;
}
.mission.done { border-color: #2f4a33; background: #16201a; }
.mission .body { flex: 1; min-width: 0; }
.mission .prompt { font-weight: 620; }
.mission .hint { color: var(--ink-dim); font-size: 0.86rem; margin-top: 2px; }
.mission .pack {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-dim); margin-bottom: 4px;
}
.mission .tick { color: var(--good); font-size: 1.2rem; line-height: 1.2; }

.shoot {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700;
  padding: 11px 16px; border-radius: 999px; white-space: nowrap;
}
.shoot:active { transform: translateY(1px); }
.mission.done .shoot { background: var(--panel-2); color: var(--ink-dim); font-weight: 600; }

/* ------------------------------------------------------------ uploads --- */

.tray { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.tray img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); flex: 0 0 auto;
}
.tray .pending { opacity: 0.45; }
.tray .failed  { outline: 2px solid #d9534f; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
}
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--panel); }

/* ------------------------------------------------------------- status --- */

.toast {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.toast.error { border-color: #6d3230; background: #2a1a19; }

.board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.board .row:last-child { border-bottom: 0; }
.board .row .n { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

.namebox {
  width: 100%; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font: inherit;
}

/* -------------------------------------------------------------- tv --- */

body.tv { max-width: none; padding: 0; background: #000; overflow: hidden; }
.tv-stage { position: fixed; inset: 0; display: grid; place-items: center; }
.tv-stage img {
  max-width: 100vw; max-height: 100vh; object-fit: contain;
  opacity: 0; transition: opacity 700ms ease;
}
.tv-stage img.on { opacity: 1; }
.tv-caption {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 28px 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
  font-size: 1.6rem; font-weight: 600;
}
.tv-caption .who { color: var(--accent); }
