/* The Court of Appeals — jury site
   Look taken from the reel's end banner: walnut wood, gold seal, serif lettering. */

:root {
  --wood-950: #150d09;
  --wood-900: #1d120c;
  --wood-800: #2a1a12;
  --wood-700: #3b261b;
  --wood-600: #5a4138;
  --gold: #c9a154;
  --gold-bright: #f0c960;
  --gold-deep: #8f6b26;
  --cream: #f3ead7;
  --cream-dim: #cdbfa6;
  --ink: #140c08;
  --danger: #f08a6c;
  --radius: 16px;
  --serif: "Besley", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: #2a1710;
}

/* Walnut background: one real wood image, fixed behind the page, with soft
   lighting on top so text keeps its contrast. A fixed layer avoids the
   background jumping on phones. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    radial-gradient(ellipse 120% 55% at 50% 0%, rgba(255, 190, 130, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(12, 6, 3, 0) 0%, rgba(12, 6, 3, 0.18) 55%, rgba(8, 4, 2, 0.5) 100%),
    url("../img/wood.jpg");
  background-size: cover, cover, cover;
  background-position: center top, center, center;
  background-repeat: no-repeat;
}

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; }

.gold { color: var(--gold-bright); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(21, 13, 9, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201, 161, 84, 0.35);
}
.topbar__back {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 1px solid rgba(201, 161, 84, 0.45); border-radius: 50%;
  color: var(--gold-bright);
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: none; border: 0; padding: 0;
  font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--cream);
}
.topbar__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__seal { width: 36px; height: 36px; flex: none; object-fit: contain; }
.topbar__step {
  margin-left: auto; flex: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Views ---------- */
