:root {
  --ink: #120a07;
  --espresso: #1e120c;
  --mocha: #3b271c;
  /* Nudged toward dshair.co.za's actual brand tokens (--color-primary-button-border:
     #c8922a, --color-secondary-button-text: #d4a04a, --color-primary-button-background:
     #8e795c) so the draw page reads as the same brand as the main site, while keeping
     enough warmth for the dramatic ceremony lighting. */
  --bronze: #ad8850;
  --copper: #cc9c56;
  --gold: #c8922a;
  --champagne: #f0dcc0;
  --cream: #fff8f0;
  --muted: rgba(255, 244, 232, .6);
  --font-label: "Josefin Sans", Montserrat, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--cream);
  background: var(--ink);
  font-family: Montserrat, Arial, sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.draw-app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 38%, rgba(155, 99, 63, .2), transparent 33%),
    linear-gradient(145deg, #0d0705 0%, #24150e 48%, #120a07 100%);
}

.ambient-glow {
  position: fixed;
  z-index: 0;
  width: 42vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: .15;
}

.ambient-glow-one { top: -20vw; left: -10vw; background: #d49b6f; }
.ambient-glow-two { right: -22vw; bottom: -25vw; background: #7c4c32; }

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

.reveal-flash {
  position: fixed;
  inset: 0;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(255,255,255,.92), rgba(255, 214, 173, .4) 38%, transparent 72%);
}

[data-phase="winner"] .reveal-flash { animation: revealFlash 1s ease-out both; }

.draw-stage {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(24px, 4vw, 64px) clamp(18px, 5vw, 76px) 18px;
}

.stage-grid {
  width: min(1420px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(220px, 370px) minmax(500px, 760px);
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 7vw, 112px);
}

.poster-card {
  position: relative;
  width: 100%;
  max-height: 76vh;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(224, 171, 131, .3);
  border-radius: 3px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .58), 0 0 0 8px rgba(255, 245, 235, .025);
  transform: translateY(8px);
}

.poster-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.poster-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 30%, rgba(255,255,255,.12) 48%, transparent 64%);
  transform: translateX(-130%);
}

[data-phase="running"] .poster-sheen { animation: posterSheen 5s ease 8s both; }

.ceremony-panel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--copper);
  font-family: var(--font-label);
  font-size: clamp(8px, .9vw, 12px);
  font-weight: 500;
  letter-spacing: .42em;
}

.tagline {
  margin: 0 0 16px;
  color: rgba(255, 244, 232, .48);
  font-family: var(--font-label);
  font-size: clamp(8px, .82vw, 11px);
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--champagne);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(40px, 5.3vw, 76px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: .78;
  text-shadow: 0 12px 36px rgba(0,0,0,.45);
}

h1 em { color: var(--copper); font-weight: 500; }

.ceremony-status {
  width: min(620px, 100%);
  min-height: 23px;
  margin-top: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 244, 232, .72);
  font-family: var(--font-label);
  font-size: clamp(10px, 1.05vw, 13px);
  letter-spacing: .2em;
  text-align: left;
  text-transform: uppercase;
  transition: opacity .3s ease;
}

.countdown-text { color: var(--champagne); font-weight: 600; font-variant-numeric: tabular-nums; }

.draw-app.is-holding .ceremony-status { animation: holdTextPulse 1.15s ease-in-out infinite; }

.timeline {
  width: min(620px, 100%);
  height: 3px;
  overflow: hidden;
  background: rgba(255,255,255,.09);
}

.timeline span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--bronze), var(--champagne));
  box-shadow: 0 0 16px rgba(223, 169, 127, .8);
}

.wheel-shell {
  position: relative;
  width: min(53vh, 520px, 74vw);
  aspect-ratio: 1;
  margin: 18px auto 10px;
  border-radius: 50%;
  opacity: .34;
  transform: scale(.93);
  transition: opacity 1.3s ease, transform 1.3s cubic-bezier(.2,.9,.25,1.08), filter 1s ease;
  filter: saturate(.5) brightness(.65);
}

.wheel-shell.is-live,
[data-phase="winner"] .wheel-shell {
  opacity: 1;
  transform: scale(1);
  filter: none;
}

.wheel-shell::before,
.wheel-shell::after {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 0;
  border: 1px solid rgba(228, 178, 139, .35);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(205, 145, 98, .16);
}

.wheel-shell::after {
  inset: -23px;
  border-color: rgba(228, 178, 139, .1);
}

.stage-rays {
  position: absolute;
  z-index: -1;
  inset: -23%;
  border-radius: 50%;
  opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(226,166,120,.12) 0 3deg, transparent 3deg 15deg);
  mask-image: radial-gradient(circle, transparent 0 43%, #000 68%, transparent 74%);
  transition: opacity 1s ease;
}

