/* ============================================================
   Mi Combinación Euromillones — "noche de sorteo"
   Paleta: noche #0B1230 / #141D45 · marfil bola #F6F1E7
           dorado estrella #F5C542 · coral suerte #EF6C88 · tinta #1B2247
   Tipos:  Bricolage Grotesque (display) · Instrument Sans (texto)
   ============================================================ */

:root {
  --night-1: #0B1230;
  --night-2: #141D45;
  --ink: #1B2247;
  --ivory: #F6F1E7;
  --gold: #F5C542;
  --gold-deep: #D99E1B;
  --coral: #EF6C88;
  --mist: rgba(246, 241, 231, 0.72);
  --line: rgba(246, 241, 231, 0.14);
  --disp: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ivory);
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, #1A1136 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* cielo estrellado sutil */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(245,197,66,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 9%,  rgba(246,241,231,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 32%, rgba(246,241,231,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 44%, rgba(245,197,66,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 71%, rgba(246,241,231,.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 22% 82%, rgba(246,241,231,.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 63%, rgba(245,197,66,.6) 50%, transparent 51%);
}

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 5vw, 48px);
}
.brand { font-family: var(--disp); font-weight: 800; letter-spacing: .01em; }
.brand a { color: inherit; text-decoration: none; }
.langswitch { color: var(--mist); font-size: .9rem; }
.langswitch a { color: var(--mist); text-decoration: none; padding: 4px 6px; }
.langswitch a.on { color: var(--gold); font-weight: 600; }
.langswitch span { opacity: .4; }

main { max-width: 880px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 32px) 64px; }

/* ------- hero ------- */
.hero { text-align: center; padding: clamp(24px, 6vw, 56px) 0 8px; }
.eyebrow {
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 10px;
}
h1 {
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(2rem, 6.5vw, 3.6rem);
  line-height: 1.04; margin: 0 0 16px;
}
h1 em { font-style: normal; color: var(--gold); }
.sub { color: var(--mist); max-width: 560px; margin: 0 auto; line-height: 1.55; }

/* ------- selector ------- */
.picker {
  background: rgba(246, 241, 231, 0.045);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(16px, 4vw, 32px);
  margin-top: 32px;
}
.picker-label {
  font-family: var(--disp); font-size: 1rem; font-weight: 700;
  margin: 0 0 12px; letter-spacing: .02em;
}
.stars-label { margin-top: 22px; color: var(--gold); }

.grid { display: grid; gap: 8px; grid-template-columns: repeat(10, 1fr); }
.grid.stars { grid-template-columns: repeat(6, 1fr); max-width: 420px; }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .grid.stars { grid-template-columns: repeat(4, 1fr); }
}

