/* ==========================================================================
   Lucky Door Prize — Furniture Court Awards Night 2026
   Dark concentric stage, gold gradient type. Everything is self-hosted so the
   page renders identically with no internet at the venue.
   ========================================================================== */

@font-face {
  font-family: 'Bebas Neue';
  src: url('fonts/bebasneue-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-latin-var.woff2') format('woff2-variations');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --ink:        #08080a;
  --ink-2:      #0f0f12;
  --ink-3:      #16161a;

  --gold-hi:    #fff7da;
  --gold-1:     #f3dc9b;
  --gold-2:     #e0b757;
  --gold-3:     #c1902f;
  --gold-deep:  #8a5a16;
  --gold-line:  rgba(224, 183, 87, .30);

  --display: 'Bebas Neue', 'Haettenschweiler', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--gold-1);
  font-family: var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Background: layered concentric ridges -------------------------------- */

.rings {
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 47%,
      #17171b   0 12.0%,
      #08080a  13.2%,
      #131317  14.4% 22.5%,
      #060608  23.8%,
      #17171c  25.1% 34.0%,
      #07070a  35.4%,
      #131318  36.8% 46.5%,
      #060608  48.0%,
      #16161b  49.5% 60.5%,
      #07070a  62.2%,
      #121216  63.9% 76.0%,
      #060609  77.8%,
      #141419  79.6% 100%);
  animation: breathe 22s var(--ease-out) infinite;
  transform-origin: 50% 47%;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

/* Gold bloom behind the reel — swells while the names are spinning. */
.rings::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 47%,
    rgba(224, 183, 87, .10) 0%, rgba(224, 183, 87, .04) 26%, transparent 55%);
  opacity: .55;
  transition: opacity .8s ease;
}
body[data-spinning='1'] .rings::after { opacity: 1.4; }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(0,0,0,.62) 100%);
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* --- Stage layout --------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3.2vh, 44px);
  padding: clamp(20px, 4vh, 48px) 24px;
  text-align: center;
}

.stage__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo {
  height: clamp(96px, 22vh, 260px);
  width: auto;
  filter: drop-shadow(0 6px 26px rgba(0, 0, 0, .75));
}

.eyebrow {
  margin: 0;
  font-family: var(--ui);
  font-weight: 600;
  font-size: clamp(11px, 1.15vw, 15px);
  letter-spacing: .42em;
  text-transform: uppercase;
  text-indent: .42em;
  color: transparent;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-2) 60%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
}

/* --- The reel ------------------------------------------------------------- */

.reel {
  width: min(1080px, 92vw);
  /* 1px gradient hairline: gradient background, inner plate on top. */
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(150deg,
    rgba(243, 220, 155, .55), rgba(138, 90, 22, .10) 38%,
    rgba(138, 90, 22, .10) 62%, rgba(243, 220, 155, .40));
  box-shadow: 0 30px 90px -30px rgba(0, 0, 0, .9);
  transition: box-shadow .6s ease, transform .6s var(--ease-out);
}

.reel[data-phase='win'] {
  box-shadow:
    0 30px 90px -20px rgba(0, 0, 0, .9),
    0 0 120px -10px rgba(224, 183, 87, .40);
}

.reel__frame {
  position: relative;
  border-radius: 21px;
  padding: clamp(22px, 3.6vh, 42px) clamp(24px, 5vw, 76px);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(224, 183, 87, .07), transparent 62%),
    linear-gradient(180deg, rgba(22, 22, 26, .94), rgba(8, 8, 10, .96));
  overflow: hidden;
}

/* Corner brackets */
.reel__corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--gold-2);
  opacity: .55;
}
.reel__corner--tl { top: 12px; left: 12px;  border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.reel__corner--tr { top: 12px; right: 12px; border-left: 0;  border-bottom: 0; border-radius: 0 6px 0 0; }
.reel__corner--bl { bottom: 12px; left: 12px;  border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.reel__corner--br { bottom: 12px; right: 12px; border-left: 0;  border-top: 0; border-radius: 0 0 6px 0; }

.reel__label {
  margin: 0 0 clamp(8px, 1.4vh, 18px);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 600;
  letter-spacing: .38em;
  text-indent: .38em;
  text-transform: uppercase;
  color: rgba(224, 183, 87, .62);
  transition: color .4s ease;
}
.reel[data-phase='win'] .reel__label { color: rgba(255, 247, 218, .9); }

/* Holds the line box open so the frame never resizes between idle and spin. */
.reel__slot { position: relative; }

/* Idle ornament: a hairline rule with a gold lozenge at its centre. */
.reel__ornament {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, 44%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 183, 87, .5), transparent);
  display: none;
}
.reel[data-phase='idle'] .reel__ornament { display: block; }

