/* Rifa GCC — AWS palette on top of Pico.css (classless). */
:root[data-theme=light] {
  --navy: #232F3E;
  --orange: #FF9900;
  --ink-2: #545B64;
  --hair: #D5DBDB;
  --pico-font-family: "Helvetica Neue", Helvetica, -apple-system, system-ui, Arial, sans-serif;
  --pico-font-family-sans-serif: var(--pico-font-family);
  --pico-background-color: #fff;
  --pico-color: var(--navy);
  --pico-h1-color: var(--navy);
  --pico-h2-color: var(--navy);
  --pico-muted-color: var(--ink-2);
  --pico-muted-border-color: var(--hair);
  --pico-primary: var(--navy);
  --pico-primary-background: var(--navy);
  --pico-primary-border: var(--navy);
  --pico-primary-hover: #000;
  --pico-primary-hover-background: #131A22;
  --pico-primary-hover-border: #131A22;
  --pico-primary-focus: rgba(255, 153, 0, .35);
  --pico-primary-inverse: #fff;
  --pico-border-radius: 2px;
  --pico-form-element-focus-color: var(--orange);
}

body > header, body > main, body > footer { max-width: 1040px; }
body > header { padding-bottom: 0; border-bottom: 1px solid var(--hair); }

.kicker {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: .9rem;
}
.label { font-size: .85rem; color: var(--ink-2); margin: 0; }
.small { font-size: .8rem; color: var(--ink-2); }
.lede  { font-size: 1.1rem; }
.note  { max-width: 34rem; color: var(--ink-2); }

/* One hero element, smaller supporting column. Stacks on phones. */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.split > aside { border-top: 1px solid var(--hair); padding-top: 1.75rem; }
.split > * > :first-child { margin-top: 0; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr) 22rem; gap: 4rem; align-items: start; }
  .split > aside { border-top: 0; padding-top: 0; border-left: 1px solid var(--hair); padding-left: 2rem; }
}
body > footer { padding-top: 0; }
.narrow > * { max-width: 26rem; }
.narrow > h1 { margin-top: 2.5rem; font-size: 1.6rem; }

.ticket {
  font-size: clamp(1.9rem, 9vw, 3.4rem); font-weight: 700; line-height: 1.05;
  margin: .25rem 0 1rem; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  word-break: break-word;
}
.ticket .hash { color: var(--orange); font-weight: 400; margin-right: .05em; }

.presence { font-size: .9rem; color: var(--ink-2); display: flex; align-items: center; gap: .5rem; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--hair); display: inline-block; }
.dot.on { background: var(--orange); }

.reveal h2, aside h2 { font-size: 1rem; margin-bottom: .4rem; }
.reveal dl { margin: 1rem 0; font-size: .9rem; }
.reveal dl div {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 1rem;
  padding: .45rem 0; border-bottom: 1px solid var(--hair);
}
.reveal dt { color: var(--ink-2); white-space: nowrap; }
.reveal dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.punch { font-size: .95rem; }

