/* Ruleta semanal de encargados de subir los apuntes. La rueda es un SVG que
   app.js gira con requestAnimationFrame; el puntero queda fijo arriba. El
   sorteo de los lunes se enseña a pantalla completa (.roulette-show). */

.roulette-hero {
  align-items: center;
}

.roulette-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}

.roulette-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 21px;
}

.roulette-wheel-wrap {
  position: relative;
  width: min(420px, 100%);
  padding-top: 14px;
}

.roulette-pointer {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  border-top: 26px solid var(--ink);
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 4px rgba(15, 23, 42, .25));
}

/* Rueda (compartida por la sección y por la animación) */

.roulette-wheel {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.roulette-rim {
  fill: #1e1b4b;
  stroke: #fbbf24;
  stroke-width: 2.5;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .22));
}

.roulette-inner-ring {
  fill: none;
  stroke: rgba(255, 255, 255, .9);
  stroke-width: 1.6;
}

.roulette-bulb {
  fill: #fde68a;
  animation: roulette-bulb 1.2s steps(1) infinite;
}

.roulette-bulb.is-odd {
  animation-delay: -.6s;
}

.roulette-slice path,
.roulette-slice > circle {
  stroke: rgba(255, 255, 255, .85);
  stroke-width: .8;
  transition: opacity .35s ease, filter .35s ease;
}

.roulette-wheel text {
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-weight: 800;
  pointer-events: none;
  user-select: none;
}

.roulette-wheel.has-result .roulette-slice:not(.is-picked) {
  opacity: .32;
}

.roulette-slice.is-picked path {
  stroke: #fff;
  stroke-width: 2.4;
}

.roulette-slice.is-winner {
  animation: roulette-winner .7s ease-in-out 3;
}

.roulette-hub {
  fill: #fbbf24;
  stroke: #fff;
  stroke-width: 3;
}

.roulette-hub-star {
  fill: #fff;
}

/* Sección */

.roulette-replay {
  min-width: 210px;
  padding: 14px 22px;
  font-size: 15px;
}

.roulette-replay svg {
  width: 19px;
  height: 19px;
}

