/* Stage screen. Layout and colours follow docs/design-guidelines/extracted-design.md */

body {
  min-height: 100vh;
  background: var(--stage-bg-from);
  color: var(--stage-text);
  overflow-x: hidden;
}

/* ---------- Backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 38%, var(--stage-bg-mid) 0%, transparent 62%),
    radial-gradient(80% 60% at 12% 8%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(70% 60% at 92% 12%, rgba(233, 53, 193, 0.16), transparent 60%),
    linear-gradient(165deg, var(--stage-bg-from), var(--stage-bg-to));
}

.backdrop__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(760px, 70vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--stage-glow) 0%, transparent 66%);
  opacity: 0.55;
  filter: blur(30px);
}

.confetti-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.confetti-decor i {
  position: absolute;
  display: block;
  border-radius: 2px;
  opacity: 0.75;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 30px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 13px;
  background: linear-gradient(145deg, #a855f7, #6d28d9);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.5), var(--ring-inner);
}

.brand__text {
  display: grid;
  line-height: 1.24;
}

.brand__text strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.01em;
}

.brand__text small {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--stage-text-muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(35, 20, 82, 0.7);
  color: var(--stage-text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, transform 0.12s;
}

.pill:hover {
  background: rgba(60, 35, 130, 0.8);
  border-color: rgba(255, 255, 255, 0.26);
}

.pill:active {
  transform: translateY(1px);
}

.pill.is-off {
  opacity: 0.5;
}

.user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  transition: background 0.16s;
}

.user:hover {
  background: rgba(255, 255, 255, 0.07);
}

.user__hello {
  font-size: 14px;
  color: var(--stage-text-muted);
}

.user__hello strong {
  color: #fff;
}

.user__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(150deg, #a855f7, #6d28d9);
  box-shadow: var(--ring-inner);
}

.user__caret {
  color: var(--stage-text-muted);
  font-size: 12px;
}

/* ---------- Layout ---------- */

.stage {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 392px;
  gap: 26px;
  padding: 10px 30px 18px;
  align-items: start;
}

.col {
  min-width: 0;
  display: grid;
  gap: 20px;
  align-content: start;
}

.col--center {
  justify-items: center;
  gap: 14px;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--stage-card);
  border: 1px solid var(--stage-card-border);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card), var(--ring-inner);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel__head .panel__title {
  margin: 0;
  flex: 1;
}

.panel__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.1em;
  /* Roomy enough for stacked accents: "KẾT QUẢ", "LỊCH SỬ". */
  line-height: 1.45;
  color: var(--gold-bright);
  text-align: center;
}

.panel__title--starred {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.panel__title--starred span {
  color: var(--gold);
  font-size: 12px;
}

.linkish {
  border: none;
  background: none;
  color: #b39dff;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}

.linkish:hover {
  color: #d4c6ff;
  text-decoration: underline;
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #ded7f7;
}

.step p strong {
  color: #fff;
}

.step__icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--stage-inset);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #c4b5fd;
}

.step__icon--2 {
  color: #a5b4fc;
}

/* ---------- Stats ---------- */

.stats {
  display: grid;
  gap: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--stage-inset);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat__icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.stat__icon--blue {
  background: linear-gradient(145deg, #60a5fa, var(--stat-blue));
}
.stat__icon--green {
  background: linear-gradient(145deg, #4ade80, var(--stat-green));
}
.stat__icon--orange {
  background: linear-gradient(145deg, #fb923c, var(--stat-orange));
}

.stat__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stat__body small {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--stage-text-muted);
}

.stat__body strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.24;
}

/* ---------- Centre column ---------- */

.headline {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3.4vw, 52px);
  letter-spacing: 0.02em;
  text-align: center;
  /* Vietnamese stacked diacritics (Ắ, Ế, Ộ...) need headroom; a tight
     line-height clips them, and with background-clip:text the missing
     part simply is not painted. */
  line-height: 1.32;
  background: linear-gradient(96deg, #ffffff 4%, #f0abfc 38%, #ffe27a 74%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(233, 53, 193, 0.35));
}

.subbadge {
  margin: 0;
  padding: 8px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0.04em;
  line-height: 1.35;
  background: rgba(48, 26, 110, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--ring-inner);
}

/* ---------- Wheel ---------- */

.wheel-area {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
  padding-top: 20px;
}

.wheel-stack {
  position: relative;
  display: grid;
  place-items: center;
  line-height: 0;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  /* translateZ promotes this to its own compositing layer. The canvas below
     repaints every frame while spinning; without a separate layer the browser
     re-blends this element each time and it visibly washes out. */
  transform: translateX(-50%) translateZ(0);
  width: 34px;
  height: 46px;
  z-index: 4;
  background: linear-gradient(160deg, #ff6a5e, var(--pointer-red));
  border-radius: 50% 50% 50% 50% / 42% 42% 66% 66%;
  clip-path: path('M17 46 C17 46 34 26 34 16 A17 17 0 1 0 0 16 C0 26 17 46 17 46 Z');
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.55));
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
}