.wheel-shell.is-live .stage-rays { opacity: 1; animation: rayTurn 18s linear infinite; }

.wheel-shell.is-climax { animation: climaxPulse .5s ease-in-out infinite; }
.wheel-shell.is-climax .stage-rays { animation-duration: 4.5s; opacity: .85; }
.draw-app.is-climax .ambient-glow { opacity: .3; transition: opacity .35s ease; }

.draw-app.is-holding .wheel-shell { animation: holdGlow 1.15s ease-in-out infinite; }

#drawWheel {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 8px solid #1c100a;
  border-radius: 50%;
  background: #190e09;
  box-shadow:
    0 28px 60px rgba(0,0,0,.65),
    0 0 0 2px rgba(226,173,132,.8),
    0 0 0 8px #2a1910,
    inset 0 0 42px rgba(0,0,0,.55);
}

.pointer {
  position: absolute;
  z-index: 6;
  top: -25px;
  left: 50%;
  width: 54px;
  height: 74px;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.65));
}

.pointer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  border: 2px solid #f4d5ba;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9d4, #bd7a4b 44%, #4c2a18 75%);
  transform: translateX(-50%);
}

.pointer span {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 43px solid #d79a6c;
  border-right: 15px solid transparent;
  border-left: 15px solid transparent;
  transform: translateX(-50%);
}

[data-phase="winner"] .pointer { animation: pointerWin .75s ease-in-out 3; }

.wheel-hub {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: 27%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(226,171,130,.8);
  border-radius: 50%;
  color: var(--champagne);
  background: radial-gradient(circle at 40% 32%, #402719, #120b07 72%);
  box-shadow: 0 9px 28px rgba(0,0,0,.65), inset 0 0 22px rgba(214,151,103,.1);
  transform: translate(-50%, -50%);
}

.wheel-hub span { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(28px, 4.2vw, 55px); line-height: .65; }
.wheel-hub small { margin-top: 9px; color: var(--copper); font-size: clamp(6px, .65vw, 9px); letter-spacing: .36em; }

.live-name {
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .4;
  transition: opacity .8s ease;
}

.wheel-shell.is-live + .live-name { opacity: 1; }
.live-name span { color: var(--bronze); font-family: var(--font-label); font-size: 7px; letter-spacing: .34em; }
.live-name strong { max-width: 88vw; overflow: hidden; color: var(--champagne); font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(16px, 2.2vw, 26px); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.winner-reveal {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(760px, 96vw);
  padding: clamp(35px, 6vw, 72px) 24px;
  border: 1px solid rgba(242, 203, 171, .62);
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 20%, rgba(255,255,255,.08), transparent 65%),
    rgba(20, 11, 7, .94);
  box-shadow: 0 35px 100px rgba(0,0,0,.72), 0 0 60px rgba(202,134,87,.25), inset 0 0 55px rgba(209,144,96,.09);
  pointer-events: none;
  transform: translate(-50%, 25%) scale(.65);
}

.winner-reveal::before,
.winner-reveal::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  bottom: 11px;
  left: 11px;
  border: 1px solid rgba(203, 145, 102, .22);
}

.winner-reveal::after { top: -9px; right: 8%; bottom: -9px; left: 8%; border-width: 1px 0; }

.winner-reveal p { margin: 0 0 10px; color: var(--copper); font-family: var(--font-label); font-size: clamp(9px, 1vw, 13px); letter-spacing: .55em; }

.winner-reveal h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--cream);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(52px, 9vw, 132px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .8;
  text-shadow: 0 0 12px rgba(255,255,255,.35), 0 0 36px rgba(217,153,105,.68), 0 12px 28px rgba(0,0,0,.8);
}

.winner-reveal > span { display: block; margin-top: 22px; color: rgba(255,239,225,.7); font-family: var(--font-label); font-size: clamp(7px, .8vw, 10px); letter-spacing: .28em; }

.winner-letters { display: inline-block; }
.wword { display: inline-block; white-space: nowrap; }
.wletter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px) scale(.82) rotate(-2deg);
  animation: letterIn .7s cubic-bezier(.16,1,.3,1) forwards;
}

[data-phase="winner"] .winner-reveal { animation: winnerRise 1.8s cubic-bezier(.16,1,.3,1) both, winnerFlash 2.4s ease-in-out 1.8s infinite; }
[data-phase="winner"] .wheel-shell { animation: wheelImpact .55s ease-out; }