.roulette-done {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.roulette-countdown {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.roulette-countdown > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.roulette-countdown > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.roulette-countdown > span::first-letter {
  text-transform: uppercase;
}

.roulette-countdown-digits {
  display: flex;
  gap: 8px;
}

.roulette-countdown-digits span {
  display: grid;
  min-width: 62px;
  justify-items: center;
  border-radius: 14px;
  background: linear-gradient(160deg, #312e81, #7c3aed);
  color: #fff;
  padding: 10px 8px 8px;
  box-shadow: 0 10px 22px rgba(76, 29, 149, .25);
}

.roulette-countdown-digits b {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.roulette-countdown-digits small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.roulette-side {
  display: grid;
  gap: 17px;
}

.roulette-picks {
  display: grid;
  gap: 10px;
}

.roulette-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2, #f8fbff);
  padding: 12px 14px;
  animation: roulette-pop .35s ease-out;
}

.roulette-pick.is-pending {
  border-style: dashed;
  background: transparent;
  animation: none;
}

.roulette-pick.is-me {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, .12);
}

.roulette-pick .avatar,
.roulette-mystery {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  font-size: 14px;
}

.roulette-mystery {
  display: grid;
  place-items: center;
  border: 2px dashed var(--line-strong, #cbd5e1);
  color: var(--muted);
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.roulette-pick > span:last-child {
  min-width: 0;
}

.roulette-pick small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.roulette-pick strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-family: 'Manrope', sans-serif;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-pick.is-pending strong {
  color: var(--muted);
  font-size: 14px;
}

.roulette-pick strong em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.roulette-me {
  margin: 14px 0 0;
  border-radius: 10px;
  background: rgba(245, 158, 11, .14);
  color: #b45309;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

html.theme-dark .roulette-me {
  color: #fbbf24;
}

.roulette-count,
.roulette-empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.roulette-push {
  margin-top: 14px;
  text-align: left;
}

.roulette-history {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roulette-history li {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.roulette-history li:first-child {
  border-top: 0;
  padding-top: 0;
}

.roulette-history time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.roulette-history span {
  font-size: 13px;
  font-weight: 700;
}

/* Aviso dentro de la web 5 y 1 minuto antes */

.roulette-banner {
  position: fixed;
  z-index: 990;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(560px, calc(100% - 32px));
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: linear-gradient(120deg, #4c1d95, #7c3aed 55%, #db2777);
  color: #fff;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 18px 44px rgba(76, 29, 149, .4), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  transform: translateX(-50%);
  animation: roulette-banner-in .55s cubic-bezier(.2, 1.6, .4, 1);
}

.roulette-banner.is-leaving {
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity .3s ease, transform .3s ease;
}

.roulette-banner-wheel {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
}

.roulette-banner-wheel svg {
  width: 24px;
  height: 24px;
  animation: roulette-turn 1.4s linear infinite;
}

.roulette-banner > div {
  min-width: 0;
  flex: 1;
}

.roulette-banner strong {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.roulette-banner small {
  display: block;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
}

.roulette-banner-go {
  flex: none;
  border-radius: 10px;
  background: #fff;
  color: #5b21b6;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
}

.roulette-banner-close {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  font-size: 20px;
  line-height: 1;
}

.roulette-banner-close:hover {
  background: rgba(255, 255, 255, .15);
}

/* Sorteo a pantalla completa */

body.roulette-show-open {
  overflow: hidden;
}

.roulette-show {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0b0820;
  color: #fff;
  animation: roulette-fade .35s ease-out;
  outline: none;
}

.roulette-show-bg,
.roulette-show-confetti,
.roulette-show-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.roulette-show-bg {
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #4c1d95 0%, #1e1b4b 45%, #0b0820 80%);
}

.roulette-show-rays {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 220vmax;
  height: 220vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .07) 0deg 9deg, transparent 9deg 22.5deg);
  transform: translate(-50%, -50%);
  animation: roulette-rays 40s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0%, transparent 55%);
}

.roulette-show-glow {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(90vmin, 760px);
  height: min(90vmin, 760px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, .5), rgba(124, 58, 237, .25) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: roulette-glow 2.4s ease-in-out infinite;
}

.roulette-show-confetti {
  z-index: 3;
  width: 100%;
  height: 100%;
}

.roulette-show-flash {
  z-index: 2;
  background: radial-gradient(circle at 50% 42%, #fff, rgba(255, 255, 255, .6) 40%, transparent 75%);
  opacity: 0;
}

.roulette-show-flash.is-on {
  animation: roulette-flash .7s ease-out;
}

.roulette-show-top {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.roulette-show-eyebrow {
  overflow: hidden;
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.roulette-show-tools {
  display: flex;
  flex: none;
  gap: 8px;
}

.roulette-show-tool {
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.roulette-show-tool:hover {
  background: rgba(255, 255, 255, .18);
}

.roulette-show-tool[hidden] {
  display: none;
}

.roulette-show-stage {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: clamp(10px, 2.2vh, 22px);
  overflow-y: auto;
  padding: 0 16px 24px;
}

.roulette-show-stage.is-shaking {
  animation: roulette-shake .5s cubic-bezier(.36, .07, .19, .97);
}

.roulette-show-title {
  max-width: 900px;
  margin: 0;
  background: linear-gradient(90deg, #fff, #e9d5ff, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(24px, 4.6vw, 48px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  text-align: center;
  filter: drop-shadow(0 4px 18px rgba(168, 85, 247, .55));
}

.roulette-show-title.is-pop {
  animation: roulette-title-pop .55s cubic-bezier(.2, 1.6, .4, 1);
}

.roulette-show-title.is-win {
  background-image: linear-gradient(90deg, #fde68a, #f472b6, #a78bfa, #60a5fa, #fde68a);
  background-size: 200% auto;
  animation: roulette-title-pop .55s cubic-bezier(.2, 1.6, .4, 1), roulette-shimmer 2s linear infinite;
}

.roulette-show-title.is-gold {
  background-image: linear-gradient(90deg, #fef3c7, #fbbf24, #f59e0b, #fde68a, #fef3c7);
  background-size: 200% auto;
  font-size: clamp(28px, 5vw, 56px);
  animation: roulette-title-pop .55s cubic-bezier(.2, 1.6, .4, 1), roulette-shimmer 1.4s linear infinite;
  filter: drop-shadow(0 4px 24px rgba(251, 191, 36, .75));
}

.roulette-show-wheel {
  position: relative;
  width: min(56vh, 88vw, 560px);
  padding-top: 22px;
}

.roulette-show-wheel .roulette-wheel {
  filter: drop-shadow(0 0 36px rgba(168, 85, 247, .55));
}

.roulette-show-wheel.is-spinning .roulette-bulb {
  animation-duration: .18s;
}

.roulette-show-wheel.is-spinning .roulette-bulb.is-odd {
  animation-delay: -.09s;
}

.roulette-show-pointer {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 34px;
  height: 46px;
  margin-left: -17px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
  transform-origin: 50% 8px;
}

.roulette-show-pointer.is-kick {
  animation: roulette-kick .16s ease-out;
}

.roulette-show-count {
  position: absolute;
  z-index: 2;
  inset: 22px 0 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.roulette-show-count.is-on {
  opacity: 1;
}

.roulette-show-count span {
  display: grid;
  min-width: 42%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(11, 8, 32, .78);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(56px, 13vh, 120px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25), 0 0 50px rgba(168, 85, 247, .8);
  backdrop-filter: blur(4px);
  animation: roulette-count .9s cubic-bezier(.2, 1.4, .4, 1);
}

.roulette-show-count.is-hot span {
  color: #fde68a;
  box-shadow: 0 0 0 4px #f59e0b, 0 0 70px rgba(245, 158, 11, .9);
}

.roulette-show-slots {
  display: grid;
  width: min(640px, 100%);
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.roulette-show-slot {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 2px dashed rgba(255, 255, 255, .25);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
  padding: 12px 14px;
  transition: border-color .3s ease, background .3s ease;
}

.roulette-show-slot .avatar,
.roulette-show-mystery {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  font-size: 15px;
}

.roulette-show-mystery {
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 255, 255, .35);
  color: rgba(255, 255, 255, .7);
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.roulette-show-slot > span:last-child {
  min-width: 0;
}

.roulette-show-slot small {
  display: block;
  color: rgba(255, 255, 255, .6);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.roulette-show-slot strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 255, 255, .6);
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-show-slot.is-revealed {
  border-style: solid;
  border-color: rgba(167, 139, 250, .9);
  background: linear-gradient(135deg, rgba(124, 58, 237, .45), rgba(219, 39, 119, .35));
  box-shadow: 0 0 30px rgba(168, 85, 247, .45);
  animation: roulette-slot-in .6s cubic-bezier(.2, 1.6, .4, 1);
}

.roulette-show-slot.is-revealed strong {
  color: #fff;
}

.roulette-show-slot.is-me {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(245, 158, 11, .5), rgba(234, 88, 12, .35));
  box-shadow: 0 0 40px rgba(251, 191, 36, .6);
}

.roulette-show-slot strong em {
  color: #fde68a;
  font-style: normal;
}

.roulette-show-actions {
  display: flex;
  gap: 10px;
  animation: roulette-slot-in .5s ease-out;
}

.roulette-show-actions[hidden] {
  display: none;
}

.roulette-show-button {
  border-radius: 14px;
  background: linear-gradient(120deg, #fbbf24, #f472b6);
  color: #1e1b4b;
  padding: 13px 22px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(244, 114, 182, .45);
}

.roulette-show-button:hover {
  transform: translateY(-2px) scale(1.03);
}

.roulette-show-button.is-ghost {
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  box-shadow: none;
}

@keyframes roulette-pop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes roulette-bulb {
  0% { fill: #fde68a; filter: drop-shadow(0 0 3px #fbbf24); }
  50% { fill: #7c3aed; filter: none; }
}

@keyframes roulette-winner {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45) drop-shadow(0 0 6px #fff); }
}

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

@keyframes roulette-banner-in {
  from { opacity: 0; transform: translate(-50%, -30px) scale(.9); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes roulette-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes roulette-rays {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes roulette-glow {
  0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes roulette-flash {
  0% { opacity: .9; }
  100% { opacity: 0; }
}

@keyframes roulette-shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-7px, 3px) rotate(-.4deg); }
  40%, 60% { transform: translate(7px, -3px) rotate(.4deg); }
}

@keyframes roulette-title-pop {
  0% { opacity: 0; transform: scale(.6) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes roulette-shimmer {
  to { background-position: 200% center; }
}

@keyframes roulette-kick {
  0% { transform: rotate(0); }
  35% { transform: rotate(-22deg); }
  100% { transform: rotate(0); }
}

@keyframes roulette-count {
  0% { opacity: 0; transform: scale(1.8); }
  60% { opacity: 1; transform: scale(.94); }
  100% { transform: scale(1); }
}

@keyframes roulette-slot-in {
  0% { opacity: 0; transform: scale(.7) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 900px) {
  .roulette-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .roulette-show-slots {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .roulette-show-slot {
    padding: 9px 12px;
  }

  .roulette-show-wheel {
    width: min(50vh, 88vw);
  }

  .roulette-countdown-digits span {
    min-width: 54px;
  }

  .roulette-banner small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .roulette-pick,
  .roulette-show-rays,
  .roulette-show-glow,
  .roulette-bulb,
  .roulette-banner-wheel svg,
  .roulette-slice.is-winner {
    animation: none;
  }
}