.pick {
  aspect-ratio: 1; border-radius: 50%;
  font-family: var(--disp); font-weight: 700; font-size: clamp(.85rem, 2.4vw, 1rem);
  border: 1px solid var(--line);
  background: rgba(246, 241, 231, 0.06);
  color: var(--mist);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.pick:hover { transform: translateY(-2px); border-color: rgba(246,241,231,.35); }
.pick:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pick.num.sel {
  background: radial-gradient(circle at 32% 28%, #FFFDF7, var(--ivory) 55%, #D9D2C2);
  color: var(--ink); border-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.12);
}
.pick.star.sel {
  background: radial-gradient(circle at 32% 28%, #FFF0BF, var(--gold) 60%, var(--gold-deep));
  color: #4A3403; border-color: transparent;
  box-shadow: 0 4px 16px rgba(245,197,66,.35), inset 0 -3px 6px rgba(0,0,0,.15);
}
.pick.pop { animation: pop .28s ease; }
@keyframes pop { 40% { transform: scale(1.18); } }
.pick.deny { animation: deny .3s ease; }
@keyframes deny { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; align-items: center; }
button.ghost {
  font-family: var(--body); font-weight: 500; font-size: .92rem;
  background: none; border: 1px solid var(--line); color: var(--mist);
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
button.ghost:hover { border-color: rgba(246,241,231,.4); color: var(--ivory); }
button.cta {
  font-family: var(--disp); font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(180deg, #FFDE7A, var(--gold) 55%, var(--gold-deep));
  color: #3D2B02; border: none; padding: 14px 30px; border-radius: 999px;
  cursor: pointer; margin-left: auto;
  box-shadow: 0 6px 20px rgba(245,197,66,.3);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
button.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245,197,66,.42); }
button.cta:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.hint { color: var(--mist); font-size: .88rem; min-height: 1.2em; margin: 12px 0 0; }

/* ------- bombo / escenario ------- */
.stage { margin-top: 40px; }
.tombola { text-align: center; padding: 28px 0; }
.drum {
  width: 170px; height: 170px; margin: 0 auto 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: radial-gradient(circle at 35% 30%, rgba(246,241,231,.12), rgba(246,241,231,.02) 65%);
  position: relative; overflow: hidden;
  animation: drumspin 1.1s linear infinite;
}
@keyframes drumspin { to { transform: rotate(360deg); } }
.drum .ball {
  position: absolute; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #FFFDF7, var(--ivory) 55%, #D9D2C2);
  animation: jiggle 0.9s ease-in-out infinite alternate;
}
.drum .bs { background: radial-gradient(circle at 32% 28%, #FFF0BF, var(--gold) 60%, var(--gold-deep)); }
.drum .b1 { top: 22%; left: 18%; animation-delay: 0s; }
.drum .b2 { top: 50%; left: 55%; animation-delay: .12s; }
.drum .b3 { top: 60%; left: 22%; animation-delay: .25s; }
.drum .b4 { top: 25%; left: 55%; animation-delay: .4s; }
.drum .b5 { top: 42%; left: 36%; animation-delay: .5s; }
.drum .bs { top: 62%; left: 42%; animation-delay: .3s; }
@keyframes jiggle { to { transform: translate(9px, -13px) rotate(24deg); } }
.drum-msg { color: var(--mist); font-variant-numeric: tabular-nums; }

/* ------- resultado por niveles ------- */
.result {
  border-radius: 20px; padding: clamp(20px, 5vw, 40px);
  border: 1px solid var(--line);
  background: rgba(246,241,231,.045);
  animation: rise .5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.result h2 { font-family: var(--disp); font-weight: 800; font-size: clamp(1.4rem, 4.5vw, 2.1rem); margin: 0 0 14px; }
.result h2.mega { font-size: clamp(1.8rem, 6vw, 2.9rem); }
.result .big { font-size: 1.05rem; line-height: 1.6; color: var(--ivory); }
.result .joke { color: var(--gold); font-weight: 600; line-height: 1.55; }
.result .times { color: var(--mist); font-size: .9rem; }
.moneyline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 1.05rem; }
.moneyline strong { font-family: var(--disp); font-size: 1.7rem; color: var(--gold); }
.jackpot-amount { font-size: clamp(2rem, 7vw, 3.2rem) !important; text-shadow: 0 0 30px rgba(245,197,66,.5); }

.tier-jackpot {
  border-color: var(--gold);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(245,197,66,.22), transparent 60%),
    rgba(246,241,231,.05);
  animation: rise .5s ease, glowpulse 2.4s ease-in-out infinite;
}
@keyframes glowpulse {
  0%, 100% { box-shadow: 0 0 34px rgba(245,197,66,.25); }
  50% { box-shadow: 0 0 60px rgba(245,197,66,.5); }
}
.tier-gold { border-color: rgba(245,197,66,.55); background: radial-gradient(120% 90% at 50% 0%, rgba(245,197,66,.12), transparent 60%), rgba(246,241,231,.05); }
.tier-mid { border-color: rgba(239,108,136,.45); }
.tier-low, .tier-none { }

.comborow { margin-top: 18px; }
.rowlab { display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); margin-bottom: 8px; }
.combo { display: flex; flex-wrap: wrap; gap: 8px; }
.ballv {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700;
  background: radial-gradient(circle at 32% 28%, #FFFDF7, var(--ivory) 55%, #D9D2C2);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 -3px 5px rgba(0,0,0,.1);
  opacity: .45;
}
.ballv.star {
  background: radial-gradient(circle at 32% 28%, #FFF0BF, var(--gold) 60%, var(--gold-deep));
  color: #4A3403;
}
.ballv.hit { opacity: 1; outline: 2px solid var(--coral); outline-offset: 2px; }
.result .comborow:first-of-type .ballv { opacity: 1; outline: none; }
.rulenote { color: var(--mist); font-size: .85rem; border-left: 3px solid var(--coral); padding-left: 12px; }

/* ------- FAQ ------- */
.faq { margin-top: 56px; }
.faq h2 { font-family: var(--disp); font-weight: 800; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--mist); line-height: 1.6; }

/* ------- footer ------- */
footer { max-width: 880px; margin: 0 auto; padding: 24px clamp(16px, 5vw, 32px) 48px; }
.updated { color: var(--mist); font-size: .88rem; }
.disclaimer { color: rgba(246,241,231,.45); font-size: .78rem; line-height: 1.55; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ------- página de sorteo / archivo ------- */
.drawpage h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); }
.daycombo { margin: 24px 0; }
.daycombo .ballv { opacity: 1; width: 52px; height: 52px; font-size: 1.15rem; }
.prizetable { margin-top: 32px; }
.prizetable h2 { font-family: var(--disp); }
.prizetable table { width: 100%; border-collapse: collapse; }
.prizetable th, .prizetable td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.prizetable th { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.prizetable .money { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; }
.drawnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.drawnav a, .backlink { color: var(--gold); text-decoration: none; }
.drawnav a:hover, .backlink:hover { text-decoration: underline; }
.drawlist, .yearlist { list-style: none; padding: 0; }
.drawlist li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.drawlist a { color: var(--ivory); text-decoration: none; }
.drawlist a:hover { color: var(--gold); }
.drawlist .mini, .yearlist .mini { color: var(--mist); font-variant-numeric: tabular-nums; }
.yearlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.yearlist a { font-family: var(--disp); font-weight: 700; font-size: 1.3rem; color: var(--gold); text-decoration: none; }

/* ------- accesibilidad de movimiento ------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drum, .drum .ball { animation: none; }
  .tier-jackpot { animation: rise .01s; }
  .pick, button.cta { transition: none; }
}