.reset-button {
  position: relative;
  z-index: 30;
  margin-top: 10px;
  padding: 9px 18px;
  border: 1px solid rgba(210,153,111,.35);
  border-radius: 50px;
  color: rgba(255,241,229,.72);
  background: rgba(0,0,0,.22);
  cursor: pointer;
  font-family: var(--font-label);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.reset-button:hover { color: var(--cream); border-color: var(--copper); }
.fairness-note { margin: 8px 0 0; color: rgba(255,255,255,.28); font-family: var(--font-label); font-size: 8px; letter-spacing: .04em; }

.site-footer {
  width: min(1420px, 100%);
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.27);
  font-family: var(--font-label);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.site-footer a { color: inherit; text-decoration: none; transition: color .25s ease; }
.site-footer a:hover { color: var(--copper); }

/* Closed ceremonial doors */
.door-portal {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow: hidden;
  background: transparent;
  perspective: 1400px;
}

.door {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 50.08%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 7% 92%, rgba(0,0,0,.4)),
    repeating-linear-gradient(90deg, transparent 0 12%, rgba(255,255,255,.014) 12% 12.3%, transparent 12.3% 25%),
    linear-gradient(125deg, #25150e, #0f0906 58%, #2d1a11);
  box-shadow: inset 0 0 100px rgba(0,0,0,.72);
  will-change: transform;
}

.door-left { left: 0; border-right: 1px solid #c68d62; transform-origin: left center; }
.door-right { right: 0; border-left: 1px solid #c68d62; transform-origin: right center; }

.door::before {
  content: "";
  position: absolute;
  inset: 3.5%;
  border: 1px solid rgba(204,147,104,.33);
  box-shadow: inset 0 0 0 7px rgba(0,0,0,.24), 0 0 22px rgba(224,160,110,.04);
}

.door::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(226,161,112,.075), transparent);
}

.door-left::after { right: 0; }
.door-right::after { left: 0; }

.door-inlay {
  position: absolute;
  left: 12%;
  right: 12%;
  border: 1px solid rgba(210,153,110,.24);
  background: radial-gradient(ellipse at center, rgba(116,66,39,.18), rgba(0,0,0,.22));
  box-shadow: inset 0 0 36px rgba(0,0,0,.55), 0 0 0 8px rgba(0,0,0,.12);
}

.door-inlay::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(210,153,110,.12);
}

.door-inlay-top { top: 7%; height: 35%; }
.door-inlay-bottom { bottom: 7%; height: 45%; }

.door-flare {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  opacity: .45;
  background: #e8b38c;
  box-shadow: 0 0 26px #d18855, 0 0 80px rgba(225,140,78,.75);
}

.door-left .door-flare { right: -2px; }
.door-right .door-flare { left: -2px; }

.door-seam {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #e2aa80;
  box-shadow: 0 0 20px rgba(226,150,90,.8), 0 0 60px rgba(221,130,63,.45);
  transform: translateX(-50%);
  transition: opacity .5s ease;
}

.door-plaque {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100vw - 38px));
  min-height: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 38px 33px;
  border: 1px solid rgba(242,196,159,.68);
  color: var(--cream);
  background: linear-gradient(145deg, rgba(43,25,16,.98), rgba(14,8,5,.98));
  box-shadow: 0 35px 90px rgba(0,0,0,.78), 0 0 0 8px rgba(8,4,3,.55), 0 0 0 9px rgba(194,137,94,.26), inset 0 0 46px rgba(197,124,72,.09);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.4,0,.2,1), filter 1.2s ease;
}

.door-plaque::before,
.door-plaque::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid #c9946e;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0c9a8, #7b4930 55%, #28150d);
}

.door-plaque::before { top: 15px; left: 15px; }
.door-plaque::after { right: 15px; bottom: 15px; }

.plaque-kicker { margin: 0 0 15px; color: var(--copper); font-family: var(--font-label); font-size: 8px; letter-spacing: .34em; }

.brand-logo-window {
  position: relative;
  width: 200px;
  height: 184px;
  overflow: hidden;
  background: #100a07;
}

.brand-logo-window img {
  position: absolute;
  width: 620px;
  height: auto;
  max-width: none;
  left: -398px;
  top: -878px;
}

.brand-text-fallback {
  display: none;
  flex-direction: column;
  color: var(--champagne);
  font-family: "Cormorant Garamond", Georgia, serif;
  opacity: .92;
}

.brand-text-fallback strong { font-size: 31px; font-weight: 400; line-height: .8; }
.brand-text-fallback span { margin-top: 6px; color: var(--copper); font-size: 15px; font-style: italic; }

.entry-summary { min-height: 17px; margin: 21px 0 14px; color: rgba(255,244,234,.58); font-family: var(--font-label); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }

.start-button {
  position: relative;
  width: min(285px, 100%);
  min-height: 78px;
  overflow: hidden;
  border: 1px solid rgba(255,228,205,.8);
  border-radius: 0;
  color: #1b0f09;
  background: linear-gradient(110deg, #a9803a, #f2dba0 45%, #c8922a);
  box-shadow: 0 13px 36px rgba(0,0,0,.5), 0 0 32px rgba(200,146,42,.26);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

.start-button::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -35%;
  width: 26%;
  height: 180%;
  background: rgba(255,255,255,.36);
  transform: rotate(16deg);
  animation: startSheen 3.4s ease-in-out infinite;
}

.start-button span { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 31px; font-weight: 600; letter-spacing: .18em; line-height: .9; }
.start-button small { display: block; margin-top: 8px; font-family: var(--font-label); font-size: 7px; font-weight: 600; letter-spacing: .19em; }
.start-button:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 44px rgba(215,151,104,.36); }
.start-button:active:not(:disabled) { transform: scale(.985); }
.start-button:disabled { cursor: wait; filter: grayscale(.45) brightness(.6); }

.start-message { min-height: 15px; margin: 12px 0 0; color: #e9aa9d; font-size: 9px; line-height: 1.5; }

[data-phase="running"] .door-seam { opacity: 0; }
[data-phase="winner"] .door-portal { visibility: hidden; }

@keyframes startSheen { 0%, 45% { left: -35%; } 75%, 100% { left: 125%; } }
@keyframes posterSheen { 0% { transform: translateX(-130%); } 55%, 100% { transform: translateX(130%); } }
@keyframes rayTurn { to { transform: rotate(360deg); } }
@keyframes pointerWin { 0%,100% { transform: translateX(-50%) scale(1); filter: drop-shadow(0 8px 8px rgba(0,0,0,.65)); } 50% { transform: translateX(-50%) scale(1.16); filter: drop-shadow(0 0 18px #efb989); } }
@keyframes winnerRise {
  0% { opacity: 0; transform: translate(-50%, 36%) scale(.58); filter: blur(12px); }
  55% { opacity: 1; transform: translate(-50%, -54%) scale(1.05); filter: blur(0); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}
@keyframes winnerFlash {
  0%,100% { box-shadow: 0 35px 100px rgba(0,0,0,.72), 0 0 45px rgba(202,134,87,.22), inset 0 0 55px rgba(209,144,96,.09); }
  50% { box-shadow: 0 35px 100px rgba(0,0,0,.72), 0 0 90px rgba(237,181,137,.52), inset 0 0 65px rgba(229,167,119,.16); }
}
@keyframes climaxPulse {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.16) saturate(1.15); }
}
@keyframes holdGlow {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255,214,173,0)); }
  50% { filter: brightness(1.14) drop-shadow(0 0 42px rgba(255,214,173,.5)); }
}
@keyframes holdTextPulse {
  0%, 100% { opacity: .68; }
  50% { opacity: 1; }
}
@keyframes revealFlash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes letterIn {
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes wheelImpact {
  0% { transform: scale(1); }
  35% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .draw-app { overflow-y: auto; }
  .draw-stage { min-height: 100svh; padding: 20px 16px 14px; }
  .stage-grid { display: block; }
  .poster-card { display: none; }
  .ceremony-panel { min-height: calc(100svh - 70px); justify-content: center; }
  h1 { font-size: clamp(38px, 11vw, 60px); }
  .wheel-shell { width: min(62vh, 78vw, 500px); margin-top: 23px; }
  .fairness-note { margin-top: 13px; }
}

@media (max-width: 520px) {
  .eyebrow { letter-spacing: .27em; }
  .ceremony-status { margin-top: 17px; font-size: 8px; letter-spacing: .12em; }
  .wheel-shell { width: min(76vw, 380px); }
  .pointer { top: -20px; transform: translateX(-50%) scale(.83); }
  .live-name { height: 32px; }
  .winner-reveal { padding: 46px 18px; }
  .winner-reveal h2 { font-size: clamp(48px, 17vw, 90px); }
  .door-plaque { min-height: 430px; padding: 28px 25px; }
  .brand-logo-window { width: 180px; height: 166px; }
  .brand-logo-window img { width: 560px; left: -359px; top: -793px; }
}

@media (max-height: 720px) and (min-width: 700px) {
  .draw-stage { padding-top: 18px; }
  .stage-grid { grid-template-columns: 220px minmax(430px, 620px); gap: 55px; }
  .poster-card { max-height: 68vh; }
  h1 { font-size: 48px; }
  .wheel-shell { width: min(51vh, 410px); margin-top: 12px; }
  .ceremony-status { margin-top: 13px; }
  .door-plaque { min-height: 410px; transform: translate(-50%, -50%) scale(.85); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
