:root {
  color-scheme: light;
  --bg: #fbf8ff;
  --white: #fff;
  --ink: #271437;
  --muted: #84758f;
  --violet: #7637ed;
  --violet-2: #8f4fff;
  --violet-deep: #5923c3;
  --lilac: #f0e7ff;
  --line: #e9dff2;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Poppins', 'Trebuchet MS', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid #c8abff; outline-offset: 3px; }
[hidden] { display: none !important; }
.app { min-height: 100svh; overflow: hidden; position: relative; background: var(--bg); }
/* Plano de fondo con detalles geométricos sutiles, sin glassmorphism ni blur. */
.app[data-view="setup"]::before, .app[data-view="results"]::before { content: ''; position: absolute; left: -180px; top: -220px; width: 420px; height: 420px; background: #f4ecff; border-radius: 50%; pointer-events: none; }
.app[data-view="setup"]::after { content: '✳'; position: absolute; bottom: -116px; right: -50px; font-size: 320px; font-weight: 400; line-height: 1; color: #f1e8fc; pointer-events: none; transform: rotate(18deg); }
.header { position: relative; z-index: 3; }
.header-inner { max-width: 1170px; margin: 0 auto; padding: 0 38px; height: 96px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 0; align-items: center; font-size: 21px; font-weight: 800; letter-spacing: -.9px; color: var(--ink); white-space: nowrap; }
.brand span:not(.brand-symbol) { color: var(--violet); }
.brand b { color: var(--violet); font-weight: 900; }
.brand-symbol { color: var(--violet); display: inline-flex; margin-right: 9px; }
.brand-symbol svg { width: 27px; height: 27px; }
.header-sparkle { color: #d7beff; font-size: 27px; transform: rotate(-18deg); }
.main { min-height: calc(100svh - 96px); position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 10px 28px 80px; }
.screen { animation: appear .4s ease both; }
.screen-setup { max-width: 1060px; width: 100%; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(35px, 5vw, 110px); align-items: center; }
.setup-intro { position: relative; align-self: stretch; min-height: 575px; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 57px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--violet); font-weight: 750; letter-spacing: .03em; font-size: 12px; margin-bottom: 21px; }
.eyebrow span { font-size: 19px; line-height: 0; }
h1 { margin: 0; font-weight: 900; line-height: 1.08; letter-spacing: -2.4px; }
.setup-intro h1 { font-size: clamp(45px, 5vw, 67px); }
.heading-purple { color: var(--violet); position: relative; }
.exclamation { display: inline-block; transform: rotate(9deg); }
.setup-intro p { font-size: 15px; line-height: 1.75; font-weight: 400; color: #766884; max-width: 330px; margin: 23px 0 0; }
/* Un dibujo plano, pequeño y alegre acompaña la bienvenida. */
.intro-art { width: 320px; height: 244px; position: relative; margin: 10px 0 0 22px; }
.art-disc { width: 165px; height: 165px; border-radius: 50%; background: #e8d6ff; position: absolute; left: 69px; top: 46px; display: grid; place-items: center; transform: rotate(-8deg); }
.art-disc-core { width: 122px; height: 122px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 66px; display: grid; place-items: center; line-height: 1; transform: rotate(-12deg); }
.art-ring { position: absolute; width: 196px; height: 196px; border: 2px dashed #b486ff; border-radius: 50%; left: 54px; top: 30px; transform: rotate(19deg); }
.art-ring i { position: absolute; display: block; width: 15px; height: 15px; background: #a068ff; border-radius: 50%; left: 50%; top: -9px; }
.art-star { position: absolute; color: #a76cfb; }
.art-star-one { font-size: 38px; top: 5px; left: 20px; transform: rotate(-19deg); }
.art-star-two { font-size: 32px; top: 76px; right: 2px; }
.art-star-three { font-size: 38px; bottom: 13px; left: 12px; }
.setup-form { position: relative; width: 100%; max-width: 515px; padding: 20px 0 0; }
.form-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.form-header label, .winners-row label { font-size: 15px; font-weight: 750; color: var(--ink); }
.participant-count { font-size: 12px; font-weight: 700; color: var(--violet); }
.textarea-shell { background: #fff; border: 2px solid #e9dcf7; border-radius: 20px; padding: 7px; transition: border-color .2s, box-shadow .2s; }
.textarea-shell:focus-within { border-color: #a77df3; box-shadow: 0 0 0 4px #e8dbff; }
textarea { display: block; width: 100%; height: 326px; resize: vertical; min-height: 210px; max-height: 470px; border: 0; border-radius: 13px; background: #fff; outline: none; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 2.05; padding: 19px 21px; }
textarea::placeholder { color: #bbaccc; opacity: 1; }
textarea:focus-visible { outline: none; }
.field-hint { color: #93859d; font-size: 11px; }
.participants-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 10px 4px 0; }
.add-at-toggle { display: inline-flex; gap: 7px; align-items: center; font-size: 11px; font-weight: 600; color: var(--violet-deep); cursor: pointer; white-space: nowrap; }
.add-at-toggle input { width: 16px; height: 16px; accent-color: var(--violet); margin: 0; cursor: pointer; }
.field-detail { font-size: 12px; font-weight: 600; color: var(--violet-deep); margin: 9px 4px 0; }
.winners-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 2px; margin-top: 22px; border-top: 1px solid var(--line); }
.quantity-stepper { background: var(--lilac); display: flex; align-items: center; border-radius: 14px; overflow: hidden; min-height: 49px; }
.quantity-stepper button { appearance: none; background: transparent; border: 0; font-size: 24px; line-height: 1; color: var(--violet); font-weight: 500; width: 49px; height: 49px; }
.quantity-stepper button:hover:not(:disabled) { background: #e5d5fc; }
.quantity-stepper input { appearance: textfield; -moz-appearance: textfield; background: transparent; border: 0; outline: none; color: var(--ink); width: 37px; text-align: center; font-weight: 850; font-size: 18px; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.error-message { border: 1px solid #edb9cb; background: #fff0f5; color: #ad2b5b; font-size: 12px; border-radius: 12px; padding: 12px 14px; margin-bottom: 13px; }
.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 2px solid transparent; padding: 13px 22px; font-size: 14px; font-weight: 800; min-height: 55px; border-radius: 14px; transition: transform .15s, background .15s, border .15s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button-primary { background: var(--violet); color: white; box-shadow: 0 5px 0 #5525bb; }
.button-primary:hover:not(:disabled) { background: #6528da; }
.button-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #5525bb; }
.button-secondary { border-color: #ddc5f8; color: var(--violet-deep); background: transparent; }
.button-secondary:hover { background: #f2e9ff; }
.start-button { width: 100%; margin-top: 4px; justify-content: space-between; padding-left: 25px; }
.button-arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.20); font-size: 23px; font-weight: 400; line-height: 1; }
/* Sorteo: escena oscura en pantalla completa, con detalles vivos pero planos. */
.app[data-view="draw"] { background: #261043; color: #fff; }
.app[data-view="draw"] .brand { color: #fff; }
.app[data-view="draw"] .brand span:not(.brand-symbol), .app[data-view="draw"] .brand b, .app[data-view="draw"] .brand-symbol { color: #cda7ff; }
.app[data-view="draw"] .header-sparkle { color: #9869cd; }
.app[data-view="draw"] .main { padding: 0 24px 36px; }
.screen-draw { width: 100%; max-width: 1000px; min-height: min(720px, calc(100svh - 100px)); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.screen-draw::before, .screen-draw::after { content: ''; width: 140px; height: 140px; border-radius: 50%; border: 1px solid #452667; position: absolute; z-index: 0; pointer-events: none; }
.screen-draw::before { left: -98px; top: 18%; }
.screen-draw::after { right: -120px; bottom: 18%; }
.draw-flair { position: absolute; z-index: 0; pointer-events: none; }
.draw-flair-a { top: 12%; right: 14%; color: #ad77eb; font-size: 35px; transform: rotate(-12deg); }
.draw-flair-b { bottom: 18%; left: 11%; color: #9960d5; font-size: 50px; transform: rotate(25deg); }
.draw-flair-c { bottom: 13%; right: 18%; color: #7344ad; font-size: 26px; }
.draw-heading { z-index: 1; color: #d9baff; font-size: 17px; font-weight: 800; margin-bottom: 30px; text-align: center; }
.orbit-stage { width: min(420px, 72vw); height: min(420px, 72vw); min-width: 270px; min-height: 270px; position: relative; display: grid; place-items: center; }
.orbit-back { position: absolute; inset: 20px; border-radius: 50%; background: #30144f; border: 1px solid #452668; }
.orbit { position: absolute; inset: 0; border: 3px solid #9863e5; border-radius: 50%; animation: orbit-rotate 3.2s linear infinite; }
.orbit::before { content: ''; position: absolute; inset: 15px; border: 1px dashed #4d2c6d; border-radius: 50%; }
.orbit-dot { position: absolute; top: -10px; left: calc(50% - 10px); width: 20px; height: 20px; border-radius: 50%; background: #e1bcff; box-shadow: 0 0 0 5px #63309b; }
.draw-center { position: absolute; inset: 15px; z-index: 2; display: flex; justify-content: center; align-items: center; text-align: center; pointer-events: none; }
.draw-name { font-weight: 900; line-height: 1.1; color: #fff; letter-spacing: -1.7px; font-size: clamp(24px, 5vw, 49px); max-width: 98%; overflow-wrap: anywhere; }
.draw-name.is-countdown { font-size: clamp(100px, 20vw, 164px); letter-spacing: -6px; animation: countdown-pop .47s ease both; }
.draw-name.is-winner { color: #ead7ff; animation: winner-pop .43s cubic-bezier(.22,1.4,.53,1) both; }
.draw-state { z-index: 1; font-size: 13px; font-weight: 550; text-align: center; color: #bd9ad9; margin-top: 32px; min-height: 23px; }
.confetti-layer { position: absolute; inset: -80px; z-index: 3; overflow: visible; pointer-events: none; }
.confetti { position: absolute; left: 50%; top: 50%; width: 9px; height: 17px; background: var(--confetti-color, #b782ff); border-radius: 2px; opacity: 0; animation: confetti-burst 1.15s cubic-bezier(.15,.75,.26,.96) forwards; }
/* Resultados: color, jerarquía y celebración, sin tarjetas. */
.screen-results { width: 100%; max-width: 650px; padding: 30px 10px 50px; }
.results-hero { width: 68px; height: 68px; border-radius: 22px; background: #e8d9ff; color: var(--violet); display: grid; place-items: center; margin-bottom: 20px; position: relative; transform: rotate(-8deg); }
.results-hero-star { font-size: 43px; transform: rotate(8deg); line-height: 1; }
.results-hero-spark { position: absolute; font-size: 21px; right: -21px; top: -12px; color: #b187ef; }
.screen-results h1 { font-size: clamp(41px, 5vw, 60px); letter-spacing: -2.8px; }
.results-summary { margin: 17px 0 28px; font-size: 13px; color: var(--muted); }
.winners-list { border-top: 2px solid #ded0ef; }
.winner-row { position: relative; display: flex; align-items: center; padding: 18px 14px 18px 0; gap: 22px; border-bottom: 1px solid #e4d8f1; min-height: 82px; animation: row-enter .5s ease both; }
.winner-row:first-child { min-height: 106px; background: #f0e6ff; padding-left: 16px; border-bottom-color: #d6bafb; }
.winner-rank { font-size: 23px; font-weight: 900; min-width: 58px; text-align: center; color: #c3abdc; letter-spacing: -.8px; line-height: 1; }
.winner-row:first-child .winner-rank { color: var(--violet); font-size: 31px; }
.winner-row:nth-child(2) .winner-rank { color: #a17bc8; }
.winner-row:nth-child(3) .winner-rank { color: #b19ba4; }
.winner-username { font-size: clamp(17px, 3vw, 23px); font-weight: 800; letter-spacing: -.7px; overflow-wrap: anywhere; min-width: 0; }
.winner-row:first-child .winner-username { font-size: clamp(21px, 3.2vw, 27px); color: var(--violet-deep); }
.winner-row:first-child::after { content: '✦'; margin-left: auto; color: #9d60ef; font-size: 29px; }
.results-actions { display: flex; gap: 12px; margin-top: 32px; }
.results-actions .button { flex: 1; }
@keyframes orbit-rotate { to { transform: rotate(360deg); } }
@keyframes countdown-pop { from { opacity: .1; transform: scale(.56) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes winner-pop { from { opacity: .15; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes confetti-burst { 0% { opacity: 1; transform: translate(0,0) rotate(0deg) scale(.8); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx),var(--dy)) rotate(var(--rotate)) scale(.6); } }
@keyframes appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes row-enter { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 850px) {
  .header-inner { height: 80px; padding: 0 24px; }
  .main { min-height: calc(100svh - 80px); align-items: flex-start; padding-top: 25px; }
  .screen-setup { max-width: 620px; display: block; }
  .setup-intro { padding-top: 5px; min-height: 0; margin-bottom: 35px; }
  .setup-intro h1 { font-size: clamp(42px, 8vw, 60px); }
  .setup-intro p { max-width: 570px; margin-top: 14px; }
  .intro-art { display: none; }
  .setup-form { max-width: none; padding: 0; }
  textarea { height: 288px; }
  .app[data-view="draw"] .main { min-height: calc(100svh - 80px); align-items: center; }
}
@media (max-width: 580px) {
  .header-inner { height: 73px; padding: 0 20px; }
  .brand { font-size: 18px; }
  .brand-symbol svg { width: 23px; height: 23px; }
  .header-sparkle { font-size: 20px; }
  .main { padding: 18px 18px 54px; }
  .setup-intro { margin-bottom: 27px; }
  .eyebrow { font-size: 11px; margin-bottom: 12px; }
  .setup-intro h1 { font-size: clamp(39px, 10vw, 51px); letter-spacing: -2px; }
  .setup-intro p { font-size: 12px; line-height: 1.65; margin-top: 12px; }
  .form-header label, .winners-row label { font-size: 13px; }
  .participant-count { font-size: 11px; }
  .textarea-shell { border-radius: 15px; padding: 4px; }
  textarea { height: 275px; min-height: 200px; font-size: 13px; padding: 14px 16px; }
  .winners-row { padding: 18px 0; margin-top: 13px; }
  .quantity-stepper { min-height: 44px; border-radius: 11px; }
  .quantity-stepper button { width: 43px; height: 44px; }
  .start-button { min-height: 58px; }
  .app[data-view="draw"] .main { min-height: calc(100svh - 73px); padding-bottom: 48px; }
  .screen-draw { min-height: calc(100svh - 128px); }
  .draw-heading { font-size: 15px; margin-bottom: 25px; }
  .orbit-stage { width: min(78vw, 370px); height: min(78vw, 370px); min-width: 250px; min-height: 250px; }
  .draw-name { font-size: clamp(22px, 6vw, 34px); }
  .draw-state { margin-top: 29px; }
  .draw-flair-a { top: 15%; right: 7%; }
  .draw-flair-b { bottom: 15%; left: 5%; }
  .screen-results { padding: 25px 1px 35px; }
  .screen-results h1 { font-size: 45px; }
  .results-hero { width: 61px; height: 61px; }
  .winner-row { gap: 12px; }
  .winner-rank { min-width: 47px; font-size: 21px; }
  .winner-row:first-child { padding-left: 9px; }
  .results-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .winner-row, .draw-name.is-countdown, .draw-name.is-winner, .confetti { animation-duration: .01ms !important; }
  .orbit { animation-duration: 15s; }
  .button { transition: none; }
}

/* Sorteadito V5 — ajustes puntuales, sin alterar el diseño original. */
.art-ring { animation: art-orbit 6s linear infinite; transform-origin: center; }
@keyframes art-orbit { from { transform: rotate(19deg); } to { transform: rotate(379deg); } }

/* La estrellita de la cabecera ahora es un control real de modo claro/oscuro. */
.theme-toggle { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #e6d5f8; background: #f2e9ff; color: #7d40d9; border-radius: 13px; transition: background .15s, transform .15s; }
.theme-toggle:hover { background: #e8d9ff; transform: translateY(-1px); }
.theme-toggle svg { width: 21px; height: 21px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.draw-order { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 17px 2px 19px; }
.draw-order label { font-size: 14px; font-weight: 700; color: var(--ink); }
.draw-order select { appearance: none; max-width: 245px; width: 100%; font: 600 12px 'Poppins',sans-serif; color: var(--violet-deep); background: var(--lilac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23753fbe' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid transparent; border-radius: 12px; padding: 14px 34px 14px 14px; cursor: pointer; }
.draw-order select:focus-visible { outline: 3px solid #c8abff; outline-offset: 2px; }
.start-actions { display: flex; flex-direction: column; gap: 13px; }
.start-actions .start-button { margin: 0; }
.button-immediate { background: #ede0ff; color: #6330be; width: 100%; justify-content: space-between; padding-left: 25px; border-color: #e0c6ff; }
.button-immediate:hover:not(:disabled) { background: #e6d2ff; }
.fast-icon { font-size: 23px; line-height: 1; }

/* Ranking visible únicamente durante el modo inmediato. */
.app[data-view="fast"] { background: #261043; color: #fff; }
.app[data-view="fast"] .brand { color: #fff; }
.app[data-view="fast"] .brand span:not(.brand-symbol),
.app[data-view="fast"] .brand b, .app[data-view="fast"] .brand-symbol { color: #cda7ff; }
.app[data-view="fast"] .main { align-items: flex-start; padding-top: 65px; padding-bottom: 65px; }
.screen-fast { width: 100%; max-width: 665px; }
.fast-topline { font-size: 13px; font-weight: 750; color: #d5b4ff; margin-bottom: 13px; }
.fast-spark { display: inline-block; font-size: 19px; margin-right: 8px; }
.screen-fast h1 { font-size: clamp(36px, 6vw, 57px); line-height: 1.16; letter-spacing: -2px; }
.screen-fast h1 span { color: #c494ff; }
.fast-progress { min-height: 24px; margin: 15px 0 25px; color: #ceafea; font-size: 13px; font-weight: 600; }
.fast-ranking { border-top: 2px solid #68458b; }
.fast-row { display: flex; align-items: center; gap: 20px; min-height: 70px; padding: 15px 17px 15px 5px; border-bottom: 1px solid #483063; transition: background .12s; }
.fast-row.is-active { background: #4b237b; border-left: 4px solid #bd80ff; padding-left: 1px; }
.fast-row.is-revealed { background: #33204e; }
.fast-row.is-revealed[data-rank="1"] { background: #533083; }
.fast-rank { width: 58px; flex-shrink: 0; text-align: center; font-size: 24px; font-weight: 900; color: #9e76c7; }
.fast-row.is-active .fast-rank, .fast-row.is-revealed .fast-rank { color: #c9a2ff; }
.fast-name { font-size: clamp(16px, 3vw, 22px); font-weight: 780; overflow-wrap: anywhere; min-width: 0; color: #a991c7; }
.fast-row.is-active .fast-name { color: #fff; }
.fast-row.is-revealed .fast-name { color: #f7eaff; }

/* Modo oscuro: controles, fondo, ilustración y resultados coherentes. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171020;
  --white: #2a2037;
  --ink: #f6efff;
  --muted: #b7a7c6;
  --violet: #ad78ff;
  --violet-2: #c299ff;
  --violet-deep: #cda8ff;
  --lilac: #30213e;
  --line: #41324e;
}
:root[data-theme="dark"] .app[data-view="setup"]::before,
:root[data-theme="dark"] .app[data-view="results"]::before { background: #22162f; }
:root[data-theme="dark"] .app[data-view="setup"]::after { color: #241830; }
:root[data-theme="dark"] .setup-intro p { color: #b5a5c4; }
:root[data-theme="dark"] .art-disc { background: #3a2850; }
:root[data-theme="dark"] .art-ring { border-color: #8256bb; }
:root[data-theme="dark"] .art-star { color: #bb82ff; }
:root[data-theme="dark"] .textarea-shell { background: #251b31; border-color: #58416e; }
:root[data-theme="dark"] .textarea-shell:focus-within { border-color: #a77df3; box-shadow: 0 0 0 4px #3b2559; }
:root[data-theme="dark"] textarea { background: #251b31; }
:root[data-theme="dark"] textarea::placeholder { color: #927ca9; }
:root[data-theme="dark"] .field-hint { color: #ae9abb; }
:root[data-theme="dark"] .quantity-stepper button:hover:not(:disabled) { background: #4a3166; }
:root[data-theme="dark"] .draw-order select { color: #ead7ff; border-color: #4a355d; background-color: #30213e; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23d4b4fa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .button-immediate { background: #392451; color: #f2e3ff; border-color: #654687; }
:root[data-theme="dark"] .button-immediate:hover:not(:disabled) { background: #492f68; }
:root[data-theme="dark"] .button-secondary { border-color: #71508e; color: #e3c9ff; }
:root[data-theme="dark"] .button-secondary:hover { background: #352348; }
:root[data-theme="dark"] .theme-toggle { background: #322344; border-color: #63467f; color: #e0bdff; }
:root[data-theme="dark"] .theme-toggle:hover { background: #443056; }
:root[data-theme="dark"] .results-hero { background: #3a2850; }
:root[data-theme="dark"] .winners-list { border-top-color: #614575; }
:root[data-theme="dark"] .winner-row { border-bottom-color: #40304d; }
:root[data-theme="dark"] .winner-row:first-child { background: #302041; border-bottom-color: #61417f; }
:root[data-theme="dark"] .winner-row:first-child .winner-username { color: #d6b6ff; }
:root[data-theme="dark"] .winner-rank { color: #9171aa; }
:root[data-theme="dark"] .winner-row:nth-child(2) .winner-rank { color: #ae8cdb; }
:root[data-theme="dark"] .winner-row:nth-child(3) .winner-rank { color: #a997b4; }
:root[data-theme="dark"] .error-message { background: #3a1d37; border-color: #873b65; color: #ffadc9; }
:root[data-theme="dark"] .app[data-view="draw"],
:root[data-theme="dark"] .app[data-view="fast"] { background: #140b26; }

@media (max-width: 580px) {
  .theme-toggle { width: 39px; height: 39px; border-radius: 12px; }
  .theme-toggle svg { width: 19px; height: 19px; }
  .draw-order { align-items: stretch; flex-direction: column; gap: 9px; }
  .draw-order label { font-size: 13px; }
  .draw-order select { max-width: none; width: 100%; }
  .start-actions { gap: 12px; }
  .button-immediate { min-height: 55px; }
  .app[data-view="fast"] .main { padding: 28px 18px 52px; }
  .screen-fast h1 { font-size: 37px; }
  .fast-row { min-height: 62px; gap: 8px; }
  .fast-rank { width: 47px; font-size: 20px; }
  .fast-name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .art-ring { animation: none; }
}