.view { flex: 1; display: flex; flex-direction: column; animation: viewIn 0.35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.panel {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 26px 20px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}
.panel--wide { max-width: 980px; }
.panel--center { text-align: center; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 12.500px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold);
}
.title {
  margin: 0 0 12px;
  font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.15;
  color: var(--cream);
}
.display {
  margin: 0;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(36px, 11vw, 60px); line-height: 1.04; letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.display--small { font-size: clamp(38px, 10vw, 54px); margin-bottom: 14px; }
.lead { margin: 14px 0 0; font-size: 18px; color: var(--cream); }
.body { margin: 0 0 20px; color: var(--cream-dim); }
.note { margin: 14px 0 6px; font-size: 13.500px; color: var(--cream-dim); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 14px 20px;
  border-radius: 14px; border: 1.500px solid transparent;
  font-family: var(--serif); font-weight: 700; font-size: 18px; text-align: center;
  transition: transform 0.12s ease, filter 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn--gold {
  color: #2a1808;
  background: linear-gradient(180deg, #fbe08a 0%, #e6b84a 52%, #c9982f 100%);
  border-color: #fbe6a2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--gold:hover { filter: brightness(1.05); }
.btn--ghost {
  color: var(--gold-bright);
  background: rgba(21, 13, 9, 0.72);
  border-color: rgba(201, 161, 84, 0.75);
}
.btn--text {
  min-height: 44px; width: auto; margin: 6px auto 0; padding: 8px 14px;
  background: none; border: 0;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  color: var(--gold); text-decoration: underline; text-underline-offset: 3px;
}
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 6px; }
.btn-row--stack { grid-template-columns: 1fr; margin-top: 24px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: rgba(21, 13, 9, 0.72); border: 1px solid rgba(201, 161, 84, 0.55); border-radius: 50%;
  color: var(--gold-bright);
}

/* ---------- Home ---------- */
.view--home { justify-content: space-between; }
.home {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 28px 20px 12px;
  padding-top: max(28px, env(safe-area-inset-top));
}
.home__hero { position: relative; text-align: center; }
.home__seal {
  position: relative; z-index: 1;
  width: min(62vw, 250px); height: auto;
  margin: 0 auto 16px; display: block;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
}
.home__flag {
  position: absolute; top: -28px; z-index: 0;
  height: clamp(250px, 76vw, 330px); width: auto;
  pointer-events: none; user-select: none;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5));
}
.home__flag--us { left: -18px; }
.home__flag--md { right: -18px; }
.home__hero .display, .home__hero .lead { position: relative; z-index: 1; }
.display__line { display: block; white-space: nowrap; }
.home__choices { margin-top: 26px; display: grid; gap: 14px; }

.choice {
  display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 92px; padding: 16px 18px;
  text-align: left;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(29, 18, 12, 0.94), rgba(18, 11, 8, 0.96));
  border: 1.500px solid rgba(201, 161, 84, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, border-color 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: var(--gold-bright); filter: brightness(1.06); }
.choice:active { transform: scale(0.985); }
.choice__icon {
  flex: none; width: 58px; height: 58px; display: grid; place-items: center;
  padding-right: 16px; border-right: 1px solid rgba(201, 161, 84, 0.45);
  box-sizing: content-box;
}
.choice__icon svg { width: 52px; height: 52px; }
.choice__text { display: grid; gap: 3px; min-width: 0; }
.choice__title { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.15; }
.choice__sub { font-size: 15px; color: var(--cream); }

.choice--primary {
  color: #2a1808;
  background: linear-gradient(180deg, #fde38c 0%, #ebbd4c 50%, #cb9a2e 100%);
  border-color: #fde9a8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.choice--primary .choice__icon { border-right-color: rgba(42, 24, 8, 0.35); }
.choice--primary .choice__sub { color: #3a2410; font-weight: 500; }

.prize-note {
  margin: 8px 4px 0; text-align: center; font-size: 14.500px; color: var(--cream-dim);
}
.prize-note strong { color: var(--gold-bright); font-weight: 600; }

.site-footer {
  display: grid; gap: 4px; justify-items: center;
  margin: 22px 16px 0; padding: 14px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.site-footer__url {
  padding: 10px 22px; border-radius: 12px;
  background: rgba(21, 13, 9, 0.78);
  font-family: var(--serif); font-weight: 700; font-size: clamp(16px, 4.600vw, 20px);
  color: var(--gold-bright);
}
.site-footer__note { font-size: 12px; color: rgba(205, 191, 166, 0.75); }

/* ---------- Seats ---------- */
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.seat {
  position: relative; padding: 0; overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--wood-950);
  border: 2px solid rgba(201, 161, 84, 0.45); border-radius: var(--radius);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.seat img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seat__label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 10px 9px;
  background: linear-gradient(180deg, transparent, rgba(12, 7, 5, 0.9));
  font-family: var(--serif); font-weight: 700; font-size: 17px; text-align: center; color: var(--cream);
}
.seat[aria-checked="true"] {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(233, 199, 121, 0.45), 0 12px 26px rgba(0, 0, 0, 0.5);
}
.seat[aria-checked="true"] .seat__label { color: var(--gold-bright); }
.seat[aria-checked="true"]::after {
  content: "Your seat";
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--gold-bright); color: #2a1808;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}

/* ---------- Selfie frame ---------- */
.frame {
  position: relative; width: min(100%, 340px); aspect-ratio: 4 / 5; margin: 6px auto 18px;
  border-radius: 22px; overflow: hidden;
  border: 6px solid var(--cream);
  background: linear-gradient(180deg, #2a2420 0%, #1a1512 58%, #4a2f1c 58%, #2c1a0f 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
}
.frame__plate {
  position: absolute; top: 12px; left: 0; right: 0; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
}
.frame__oval {
  position: absolute; left: 50%; top: 13%; width: 56%; height: 62%; transform: translateX(-50%);
  border-radius: 50%; overflow: hidden;
  border: 4px solid var(--cream);
  outline: 2px dashed var(--gold-bright); outline-offset: -11px;
  background: #23314f;
  display: grid; place-items: center;
}
.frame__oval img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.frame__ghost { width: 78%; color: #3a4b73; margin-top: 16%; }
.frame__hint {
  position: absolute; padding: 3px 8px; border-radius: 6px;
  background: rgba(12, 7, 5, 0.72); font-size: 12px; font-weight: 600;
}
.frame__hint--eyes { right: 6px; top: 37%; color: #8fd0ff; }
.frame__hint--chin { left: 6px; top: 65%; color: var(--gold-bright); }
.frame.has-photo .frame__hint { display: none; }

.tips {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  font-size: 14.500px; color: var(--cream);
}
.tips li { position: relative; padding-left: 20px; }
.tips li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold);
}

/* ---------- Forms ---------- */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 18px 0; font-size: 14.500px; color: var(--cream);
}
.check input {
  flex: none; width: 24px; height: 24px; margin: 1px 0 0;
  accent-color: var(--gold);
}
.check em { color: var(--cream-dim); }

.form { display: grid; gap: 14px; }
.form__two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 13.500px; font-weight: 600; color: var(--cream); }
.field em { font-style: normal; font-weight: 400; color: var(--cream-dim); }
.field input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font-size: 16px; font-weight: 500; color: var(--cream);
  background: rgba(21, 13, 9, 0.8);
  border: 1.500px solid rgba(201, 161, 84, 0.5); border-radius: 12px;
  outline: none;
}
.field input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(233, 199, 121, 0.25); }
.field input.is-invalid { border-color: var(--danger); }
.form-error { margin: 0; font-size: 14.500px; font-weight: 600; color: var(--danger); }

/* ---------- Seating progress ---------- */
.seating {
  margin: 0 0 22px; padding: 14px 16px;
  background: rgba(21, 13, 9, 0.8);
  border: 1px solid rgba(201, 161, 84, 0.45); border-radius: 14px;
}
.seating__row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.seating__dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold-bright); flex: none;
  animation: pulse 1.200s ease-in-out infinite;
}
.seating.is-ready .seating__dot { animation: none; background: #7fd68a; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
.seating__bar { margin-top: 10px; height: 6px; border-radius: 999px; background: rgba(243, 234, 215, 0.14); overflow: hidden; }
.seating__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: inherit; transition: width 0.6s ease;
}

