/* Make Money or Pay Money: game show stage theme */
:root {
  --night: #12081f;
  --curtain: #2a0d2e;
  --ink: #fff8ec;
  --muted: #cbbfdc;
  --gold: #ffc83d;
  --gold-deep: #d98400;
  --make: #36f28a;
  --pay: #ff4a4a;
  --panel: rgba(28, 14, 44, 0.82);
  --line: rgba(255, 214, 120, 0.22);
  --display: 'Bungee', 'Impact', 'Arial Black', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 200, 61, 0.28), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 115%, rgba(240, 68, 58, 0.16) 0deg 9deg, rgba(255, 200, 61, 0.07) 9deg 18deg),
    linear-gradient(180deg, var(--curtain), var(--night) 70%);
  background-repeat: no-repeat;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------- Neon sign ---------- */
.marquee { display: flex; justify-content: center; padding: 22px 16px 6px; }

.sign {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  padding: 20px 22px 16px;
  border-radius: 22px;
  background: #140a22;
  border: 3px solid var(--make);
  box-shadow: 0 0 0 7px #140a22, 0 0 0 9px rgba(54, 242, 138, 0.45), 0 0 34px rgba(54, 242, 138, 0.4), inset 0 0 26px rgba(54, 242, 138, 0.18);
  text-decoration: none;
  text-align: center;
}
.sign::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 15px;
  border: 4px dotted #ffe9a6;
  filter: drop-shadow(0 0 4px #ffd35c);
  animation: bulbs 1.1s steps(2) infinite;
  pointer-events: none;
}
@keyframes bulbs { 50% { opacity: 0.4; } }