.wheel-rotor {
  transform-origin: 50% 50%;
  border-radius: 50%;
  box-shadow: var(--glow-wheel), 0 24px 46px rgba(0, 0, 0, 0.5);
  line-height: 0;
}

.wheel-rotor.is-winner {
  box-shadow: 0 0 110px rgba(255, 226, 122, 0.8), 0 24px 46px rgba(0, 0, 0, 0.5);
}

.wheel-hub {
  position: absolute;
  z-index: 3;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 0;
  border: 4px solid #8b6914;
  /* Solid colour under the gradient so the hub never reads as translucent. */
  background-color: var(--gold);
  background-image: radial-gradient(circle at 38% 30%, #ffe27a, var(--gold) 52%, #d9a521);
  color: #2a1500;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 -6px 14px rgba(139, 105, 20, 0.45);
  /* Own compositing layer - see the note on .wheel-pointer. */
  transform: translateZ(0);
  transition: transform 0.14s var(--ease-out), box-shadow 0.18s;
}

.wheel-hub:hover:not(:disabled) {
  transform: translateZ(0) scale(1.04);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 34px rgba(255, 226, 122, 0.6);
}

/* The hub sits at the centre of the wheel and is disabled for the whole spin.
   Dimming or desaturating it there makes the wheel look broken mid-spin, so
   the disabled state only changes the cursor. */
.wheel-hub:disabled {
  cursor: not-allowed;
}

.wheel-hub__icon {
  font-size: clamp(18px, 2.9vw, 34px);
  line-height: 1;
}

.wheel-hub__label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(14px, 2.3vw, 33px);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

/* Glowing stage podium under the wheel */
.podium {
  display: block;
  width: 74%;
  height: 54px;
  margin-top: -26px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(168, 85, 247, 0.85), transparent 68%),
    radial-gradient(ellipse at 50% 50%, rgba(76, 29, 149, 0.9), transparent 72%);
  box-shadow: 0 0 70px rgba(124, 58, 237, 0.75);
  filter: blur(1px);
}

/* ---------- Grid display (alternative) ---------- */

.grid-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--tile-min, 170px), 1fr));
  gap: 14px;
  width: 100%;
}

.tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px 12px;
  min-height: 124px;
  border-radius: 18px;
  background: var(--stage-card);
  border: 1.5px solid var(--stage-card-border);
  transition: transform 0.14s var(--ease-out), background 0.14s, border-color 0.14s,
    opacity 0.3s;
}

.grid-board.is-dense .tile {
  padding: 12px 8px;
  min-height: 78px;
  gap: 7px;
}

.tile__image {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.28);
}

.grid-board.is-dense .tile__image {
  width: 42px;
  height: 42px;
}

.tile__name {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.35vw, 22px);
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.grid-board.is-dense .tile__name {
  font-size: clamp(12px, 1vw, 16px);
}

.tile.is-lit {
  background: linear-gradient(150deg, var(--gold), var(--gold-deep));
  border-color: var(--gold-bright);
  color: #201400;
  transform: scale(1.06);
  box-shadow: 0 0 34px rgba(246, 196, 63, 0.55);
}

.tile.is-out {
  opacity: 0.25;
  filter: grayscale(1);
}

.tile.is-out::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  transform: rotate(-14deg);
}

.tile.is-winner {
  background: linear-gradient(150deg, var(--gold-bright), var(--gold));
  border-color: #fff;
  color: #201400;
  transform: scale(1.1);
  box-shadow: 0 0 60px rgba(255, 226, 122, 0.85);
  animation: winner-pulse 1.3s ease-in-out infinite;
}

@keyframes winner-pulse {
  50% {
    box-shadow: 0 0 90px rgba(255, 226, 122, 1);
  }
}

/* ---------- Controls ---------- */

.controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.spin-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 999px;
  padding: 16px 52px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(96deg, var(--magenta-deep), var(--magenta) 52%, #7c3aed);
  box-shadow: 0 12px 34px rgba(233, 53, 193, 0.42), var(--ring-inner);
  transition: transform 0.12s var(--ease-out), box-shadow 0.18s, filter 0.15s;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(233, 53, 193, 0.55);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.spin-btn:disabled {
  filter: grayscale(0.7);
  opacity: 0.5;
  cursor: not-allowed;
}

.spin-btn__ring {
  font-size: 0.85em;
  opacity: 0.9;
}

.ctrl-btn {
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 700;
  color: var(--stage-text);
  background: rgba(35, 20, 82, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.ctrl-btn:hover:not(:disabled) {
  background: rgba(60, 35, 130, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ctrl-btn.is-on {
  background: rgba(246, 196, 63, 0.2);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.counter {
  font-size: 15px;
  font-weight: 700;
  color: var(--stage-text-muted);
}

.counter strong {
  color: var(--gold-bright);
  font-size: 19px;
}

.fineprint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--stage-text-muted);
}

.stage-message {
  margin: 0;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(246, 196, 63, 0.14);
  border: 1px solid rgba(246, 196, 63, 0.35);
  color: var(--gold-bright);
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  max-width: 640px;
}

/* ---------- Result card ---------- */

.result-card {
  border-radius: 15px;
  background: var(--stage-inset);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 18px;
  text-align: center;
  min-height: 236px;
  display: grid;
  place-content: center;
}

.result-empty {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--stage-text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.result-empty p {
  margin: 0;
}

.result-empty__icon {
  font-size: 48px;
  filter: grayscale(0.6);
  opacity: 0.5;
}

.trophy {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.trophy__icon {
  font-size: 74px;
  line-height: 1;
  filter: drop-shadow(0 0 26px rgba(255, 200, 60, 0.85));
}

.trophy__photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 26px rgba(255, 200, 60, 0.6);
}

.result-win__label {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #e6dfff;
}

.result-win__name {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--gold-bright);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-win__code {
  display: inline-block;
  margin: 0 auto 10px;
  padding: 7px 20px;
  border-radius: 10px;
  font-size: 14px;
  color: #e6dfff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.result-win__code strong {
  color: #fff;
}

.result-win__time {
  margin: 0;
  font-size: 12.5px;
  color: var(--stage-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- History table ---------- */

.table-wrap {
  overflow: auto;
  max-height: 300px;
  margin: 0 -4px;
}

.table-wrap.is-expanded {
  max-height: 560px;
}

.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.history thead th {
  position: sticky;
  top: 0;
  background: rgba(24, 12, 58, 0.96);
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.45;
  color: var(--stage-text-muted);
  padding: 8px 8px;
  white-space: nowrap;
}

.history tbody td {
  padding: 7px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.history td.cell-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

.history .empty {
  text-align: center;
  color: var(--stage-text-muted);
  padding: 28px 8px;
  white-space: normal;
}

.tag-n {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  padding: 3px 7px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  color: #fff;
}

.tag-win,
.tag-out {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-win {
  color: #f9a8d4;
  background: rgba(236, 72, 153, 0.18);
  border: 1px solid rgba(236, 72, 153, 0.5);
}

.tag-out {
  color: #b9b1d8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Knocked-out rows sit back so the winners stand out in a long list. */
.history tr.is-out td {
  color: var(--stage-text-muted);
}

.history tr.is-out .tag-n {
  opacity: 0.55;
}

/* ---------- Footer ---------- */

/* Lives inside the centre column, not at page level. The side columns are
   different widths (288px vs 392px), so anything centred on the page sits ~52px
   to the right of the wheel and the spin button. */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--stage-text-muted);
  text-align: center;
}

.footer__shield {
  color: #8b7ed8;
}

/* ---------- Confetti ---------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* ---------- Winner modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 6, 28, 0.82);
  backdrop-filter: blur(7px);
  animation: fade-in 0.2s var(--ease-out);
}

/* ---- Winner card ---- */

.wm-card {
  position: relative;
  text-align: center;
  padding: 34px clamp(26px, 5vw, 56px) 28px;
  border-radius: 22px;
  background: linear-gradient(168deg, #16224d 0%, #101a3d 55%, #0d1433 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 80px rgba(246, 196, 63, 0.3), 0 26px 60px rgba(0, 0, 0, 0.6);
  width: min(500px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  animation: pop-in 0.32s var(--ease-out);
  outline: none;
}

.wm-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #cfd6f5;
  font-size: 17px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.wm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.wm-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: 0.01em;
  /* Vietnamese stacked diacritics (Ắ, Ế, Ộ...) need headroom; a tight
     line-height clips them, and with background-clip:text the missing
     part simply is not painted. */
  line-height: 1.3;
  background: linear-gradient(180deg, #fff6d2 0%, #f7cf55 55%, #e0992e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 12px rgba(246, 196, 63, 0.45));
}

.wm-sub {
  margin: 4px 0 0;
  font-size: clamp(14px, 1.4vw, 17px);
  color: #e6ebff;
}

/* ---- Badge: rays + laurel + photo + crown ---- */

.wm-badge {
  position: relative;
  width: min(232px, 60vw);
  aspect-ratio: 1;
  margin: 22px auto 0;
  display: grid;
  place-items: center;
}

.wm-rays {
  position: absolute;
  inset: -14%;
  animation: rays-turn 22s linear infinite;
}

@keyframes rays-turn {
  to {
    transform: rotate(360deg);
  }
}

.wm-laurel {
  position: absolute;
  bottom: 1%;
  width: 31%;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

/* Sit outside the photo ring rather than overlapping the face. */
.wm-laurel--left {
  left: -11%;
}

.wm-laurel--right {
  right: -11%;
  transform: scaleX(-1);
}

.wm-photo {
  position: relative;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--gold);
  background: linear-gradient(160deg, #2b3a72, #1b2450);
  box-shadow: 0 0 34px rgba(246, 196, 63, 0.6), inset 0 0 22px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}

.wm-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wm-photo__initial {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 9vw, 78px);
  color: var(--gold-bright);
}

.wm-crown {
  position: absolute;
  top: -13%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

/* ---- Ribbon ---- */

.wm-ribbon {
  position: relative;
  margin: -16px auto 0;
  width: fit-content;
  max-width: 100%;
  padding: 11px 34px;
  background: linear-gradient(180deg, #ffe9a8, #f5c542 52%, #d9a01f);
  color: #4a2c00;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(17px, 2.1vw, 23px);
  line-height: 1.4;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  /* Notched ends, like a real award ribbon. One symmetric clip-path instead of
     two stacked pseudo-elements, which left a stray tail on the right. */
  padding-inline: 44px;
  clip-path: polygon(
    0 0,
    100% 0,
    calc(100% - 18px) 50%,
    100% 100%,
    0 100%,
    18px 50%
  );
}

/* ---- Meta ---- */

.wm-code {
  display: inline-block;
  margin: 16px auto 0;
  padding: 8px 24px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.06em;
  color: #dfe5ff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(246, 196, 63, 0.45);
}

.wm-code strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  color: var(--gold-bright);
  margin-left: 4px;
}

.wm-time {
  margin: 12px 0 0;
  font-size: 13px;
  color: #a7afd6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wm-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #8f97c2;
  line-height: 1.5;
}

.wm-note:empty {
  display: none;
}

/* ---- Actions ---- */

.wm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.wm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0.04em;
  transition: transform 0.12s var(--ease-out), box-shadow 0.16s, background 0.16s;
}

.wm-btn:active {
  transform: translateY(1px);
}

.wm-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e8ecff;
}

.wm-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.13);
}

.wm-btn--gold {
  border: none;
  background: linear-gradient(180deg, #ffe08a, #f0b429);
  color: #4a2c00;
  box-shadow: 0 8px 22px rgba(240, 180, 41, 0.4);
}

.wm-btn--gold:hover {
  box-shadow: 0 12px 30px rgba(240, 180, 41, 0.55);
  transform: translateY(-1px);
}

.wm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Keyboard users get a ring; a programmatic focus() must not draw one, or the
   gold button appears double-outlined the moment the popup opens. */
.wm-btn:focus:not(:focus-visible),
.wm-close:focus:not(:focus-visible) {
  outline: none;
}

.wm-btn:focus-visible,
.wm-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

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

@media (max-width: 1400px) {
  .stage {
    grid-template-columns: 264px minmax(0, 1fr);
  }
  .col--right {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    display: grid;
  }
}

@media (max-width: 1024px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 18px 18px;
  }
  .col--left {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .topbar {
    padding: 14px 18px 4px;
  }
  .user__hello {
    display: none;
  }
}

@media (max-width: 560px) {
  .spin-btn {
    padding: 14px 34px;
  }
  .footer {
    text-align: center;
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .wm-card,
  .wm-rays,
  .tile.is-winner {
    animation: none;
  }
  .tile,
  .wheel-hub,
  .spin-btn {
    transition: none;
  }
}