.reel__ornament::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: linear-gradient(140deg, var(--gold-hi), var(--gold-3));
  transform: rotate(45deg);
  animation: ornament-pulse 3.4s ease-in-out infinite;
}
@keyframes ornament-pulse {
  0%, 100% { opacity: .45; transform: rotate(45deg) scale(.85); }
  50%      { opacity: 1;   transform: rotate(45deg) scale(1.15); }
}

.reel__name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 8.6vw, 8.4rem);
  line-height: .96;
  letter-spacing: .015em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(177deg,
    #fff7da 0%, #f3dc9b 16%, #dfb356 34%,
    #a66c1b 51%, #e7c471 68%, #fbefc0 84%, #c1902f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .8));
  /* Long names shrink to fit rather than wrapping awkwardly. */
  white-space: nowrap;
  transform-origin: 50% 55%;
  will-change: transform, filter, opacity;
}

.reel[data-phase='spin'] .reel__name {
  animation: reel-jitter .09s steps(2) infinite;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .8)) blur(.6px);
  opacity: .92;
}
@keyframes reel-jitter {
  0%   { transform: translateY(-2px) scale(.994); }
  100% { transform: translateY(2px)  scale(1.006); }
}

.reel[data-phase='win'] .reel__name {
  animation: reel-pop .9s var(--ease-out) both;
}
@keyframes reel-pop {
  0%   { transform: scale(.86); opacity: 0; filter: blur(9px); }
  55%  { transform: scale(1.045); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 3px 22px rgba(224,183,87,.35)); }
}

/* Light sweep across the winning name */
.reel[data-phase='win'] .reel__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 247, 218, .16) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: sweep 1.5s .25s var(--ease-out) both;
  pointer-events: none;
}
@keyframes sweep { to { transform: translateX(120%); } }

/* --- Draw button ---------------------------------------------------------- */

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.draw-btn {
  position: relative;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  padding: clamp(15px, 2.1vh, 22px) clamp(52px, 7vw, 92px);
  border-radius: 999px;
  font-family: var(--ui);
  font-weight: 700;
  font-size: clamp(13px, 1.25vw, 17px);
  letter-spacing: .30em;
  text-indent: .30em;
  text-transform: uppercase;
  color: #1a1206;
  background: linear-gradient(180deg, #fff3c8 0%, #e6bd63 42%, #c1902f 72%, #8a5a16 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .55) inset,
    0 -1px 0 rgba(0, 0, 0, .25) inset,
    0 14px 36px -12px rgba(224, 183, 87, .55);
  transition: transform .28s var(--ease-out), box-shadow .28s ease, opacity .28s ease;
}

.draw-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: translateX(-130%);
  animation: shine 4.5s 1.2s ease-in-out infinite;
}
@keyframes shine {
  0%, 62% { transform: translateX(-130%); }
  86%, 100% { transform: translateX(130%); }
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .6) inset,
    0 -1px 0 rgba(0, 0, 0, .25) inset,
    0 20px 46px -12px rgba(224, 183, 87, .72);
}
.draw-btn:active:not(:disabled) { transform: translateY(0) scale(.985); }

.draw-btn:disabled {
  cursor: default;
  opacity: .38;
  box-shadow: none;
}
.draw-btn:disabled::after { animation: none; }

.draw-btn:focus-visible,
.tool:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold-1);
  outline-offset: 3px;
}

.hint {
  margin: 0;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(224, 183, 87, .38);
  transition: opacity .3s ease;
}
.hint kbd {
  font: inherit;
  border: 1px solid rgba(224, 183, 87, .28);
  border-radius: 4px;
  padding: 1px 6px;
}

/* --- Tally ---------------------------------------------------------------- */