.sign-line { font-family: 'Bungee Inline', var(--display); font-size: clamp(30px, 8.4vw, 54px); line-height: 1; letter-spacing: 0.01em; }
.sign-make { color: var(--gold); text-shadow: 0 0 6px rgba(255, 200, 61, 0.9), 0 0 22px rgba(255, 138, 31, 0.65); }
.sign-pay { color: var(--pay); text-shadow: 0 0 6px rgba(255, 74, 74, 0.9), 0 0 22px rgba(255, 40, 40, 0.6); }
.sign-or { font-family: var(--display); font-size: clamp(16px, 4vw, 24px); color: #fff; text-shadow: 0 0 10px #fff; margin: 6px 0; line-height: 1; }
.sign-sub { margin-top: 10px; font-weight: 800; letter-spacing: 0.14em; font-size: clamp(11px, 2.8vw, 15px); color: #fff; }

.is-compact .marquee { padding-top: 14px; }
.is-compact .sign { padding: 14px 18px 12px; max-width: 460px; }
.is-compact .sign-line { font-size: clamp(22px, 6vw, 36px); }
.is-compact .sign-sub { margin-top: 6px; }

/* ---------- Layout ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 8px 16px 48px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  margin: 18px 0;
}
.auth { max-width: 460px; margin-left: auto; margin-right: auto; }

.title { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 5vw, 30px); line-height: 1.15; margin: 4px 0 8px; color: var(--gold); }
.subtitle { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.kicker { margin: 0 0 4px; color: var(--gold); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.txt-make { color: var(--make); }
.txt-pay { color: var(--pay); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 2px 0; color: var(--muted); }
.topbar strong { color: var(--ink); }
.link { color: var(--gold); font-weight: 600; text-underline-offset: 3px; }
.host-link { text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Forms and buttons ---------- */
.form { display: grid; gap: 14px; margin-top: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
}
input::placeholder { color: rgba(203, 191, 220, 0.6); }
select option { color: #111; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.3); }

.form-inline { grid-template-columns: 1fr; align-items: end; }
@media (min-width: 720px) { .form-inline { grid-template-columns: minmax(200px, 1fr) 100px 110px auto auto; } }
.form .check { display: inline-flex; padding-bottom: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 14px;
  padding: 13px 20px;
  cursor: pointer;
  color: #2a1400;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { cursor: not-allowed; filter: grayscale(0.8) brightness(0.7); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn-gold { background: linear-gradient(180deg, #ffe07a, var(--gold) 45%, var(--gold-deep)); box-shadow: 0 4px 0 #8a5200; }
.btn-make { background: linear-gradient(180deg, #8dffbf, var(--make)); box-shadow: 0 4px 0 #0f7a3c; color: #062913; }
.btn-pay { background: linear-gradient(180deg, #ff8a8a, var(--pay)); box-shadow: 0 4px 0 #8f1010; color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.25); }
.btn-danger { background: transparent; color: #ff8a8a; border: 1px solid rgba(255, 74, 74, 0.5); }

.flash { padding: 12px 16px; border-radius: 12px; margin: 14px 0; font-weight: 600; border: 1px solid; }
.flash-ok { background: rgba(54, 242, 138, 0.12); border-color: rgba(54, 242, 138, 0.45); color: #c9ffe0; }
.flash-warn { background: rgba(255, 200, 61, 0.12); border-color: rgba(255, 200, 61, 0.45); color: #ffe7a8; }
.flash-err { background: rgba(255, 74, 74, 0.14); border-color: rgba(255, 74, 74, 0.5); color: #ffd0d0; }

/* ---------- Sign in switch ---------- */
.switch { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0, 0, 0, 0.3); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.switch a { text-align: center; padding: 10px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--muted); }
.switch a.is-active { background: rgba(255, 200, 61, 0.16); color: var(--gold); }

.steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* ---------- Scoreboard ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.score {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #0d0617;
  border: 2px solid;
}
.score-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.score-value { font-family: var(--display); font-size: clamp(24px, 6vw, 34px); line-height: 1.1; }
.score-make { border-color: rgba(54, 242, 138, 0.55); }
.score-make .score-value { color: var(--make); text-shadow: 0 0 14px rgba(54, 242, 138, 0.5); }
.score-pay { border-color: rgba(255, 74, 74, 0.55); }
.score-pay .score-value { color: var(--pay); text-shadow: 0 0 14px rgba(255, 74, 74, 0.5); }
.score-total { grid-column: 1 / -1; border-color: rgba(255, 200, 61, 0.6); flex-direction: row; justify-content: space-between; align-items: center; }
.score-total .score-value { font-size: clamp(30px, 8vw, 44px); }
.is-pos .score-value, .bal.is-pos { color: var(--make); }
.is-neg .score-value, .bal.is-neg { color: var(--pay); }
.is-zero .score-value, .bal.is-zero { color: var(--gold); }
@media (min-width: 680px) {
  .scoreboard { grid-template-columns: 1fr 1fr 1.3fr; }
  .score-total { grid-column: auto; flex-direction: column; align-items: flex-start; justify-content: center; }
}

/* ---------- Wheel stage ---------- */
.stage { text-align: center; margin: 26px 0; }
.stage-title { font-family: var(--display); font-weight: 400; font-size: clamp(20px, 5vw, 28px); color: var(--gold); margin: 0 0 16px; text-shadow: 0 0 14px rgba(255, 200, 61, 0.45); }
.stage-note { color: var(--muted); margin: 14px auto 0; max-width: 34ch; }

.wheel-stage { position: relative; width: min(100%, 460px); aspect-ratio: 1 / 1; margin: 0 auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55)); }
.wheel-stage canvas { display: block; width: 100%; height: 100%; }
.wheel-preview { width: min(100%, 340px); }

.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  transform-origin: 50% 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 36px solid var(--pay);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 6px rgba(255, 74, 74, 0.7));
}
.pointer.bump { animation: bump 0.12s ease-out; }
@keyframes bump { 40% { transform: translateX(-50%) rotate(-14deg); } }

.btn-spin {
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  padding: 16px 38px;
  border-radius: 999px;
  color: #3a1d00;
  background: linear-gradient(180deg, #fff0a8, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 6px 0 #8a5200, 0 0 28px rgba(255, 200, 61, 0.55);
}
.btn-spin:not(:disabled) { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 #8a5200, 0 0 46px rgba(255, 200, 61, 0.9); } }

/* ---------- Current challenge ---------- */
.challenge { border: 2px solid rgba(255, 200, 61, 0.55); text-align: center; }
.challenge-name, .reveal-name { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 7vw, 40px); line-height: 1.1; margin: 4px 0 14px; }
.deal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.deal > div { display: flex; flex-direction: column; padding: 12px; border-radius: 14px; font-weight: 600; font-size: 14px; }
.deal strong { font-size: 20px; font-weight: 800; }
.deal-make { background: rgba(54, 242, 138, 0.12); color: #c9ffe0; border: 1px solid rgba(54, 242, 138, 0.45); }
.deal-make strong { color: var(--make); }
.deal-pay { background: rgba(255, 74, 74, 0.12); color: #ffd0d0; border: 1px solid rgba(255, 74, 74, 0.45); }
.deal-pay strong { color: var(--pay); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 8px; }
.choice .btn { flex-direction: column; gap: 2px; font-size: 18px; padding: 14px 12px; }
.choice .btn > span { font-size: 15px; font-weight: 600; opacity: 0.9; }
.challenge .muted { max-width: 46ch; margin-left: auto; margin-right: auto; }

/* ---------- Reveal ---------- */
.reveal {
  width: min(92vw, 440px);
  padding: 26px 22px 22px;
  border-radius: 24px;
  text-align: center;
  color: var(--ink);
  background: radial-gradient(ellipse at top, #3a1540, #140a22 70%);
  border: 3px solid var(--gold);
  box-shadow: 0 0 60px rgba(255, 200, 61, 0.5);
}
.reveal::backdrop { background: rgba(8, 3, 14, 0.78); }
.reveal[open] { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.reveal-value { margin: 0; color: var(--muted); }
.reveal-value strong { color: var(--gold); font-size: 22px; }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#confetti i { position: absolute; top: -16px; width: 9px; height: 15px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--drift, 0), 110vh) rotate(760deg); } }

/* ---------- History and lists ---------- */
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.history li:first-child { border-top: 0; }
.history li > div:first-child { display: flex; flex-direction: column; }
.history-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amt { font-weight: 800; }
.amt-earned { color: var(--make); }
.amt-owed { color: var(--pay); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-pending { background: rgba(255, 200, 61, 0.16); color: var(--gold); }
.badge-review { background: rgba(47, 123, 246, 0.2); color: #a9c8ff; }
.badge-earned { background: rgba(54, 242, 138, 0.15); color: var(--make); }
.badge-owed { background: rgba(255, 74, 74, 0.16); color: #ff9a9a; }
.badge-passed { background: rgba(255, 138, 31, 0.16); color: #ffb877; }
.badge-offered { background: rgba(142, 68, 236, 0.2); color: #d4b5ff; }
.amt-passed { color: #ffb877; }
.badge-settled { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.deadline { font-weight: 800; color: var(--gold); margin: 6px 0 10px; }
.countdown { font-weight: 600; color: var(--muted); }
.countdown.is-urgent { color: var(--pay); }
.daily { margin: 14px 0; padding: 12px 16px; border-radius: 14px; font-weight: 600; }
.daily-due { background: rgba(255, 74, 74, 0.14); border: 2px solid rgba(255, 74, 74, 0.6); color: #ffd6d6; }
.daily-due strong { color: #fff; }
.daily-done { background: rgba(54, 242, 138, 0.1); border: 1px solid rgba(54, 242, 138, 0.35); color: #c9ffe0; text-align: center; }
.proof { display: grid; gap: 14px; margin-top: 14px; text-align: left; }
@media (min-width: 620px) { .proof { grid-template-columns: 1fr 1fr; } }
.proof-step { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); }
.proof-title { margin: 0; font-weight: 800; }
.photo-status { margin: 0; }
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-pick { position: relative; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.photo-pick:focus-within { outline: 3px solid var(--gold); outline-offset: 3px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; }
.thumb { position: relative; display: block; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; font-weight: 800; text-align: center; padding: 2px; background: rgba(0, 0, 0, 0.6); }
.reject-note { display: block; margin-top: 4px; font-size: 14px; color: #ffb3b3; }
.reject-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reject-form input { flex: 1 1 200px; width: auto; padding: 8px 12px; font-size: 14px; }
.settle { border: 2px solid rgba(255, 200, 61, 0.5); }
.settle-amount { font-family: var(--display); font-size: 28px; margin: 4px 0 8px; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hours { flex: 0 0 110px; width: 110px; }
.chore-edit .hours { width: 90px; }
.mini { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mini-name { flex: 1 1 180px; }
.mini input { font-size: 16px; font-weight: 400; color: var(--ink); }
.chore-edit .value { width: 96px; }
.chore-edit .check, .chore-edit .btn { align-self: flex-end; margin-bottom: 10px; }
.chore-row > form:last-child { align-self: flex-end; margin-bottom: 10px; }

.reveal .choice { position: relative; z-index: 1; }

/* ---------- Host dashboard ---------- */
.admin-tabs { display: flex; gap: 6px; margin: 16px 0 0; overflow-x: auto; }
.admin-tabs a { padding: 10px 16px; border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, 0.05); white-space: nowrap; }
.admin-tabs a.is-active { color: #2a1400; background: var(--gold); }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 520px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; font-weight: 800; }
.table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--line); }
.table td div + div { margin-top: 4px; }

.chore-list, .assign-list { display: grid; gap: 10px; }
.chore-row, .assign-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.chore-row.is-off { opacity: 0.55; }
.chore-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 420px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.check input { width: 18px; height: 18px; accent-color: var(--make); }
.assign-info { flex: 1 1 220px; display: flex; flex-direction: column; }
.assign-status { display: flex; gap: 8px; align-items: center; }
.assign-status select { width: auto; padding: 8px 10px; }
.review-panel { border: 2px solid rgba(47, 123, 246, 0.55); }
.danger-zone { border-color: rgba(255, 74, 74, 0.35); }

@media (max-width: 420px) {
  .panel { padding: 18px 16px; }
  .deal strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sign::before, .btn-spin:not(:disabled), .reveal[open], .pointer.bump { animation: none; }
}