/* ---------- Player ---------- */
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 2px solid rgba(201, 161, 84, 0.75);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player__freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.player__big {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 96px;
  background: none; border: 0; padding: 0;
}
.player__big svg { width: 100%; height: 100%; }
.player__you {
  position: absolute; top: 12px; left: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--gold-bright); color: #2a1808;
  font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.player__end {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 20px; text-align: center;
  background: rgba(15, 9, 6, 0.86);
}
.player__end .btn { width: auto; min-width: 230px; }
.player__end-title { margin: 0 0 6px; font-family: var(--serif); font-weight: 700; font-size: 26px; }

.player__bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.segments { flex: 1; display: flex; gap: 5px; align-items: center; }
.segment {
  position: relative; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(243, 234, 215, 0.18);
}
.segment > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--cream); border-radius: inherit; }
.segment--jury { height: 12px; background: rgba(201, 161, 84, 0.35); }
.segment--jury > i { background: var(--gold-bright); }

/* ---------- Quiz ---------- */
.options { display: grid; gap: 12px; margin: 18px 0 24px; }
.option {
  width: 100%; min-height: 58px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  font-size: 16.500px; font-weight: 500; color: var(--cream);
  background: rgba(21, 13, 9, 0.8);
  border: 1.500px solid rgba(201, 161, 84, 0.5); border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
}
.option::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--gold);
}
.option[aria-checked="true"] { border-color: var(--gold-bright); background: rgba(201, 161, 84, 0.16); }
.option[aria-checked="true"]::before { background: var(--gold-bright); box-shadow: inset 0 0 0 3px var(--wood-950); }

/* ---------- Done ---------- */
.done__seal { width: 150px; height: auto; margin: 10px auto 18px; display: block; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5)); }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .home {
    max-width: 1080px; padding: 56px 40px 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  }
  .home__seal { width: 300px; }
  .home__flag { top: -30px; height: 330px; }
  .home__flag--us { left: -8px; }
  .home__flag--md { right: -8px; }
  .home__choices { margin-top: 0; }
  .display { font-size: 68px; }
  .lead { font-size: 20px; }
  .panel { padding-top: 44px; }
  .title { font-size: 36px; }
  .seats { grid-template-columns: repeat(4, 1fr); }
  .view[data-view="seat"] .panel { max-width: 860px; }
  .view[data-view="seat"] .btn { max-width: 360px; margin: 0 auto; }
}