.error { color: #D13212; font-size: .9rem; }

/* Admin */
.bar { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.counts { font-size: .95rem; margin-bottom: .9rem; }
.counts strong { font-size: 1.15rem; }
.sep { color: var(--hair); margin: 0 .35rem; }

button.draw {
  background: var(--orange); border-color: var(--orange); color: var(--navy);
  font-weight: 700; padding: .8rem 2.2rem;
}
button.draw:hover { background: #EC7211; border-color: #EC7211; color: var(--navy); }

/* .reel is on the <p>; admin.js sets spin/final on the inner #reel span. */
.reel .spin, .reel.spin { color: var(--ink-2); }
.reel .final,
.reel.final { color: #1D8102; text-shadow: 0 0 26px rgba(29,129,2,.4); }

ol.winners { list-style: none; padding: 0; margin-top: 2rem; }
ol.winners li {
  display: grid; grid-template-columns: 7rem 1fr auto; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem; margin: .55rem 0; font-variant-numeric: tabular-nums;
  background: rgba(29,129,2,.12); border: 1px solid rgba(29,129,2,.35);
  border-left: 5px solid #1D8102; border-radius: 10px;
  animation: rowin .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rowin { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
ol.winners li .pl { color: #1D8102; font-size: .9rem; font-weight: 700; }
ol.winners li .nm { font-weight: 800; font-size: 1.5rem; letter-spacing: .06em; }
ol.winners li .pz { color: var(--ink-2); font-weight: 600; }
ol.winners li.first { padding: 1.1rem; background: #1D8102; border-color: #1D8102; box-shadow: 0 8px 30px rgba(29,129,2,.35); }
ol.winners li.first .pl, ol.winners li.first .nm, ol.winners li.first .pz { color: #fff; }
ol.winners li.first .nm { font-size: 2.3rem; }

#verifyForm { display: flex; gap: .5rem; margin-bottom: .5rem; }
#verifyForm input { margin-bottom: 0; }
#verifyForm button { width: auto; margin-bottom: 0; }
.verdict { font-size: .95rem; min-height: 1.5em; }
.verdict.ok  { color: #1D8102; }
.verdict.bad { color: #D13212; }

/* Pico classless has no .secondary/.outline: low-weight buttons for reset/logout. */
button.quiet {
  background: transparent; color: var(--navy); border: 1px solid var(--hair);
  font-size: .9rem; padding: .45rem 1rem; width: auto;
}
button.quiet:hover { border-color: var(--navy); background: transparent; color: var(--navy); }
aside hr { margin: 1.75rem 0; border-color: var(--hair); }
ol.winners:empty { margin: 0; }

/* Winner banner (pushed to the winning phone over the WebSocket). */
.hero.win { text-align: center; }
.hero.win .wintag { font-size: 1.4rem; font-weight: 700; color: var(--orange); margin: 0 0 .25rem; }
.hero.win .winprize { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin: .25rem 0 1rem; }
.hero.win .winqr { width: 180px; height: 180px; display: block; margin: .5rem auto 1rem; border: 1px solid var(--hair); image-rendering: pixelated; }
.hero.win .wincta { font-size: 1.05rem; font-weight: 600; }
.hero.win .wincta a { font-weight: 700; }

/* Winner celebration: pop-in, glowing prize, emoji confetti. */
@keyframes winpop { 0% { transform: scale(.82); opacity: 0 } 60% { transform: scale(1.04) } 100% { transform: scale(1); opacity: 1 } }
.hero.win { animation: winpop .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes winglow { from { text-shadow: 0 0 0 rgba(255,153,0,0) } to { text-shadow: 0 0 20px rgba(255,153,0,.65) } }
.hero.win .winprize { animation: winglow 1.3s ease-in-out infinite alternate; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9999; }
.confetti .conf { position: absolute; top: -12vh; font-size: 1.7rem; will-change: transform; animation: conffall linear forwards; }
@keyframes conffall { to { transform: translateY(118vh) rotate(600deg); } }
.conf.l0  { left: 3%;  animation-duration: 2.9s; animation-delay: 0s }
.conf.l1  { left: 11%; animation-duration: 3.4s; animation-delay: .25s }
.conf.l2  { left: 19%; animation-duration: 2.6s; animation-delay: .1s }
.conf.l3  { left: 27%; animation-duration: 3.1s; animation-delay: .5s }
.conf.l4  { left: 35%; animation-duration: 2.8s; animation-delay: .15s }
.conf.l5  { left: 44%; animation-duration: 3.6s; animation-delay: .4s }
.conf.l6  { left: 53%; animation-duration: 2.7s; animation-delay: .05s }
.conf.l7  { left: 62%; animation-duration: 3.2s; animation-delay: .55s }
.conf.l8  { left: 70%; animation-duration: 2.9s; animation-delay: .2s }
.conf.l9  { left: 78%; animation-duration: 3.5s; animation-delay: .35s }
.conf.l10 { left: 87%; animation-duration: 2.6s; animation-delay: .45s }
.conf.l11 { left: 95%; animation-duration: 3.3s; animation-delay: .12s }
@media (prefers-reduced-motion: reduce) { .confetti { display: none } .hero.win, .hero.win .winprize { animation: none } }
/* 8-char ticket readability */
.ticket.reel { font-size: clamp(2rem, 6.5vw, 3.8rem); letter-spacing: .08em; }
input.up { text-transform: uppercase; }

/* ---- Presentation mode (safe to screen-share: stage only) ---- */
#presBtn { margin-left: 1rem; font-size: .8rem; padding: .25rem .8rem; }
body.present-mode > header .brand { transform: scale(1.1); transform-origin: left center; }
body.present-mode > header .counts,
body.present-mode aside,
body.present-mode #drawBtn { display: none; }           /* hide controls, verify, counts */
/* keep the draw button visible in presentation mode */
body.present-mode #drawBtn { display: inline-block; }
body.present-mode > main.split { grid-template-columns: minmax(0,1fr); }  /* stage spans full width */
body.present-mode .hero { text-align: center; }
body.present-mode #stage { font-size: 1.3rem; color: var(--ink-2); margin-bottom: .5rem; }
body.present-mode .ticket.reel { font-size: clamp(3rem, 11vw, 6.5rem); }
body.present-mode #prize { font-size: 1.5rem; font-weight: 700; color: #1D8102; }
body.present-mode ol.winners { max-width: 760px; margin-left: auto; margin-right: auto; }
body.present-mode ol.winners li { padding: .9rem 1.4rem; font-size: 1.1rem; }
body.present-mode ol.winners li.first .nm { font-size: 2.7rem; }

/* Presentation-mode control bar: shown only in present mode, under the draw button.
   Essentials only (registro + reiniciar). Full wipe stays out of the shared view. */
.pres-controls { display: none; }
body.present-mode .pres-controls { display: flex; gap: .8rem; justify-content: center; margin: .4rem 0 1.2rem; }
body.present-mode .pres-controls button { font-size: .85rem; }
body.present-mode .joinmail { font-size: 1rem; color: var(--ink-2); margin: .9rem 0 0; }
body.present-mode .joinmail strong { color: var(--navy); }

/* Join QR — hidden in normal admin, shown only in presentation mode so late
   arrivals can still scan to enter while the stage is projected. */
.joinqr { display: none; }
body.present-mode .joinqr {
  display: block; margin: 2.2rem auto 0; max-width: 440px; text-align: center;
  border-top: 1px solid var(--hair); padding-top: 1.6rem;
}
body.present-mode .joinqr .joinlead { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin: 0 0 1rem; }
body.present-mode .joinqr .joinqr-img { width: 260px; height: 260px; display: block; margin: 0 auto .8rem; image-rendering: pixelated; }
body.present-mode .joinqr .joinurl { font-size: 1.1rem; font-weight: 700; color: var(--orange); letter-spacing: .01em; word-break: break-all; margin: 0; }

/* AWS logo (inline SVG wordmark + smile) in the page header. */
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.awslogo { height: 30px; width: auto; display: block; }
.awswm { font: 700 30px Arial, Helvetica, sans-serif; fill: var(--navy); letter-spacing: 1px; }
.awssmile { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; }
.awsarrow { fill: var(--orange); }
.brand .kicker { margin: 0; }
header.bar .brand { margin-bottom: .9rem; }


/* ============================================================
   RIFA GCC — "wow" presentation-mode theme (additive overrides)
   Cinematic dark AWS stage. Applies ONLY in body.present-mode so
   normal admin stays the clean light tool.
   ============================================================ */

/* ---- Cinematic backdrop ---- */
body.present-mode {
  background:
    radial-gradient(1200px 700px at 50% -10%, #10406b 0%, rgba(16,64,107,0) 60%),
    radial-gradient(900px 600px at 85% 110%, #11324a 0%, rgba(17,50,74,0) 55%),
    linear-gradient(160deg, #0b1826 0%, #0e2135 55%, #0a1420 100%);
  color: #eaf1f8;
  min-height: 100vh;
}
body.present-mode > header,
body.present-mode > main,
body.present-mode > footer { max-width: 1180px; }
body.present-mode > header { border-bottom: 1px solid rgba(255,255,255,.08); }

/* AWS wordmark goes light on the dark stage */
body.present-mode .awswm { fill: #fff; }
body.present-mode > header .brand { transform: scale(1.18); transform-origin: left center; }
body.present-mode .kicker { color: #9fb4c7; }

/* ---- Stage headline ("stage" label) ---- */
body.present-mode #stage {
  font-size: 1.5rem; letter-spacing: .14em; text-transform: uppercase;
  color: #ffb34d; margin: 1.2rem 0 .3rem; font-weight: 700;
  text-shadow: 0 0 24px rgba(255,153,0,.35);
}

/* ---- The reel: huge, glowing, monospace tabular ---- */
body.present-mode .ticket.reel {
  font-size: clamp(3.5rem, 14vw, 8rem); font-weight: 800; letter-spacing: .1em;
  margin: .3rem 0 .6rem; line-height: 1;
}
body.present-mode .ticket.reel .hash { color: #FF9900; }
body.present-mode #reel { color: #fff; transition: none; }
/* spinning: dim, slight blur to feel like motion */
body.present-mode #reel.spin { color: #7f97ad; filter: blur(.5px); opacity: .9; }
/* locked: green pop + big glow */
body.present-mode #reel.final {
  color: #4ade80;
  text-shadow: 0 0 40px rgba(74,222,128,.6), 0 0 90px rgba(74,222,128,.3);
  animation: reelLock .5s cubic-bezier(.2,1.2,.3,1) both;
}
@keyframes reelLock { 0% { transform: scale(.7); opacity: 0 } 55% { transform: scale(1.12) } 100% { transform: scale(1); opacity: 1 } }

body.present-mode #prize {
  font-size: 1.9rem; font-weight: 800; color: #ffd480; margin: .2rem 0 1.4rem;
  text-shadow: 0 0 30px rgba(255,170,0,.35);
}

/* ---- Draw button: premium orange, glow on hover ---- */
body.present-mode #drawBtn {
  display: inline-block; font-size: 1.15rem; padding: 1rem 3rem; border-radius: 999px;
  background: linear-gradient(180deg, #ffb13c, #ff9900); border: none; color: #10233a;
  font-weight: 800; letter-spacing: .02em; box-shadow: 0 10px 30px rgba(255,153,0,.35);
  transition: transform .1s ease, box-shadow .2s ease;
}
body.present-mode #drawBtn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255,153,0,.5); }
body.present-mode #drawBtn:active { transform: translateY(0); }
body.present-mode #drawBtn:disabled { background: #2a3b4e; color: #5f7388; box-shadow: none; }

/* ---- Winner list: glassy dark cards, gold 1st ---- */
body.present-mode ol.winners { max-width: 820px; margin: 1.4rem auto 0; }
body.present-mode ol.winners li {
  grid-template-columns: 8rem 1fr auto;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.09);
  border-left: 4px solid #4ade80;
  border-radius: 14px; padding: 1rem 1.5rem; margin: .7rem 0;
  color: #eaf1f8;
  backdrop-filter: blur(4px);
  animation: cardIn .6s cubic-bezier(.2,.9,.25,1.15) both;
}
@keyframes cardIn { 0% { opacity: 0; transform: translateY(26px) scale(.96) } 100% { opacity: 1; transform: none } }
body.present-mode ol.winners li .pl { color: #4ade80; font-size: 1rem; font-weight: 700; letter-spacing: .04em; }
body.present-mode ol.winners li .nm { color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: .08em; }
body.present-mode ol.winners li .pz { color: #cfe0f0; font-weight: 700; }

/* 1st place: gold, crowned, shimmering */
body.present-mode ol.winners li.first {
  grid-template-columns: 8rem 1fr auto;
  background: linear-gradient(100deg, rgba(255,170,0,.22), rgba(255,153,0,.08));
  border: 1px solid rgba(255,183,60,.55); border-left: 4px solid #FF9900;
  box-shadow: 0 12px 48px rgba(255,153,0,.28);
  padding: 1.4rem 1.5rem;
  position: relative; overflow: hidden;
}
body.present-mode ol.winners li.first::before {
  content: "👑"; position: absolute; top: -2px; right: 14px; font-size: 1.6rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
body.present-mode ol.winners li.first::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 2.6s ease-in-out infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%) } 60%,100% { transform: translateX(100%) } }
body.present-mode ol.winners li.first .pl { color: #ffd480; }
body.present-mode ol.winners li.first .nm { color: #fff; font-size: 2.6rem; }
body.present-mode ol.winners li.first .pz { color: #ffe6b3; }

/* ---- Control bar: subtle on dark ---- */
body.present-mode .pres-controls { gap: 1rem; margin: .2rem 0 1.4rem; }
body.present-mode .pres-controls button {
  background: rgba(255,255,255,.06); color: #cfe0f0; border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: .5rem 1.3rem; font-size: .9rem;
}
body.present-mode .pres-controls button:hover { border-color: #ffb13c; color: #fff; background: rgba(255,153,0,.12); }

/* ---- Join panel: refined on dark ---- */
body.present-mode .joinqr {
  border-top: 1px solid rgba(255,255,255,.1); max-width: 520px;
}
body.present-mode .joinqr .joinlead { color: #eaf1f8; font-size: 1.3rem; }
body.present-mode .joinqr .joinqr-img {
  width: 240px; height: 240px; border-radius: 16px; padding: 12px; background: #fff;
  box-shadow: 0 10px 36px rgba(0,0,0,.4); border: none;
}
body.present-mode .joinqr .joinurl { color: #ffb34d; font-size: 1.05rem; }
body.present-mode .joinmail { color: #9fb4c7; font-size: 1.05rem; }
body.present-mode .joinmail strong { color: #fff; }

/* confetti sits above the dark stage already (z-index 9999) */
