/* The Draw — animated reveal */

.draw {
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  position: relative;
}

.draw__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--color-border);
}
.draw__kicker {
  margin: 0;
  font-size: var(--fs-sm);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-gold);
}
.draw__controls {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.draw__speed {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.draw__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6) 0;
  min-height: 60vh;
}
.draw__waiting { text-align: center; }
.draw__done {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-3xl), 9vw, var(--fs-5xl));
  background: var(--grad-gold);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ===== Per-staff reveal card ===== */
.reveal {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}
.reveal__head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  opacity: 0;
  transform: translateX(-40px);
}
.reveal__head.reveal-in {
  animation: revealIn 600ms var(--ease-spring) forwards;
}
.reveal__index {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--color-text-mute);
  letter-spacing: 0.1em;
}
.reveal__avatar { box-shadow: var(--glow-gold); }
.reveal__name {
  margin: 0;
  font-size: clamp(var(--fs-2xl), 7vw, var(--fs-3xl));
  background: var(--grad-gold);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

@keyframes revealIn {
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Slots ===== */
/* Always one row on mobile — 3, 4, or 5 columns equally split. JS sets
   --slot-count on the staff card so we can drive grid-template-columns
   without a media query per count. Falls back to 3 if JS hasn't run. */
.reveal__slots {
  display: grid;
  grid-template-columns: repeat(var(--slot-count, 3), minmax(0, 1fr));
  gap: var(--s-2);
  align-items: start;
}
@media (min-width: 600px) {
  .reveal__slots { gap: var(--s-3); }
}
.slot {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s-2);          /* tight on mobile so the reel still fits */
  min-height: 170px;            /* a bit shorter than the old 200px */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s-2);
  position: relative;
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-med)  var(--ease-out),
              transform  var(--t-fast) var(--ease-spring);
}
@media (min-width: 600px) {
  .slot { padding: var(--s-4); gap: var(--s-3); min-height: 200px; }
}
.slot--spinning { border-color: var(--color-gold); }
.slot--locked   {
  border-color: var(--color-pitch-bright);
  box-shadow: var(--glow-pitch);
}
.slot--pulse {
  animation: slotPulse 400ms var(--ease-spring);
}
@keyframes slotPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Gold finale slot — the staff's guaranteed top-tier pick. Subtle pre-spin,
   full glory once locked. */
.slot--top {
  border-color: rgba(245,197,24,0.5);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245,197,24,0.15) 0%, transparent 70%),
    var(--color-bg-elev);
}
.slot--top.slot--spinning { box-shadow: 0 0 24px rgba(245,197,24,0.45); }
.slot--top-locked {
  border-color: var(--color-gold) !important;
  box-shadow: var(--glow-gold), 0 0 36px rgba(245,197,24,0.5) !important;
  animation: slotTopShine 1.6s var(--ease-out);
}
@keyframes slotTopShine {
  0%   { box-shadow: 0 0 0 rgba(245,197,24,0); }
  40%  { box-shadow: var(--glow-gold), 0 0 60px rgba(245,197,24,0.85); }
  100% { box-shadow: var(--glow-gold), 0 0 36px rgba(245,197,24,0.5); }
}
.slot__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
  background: var(--grad-gold);
  color: #1a1a0e;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* slot-machine windowing: .slot__reel-window is the FIXED 88px viewport
 * with overflow:hidden; .slot__reel is the strip that translateY scrolls.
 * Moving the translate to the strip instead of the window means clipping
 * actually applies to the strip's children. */
.slot__reel-window {
  width: 64px;
  height: 64px;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.slot__reel {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}
.slot__reel img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 64px;            /* each cell exactly 64px tall — matches window */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  align-self: center;
}
@media (min-width: 600px) {
  .slot__reel-window, .slot__reel { width: 88px; height: 88px; }
  .slot__reel-window { height: 88px; }
  .slot__reel img { width: 80px; height: 80px; flex-basis: 88px; }
}
.slot__label {
  text-align: center;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.slot__code {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.06em;
  color: var(--color-gold);
}
@media (min-width: 600px) {
  .slot__code { font-size: var(--fs-lg); }
}
.slot__name {
  font-size: 10px;
  color: var(--color-text-dim);
  margin-top: 2px;
}

@media (max-width: 600px) {
  .reveal__slots { gap: var(--s-2); }
  .slot { padding: var(--s-3); height: 170px; }
  .slot__reel-window { width: 72px; height: 72px; }
  .slot__reel { width: 72px; }
  .slot__reel img { width: 64px; height: 64px; flex-basis: 72px; }
}

/* ===== Confetti finale ===== */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9000;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  opacity: 0.95;
  will-change: transform, opacity;
}
@keyframes confettiFall {
  0% {
    transform: translateY(-40px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-wrap { display: none; }
}

/* ===== Summary grid ===== */
.draw__summary {
  margin-top: var(--s-6);
  text-align: center;
}
.draw__summary h2 {
  font-family: var(--font-display);
  background: var(--grad-gold);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  margin-bottom: var(--s-5);
}
.draw__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
  text-align: left;
}
.draw__staff-card { padding: var(--s-3); }
/* Card header name — clamp to two tight lines so a long name (e.g.
   "Pádraig MacGowan") wraps without making its card taller than the
   single-line cards beside it. Two lines at line-height 1.2 stay within
   the 48px avatar, so every card header is the same height. */
.draw__staff-name {
  min-width: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.draw__team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.draw__team-list li {
  display: grid;
  grid-template-columns: 22px auto 1fr auto;
  gap: var(--s-2);
  align-items: center;
  padding: 4px 6px;       /* same horizontal inset as the gold row */
  border-radius: var(--r-md);
  border: 1px solid transparent;
}
/* Gold team in the post-reveal summary list. */
.draw__team-list li.draw__team--top {
  background: linear-gradient(180deg, rgba(245,197,24,0.12), rgba(245,197,24,0.04));
  border-color: rgba(245,197,24,0.35);
}
.draw__team-star {
  color: var(--color-gold);
  font-size: var(--fs-sm);
  justify-self: end;
}
.draw__small-flag {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  background: var(--color-surface);
}
.draw__team-list li span {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}
.draw__team-list li small {
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