.tally {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
}
.tally__item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tally__item b {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-2) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
}
.tally__item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: rgba(224, 183, 87, .42);
}
.tally__rule { width: 1px; height: 28px; background: var(--gold-line); }

/* --- Tools (discreet, bottom-left) --------------------------------------- */

.tools {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  opacity: .34;
  transition: opacity .35s ease;
}
.tools:hover, .tools:focus-within { opacity: 1; }

.tool {
  cursor: pointer;
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-2);
  background: rgba(16, 16, 20, .8);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 8px 15px;
  transition: color .2s, border-color .2s, background .2s;
}
.tool:hover { color: var(--gold-hi); border-color: rgba(224, 183, 87, .6); background: rgba(28, 28, 34, .9); }
.tool:disabled { opacity: .4; cursor: default; }
.tool__count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(224, 183, 87, .16);
  color: var(--gold-hi);
}

/* --- Winners panel -------------------------------------------------------- */

.winners {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  width: min(380px, 88vw);
  height: 100%;
  padding: 26px 24px 30px;
  background: linear-gradient(180deg, rgba(16, 16, 20, .97), rgba(8, 8, 10, .98));
  border-left: 1px solid var(--gold-line);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .95);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slide-in .45s var(--ease-out) both;
}
@keyframes slide-in { from { transform: translateX(100%); } }
.winners[hidden] { display: none; }

.winners__head { display: flex; align-items: center; justify-content: space-between; }
.winners__head h2 {
  margin: 0;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-1);
}

.icon-btn {
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--gold-2);
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
}
.icon-btn:hover { color: var(--gold-hi); }

.winners__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.winners__list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(224, 183, 87, .1);
  animation: fade-up .35s var(--ease-out) both;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

.winners__list .pos {
  min-width: 26px;
  font-family: var(--display);
  font-size: 15px;
  color: rgba(224, 183, 87, .45);
}
.winners__list .who {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--gold-1);
}
.winners__list li:first-child .who { color: var(--gold-hi); }

.winners__empty {
  margin: 0;
  font-size: 12px;
  color: rgba(224, 183, 87, .38);
}

/* --- Modal ---------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 6, .78);
  backdrop-filter: blur(6px);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal[hidden] { display: none; }

.modal__box {
  width: min(440px, 100%);
  padding: 30px 32px 26px;
  border-radius: 18px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, #16161a, #0c0c0f);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .95);
  animation: pop-in .3s var(--ease-out) both;
}
@keyframes pop-in { from { transform: scale(.94) translateY(10px); opacity: 0; } }

.modal__title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold-hi);
}
.modal__body { margin: 0 0 18px; font-size: 13.5px; line-height: 1.65; color: rgba(224, 183, 87, .72); }

.modal__pin { display: block; margin: 0 0 16px; }
.modal__pin span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(224, 183, 87, .5);
}
.modal__pin input {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--ui);
  font-size: 16px;
  letter-spacing: .3em;
  color: var(--gold-hi);
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
}
.modal__pin input:focus { outline: none; border-color: var(--gold-2); }

.modal__error { margin: 0 0 14px; font-size: 12.5px; color: #ff9c86; }
.modal__error[hidden] { display: none; }

.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn {
  cursor: pointer;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease-out), filter .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--gold-line); color: var(--gold-2); }
.btn--ghost:hover { border-color: var(--gold-2); color: var(--gold-hi); }
.btn--gold {
  color: #1a1206;
  background: linear-gradient(180deg, #fff3c8, #e6bd63 45%, #c1902f);
}
.btn--gold:hover { filter: brightness(1.06); }

/* --- Toast ---------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(16, 16, 20, .96);
  color: var(--gold-1);
  font-size: 12.5px;
  letter-spacing: .06em;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  animation: fade-up .3s var(--ease-out) both;
}
.toast[hidden] { display: none; }

.boot-error {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.7;
  color: #ff9c86;
}
.boot-error a { color: var(--gold-hi); }

/* --- Responsive / motion -------------------------------------------------- */

@media (max-width: 640px) {
  .stage { gap: 20px; }
  .tally { gap: 16px; }
  .tools { left: 10px; right: 10px; bottom: 10px; opacity: .8; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .rings { animation: none; }
  .draw-btn::after { animation: none; }
  .reel[data-phase='spin'] .reel__name { animation: none; }
}
