:root {
  --felt: #0c3f21; --felt-dark: #082d18; --felt-light: #11522c;
  --cream: #f3ecd9; --ink: #1b1a17; --amber: #f2b632; --red: #d8452e;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
/* Se comporta como un juego, no como una página: sin selección de texto, sin arrastrar imágenes, sin menú al mantener presionado */
html, body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body, dialog { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, canvas, svg { -webkit-user-drag: none; user-drag: none; }
body { cursor: default; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--felt) repeating-radial-gradient(circle at 50% 38%, transparent 0 46px, rgba(255,255,255,.025) 46px 92px);
  background-size: cover; background-position: center;
  color: var(--cream); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overflow: hidden; touch-action: manipulation;
}
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

#app {
  height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "stage" "panel" "notice";
  padding: env(safe-area-inset-top) 10px env(safe-area-inset-bottom);
}

.top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 2px; }
.logo { margin: 0; line-height: 0; }
.logo img { height: 66px; width: auto; display: block; }
.tools { display: flex; gap: 6px; }
.tool {
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink);
  background: var(--cream); color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1; padding: 0;
  box-shadow: 0 3px 0 var(--ink);
}
.tool.off { background-color: #b9b29e; }

.stage-wrap { grid-area: stage; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.stage { position: relative; width: 200px; height: 200px; flex: none; }
#reels { width: 100%; height: 100%; display: block; }
.banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--amber); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px;
  padding: 8px 20px; font-weight: 900; font-size: clamp(22px, 7vw, 40px); white-space: nowrap; text-align: center;
  box-shadow: 0 6px 0 var(--ink); pointer-events: none; animation: pop .28s ease-out;
}
.banner small { display: block; font-size: .45em; font-weight: 700; letter-spacing: .04em; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } }
.msg { text-shadow: 0 1px 0 var(--ink), 0 0 6px rgba(0,0,0,.8); }
.msg { margin: 6px 0; min-height: 1.5em; font-weight: 700; font-size: 17px; text-align: center; }

.panel { grid-area: panel; padding: 2px 0 8px; }
.row-spin { display: flex; align-items: center; justify-content: center; gap: 16px; }
.row-pills { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.rb, .spin, .pill {
  display: grid; place-items: center; padding: 0; color: #fff;
  background: rgba(5, 36, 18, .72); border: 2px solid rgba(243, 236, 217, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  transition: transform .08s, background .15s;
}
.rb { width: 50px; height: 50px; border-radius: 50%; }
.rb svg { width: 26px; height: 26px; }
.spin { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--amber); background: rgba(5, 36, 18, .8); }
.spin svg { width: 62px; height: 62px; grid-area: 1 / 1; }
.spin .ic-stop { display: none; color: var(--amber); }
.spin.busy .ic-spin { animation: turn .9s linear infinite; opacity: .35; }
.spin.busy .ic-stop { display: block; width: 34px; height: 34px; }
.pill { grid-auto-flow: column; gap: 6px; min-width: 76px; height: 46px; padding: 0 16px; border-radius: 23px; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.pill svg { width: 28px; height: 28px; }
.pill[aria-pressed="true"], .pill.on { background: var(--amber); color: var(--ink); border-color: var(--ink); }
.rb:active, .spin:active, .pill:active { transform: scale(.94); }
.readout { display: flex; flex-wrap: nowrap; justify-content: center; gap: 2px 16px; margin: 10px 0 0; font-size: 16px; font-weight: 800; text-shadow: 0 1px 0 var(--ink), 0 0 6px rgba(0,0,0,.8); }
.readout i { font-style: normal; text-transform: uppercase; color: var(--amber); font-size: .86em; letter-spacing: .03em; }
.readout span { display: inline-flex; align-items: baseline; gap: 6px; }
.readout output { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: left; }
/* anchos fijos: al cambiar las cifras no se mueve nada */
#balance { min-width: 10ch; }
#bet { min-width: 5.5ch; }

.notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  background: var(--cream); color: var(--ink); border-top: 3px solid var(--ink);
  text-align: center; font-size: 13px; font-weight: 700;
}

/* Multiplicador del respin: queda a la vista arriba a la derecha hasta el próximo giro */
.pin { position: absolute; right: -2%; top: -7%; width: 22%; z-index: 2; pointer-events: none; animation: pinpop .3s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 3px 5px rgba(0,0,0,.55)); }
.pin img { display: block; width: 100%; height: auto; }
.pin.txt { width: auto; padding: 4px 12px; background: var(--amber); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; font-weight: 900; font-size: calc(var(--side, 300px) * .08); }
@keyframes pinpop { from { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin { animation: none; } }

/* Cifra grande del premio, al centro de los carretes */
.bigwin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none; white-space: nowrap;
  font-size: calc(var(--side, 300px) * .2); font-weight: 900; font-style: italic; line-height: 1; letter-spacing: .01em; font-variant-numeric: tabular-nums;
  color: #ffe14a; display: flex; align-items: flex-end; justify-content: center;
  text-shadow: .045em 0 0 #7a1206, -.045em 0 0 #7a1206, 0 .045em 0 #7a1206, 0 -.045em 0 #7a1206, .032em .032em 0 #7a1206, -.032em .032em 0 #7a1206, .032em -.032em 0 #7a1206, -.032em -.032em 0 #7a1206, 0 .1em 0 #7a1206, 0 .14em .12em rgba(0,0,0,.55);
  animation: bigpop .32s cubic-bezier(.2, 1.6, .4, 1);
}
.bigwin.low { top: 80%; font-size: calc(var(--side, 300px) * .14); }
.bigwin img { height: 1.15em; width: auto; display: block; margin: 0 -.035em; filter: drop-shadow(0 .06em .05em rgba(0,0,0,.5)); }
@keyframes bigpop { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }

/* Doblar */
.double {
  position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); z-index: 2; min-width: 46%; height: 48px; padding: 0 20px;
  border-radius: 24px; border: 3px solid var(--ink); font-weight: 900; font-size: 17px; color: var(--ink); white-space: nowrap;
  background: linear-gradient(#7af5df, #1fb9a0); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 12px rgba(0,0,0,.5);
}
.dbl { text-align: center; }
.dbl-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 0 !important; }
.dbl-amounts > span { background: rgba(0,0,0,.3); border: 2px solid #ffb52e; border-radius: 12px; padding: 6px; font-size: 13px; }
.dbl-amounts > span > span { display: block; }
.dbl-amounts b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.chip-wrap { perspective: 700px; margin: 16px auto 8px; width: 132px; height: 132px; }
.chip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.3, .1, .2, 1); }
.face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff3a8, #ffc530 55%, #e8900c); border: 4px solid var(--ink); box-shadow: inset 0 0 0 7px rgba(255,255,255,.35), inset 0 0 0 10px #c9760a; }
.face.b { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #d6fff6, #35d6c0 55%, #0f9a86); box-shadow: inset 0 0 0 7px rgba(255,255,255,.35), inset 0 0 0 10px #0b7868; }
.face img { width: 66%; height: 66%; display: block; }
.face.art { background: none; border: 0; box-shadow: none; }
.face.art img { width: 100%; height: 100%; }
.dbl-msg { min-height: 1.5em; font-weight: 800; font-size: 17px; }
.dbl-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dbl-pick button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 60px; border-radius: 14px; border: 3px solid var(--ink); font-weight: 900; font-size: 18px; color: var(--ink); background: linear-gradient(#fdf8e8, #ecdfbf); }
.dbl-pick img { width: 44px; height: 44px; }
.dbl-pick button:disabled, #dblCollect:disabled { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .bigwin { animation: none; } .chip { transition: none; } }

/* Pantalla de carga */
#loader {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px; background: var(--cream); color: var(--ink); transition: opacity .45s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
#loader img { width: min(78vw, 420px); height: auto; display: block; margin-bottom: 14px; }
.load-bar { width: min(70vw, 340px); height: 22px; border: 3px solid var(--ink); border-radius: 12px; background: #fffaf0; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: #0a7d22; border-right: 3px solid var(--ink); border-radius: 0 8px 8px 0; }
.load-pct { margin: 0; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.load-name { margin: 0; font-size: 15px; font-weight: 700; color: #4a463c; }
.notice { z-index: 6; }
@media (prefers-reduced-motion: reduce) { #loader { transition: none; } }

/* Piezas con imagen propia (ver js/config.js) */
.skinned { background-color: transparent !important; background-size: 100% 100% !important; background-repeat: no-repeat !important; border-color: transparent !important; box-shadow: none !important; border-radius: 0; }
.side.skinned { border-radius: 14px; }
.side.skinned[aria-pressed="true"], .side.skinned.on { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px #ffe680); }
.tool.skinned.off { filter: grayscale(.6); }
.stepper button.skinned-icon { background-color: transparent !important; background-size: contain; background-repeat: no-repeat; background-position: center; border: 0 !important; font-size: 0 !important; }
.icon-img { display: block; width: 60%; height: 60%; margin: auto; background-size: contain; background-repeat: no-repeat; background-position: center; font-size: 0; }
.banner.img { background: none; border: 0; box-shadow: none; padding: 0; width: 82%; }
.banner.img.sq { width: 44%; }
.banner.img img { display: block; width: 100%; height: auto; }
.banner.img small { font-size: clamp(18px, 6vw, 30px); color: var(--cream); text-shadow: 0 2px 0 var(--ink), 0 0 6px var(--ink); margin-top: 4px; }

/* Fondo con imagen: vertical en celular, en espejo en pantallas anchas */
body.has-bg { background-image: var(--bg); background-size: cover; background-position: center; }
@media (min-aspect-ratio: 1/1) { body.has-bg { background-image: var(--bg-wide); } }

/* Ventanas */
dialog {
  width: min(540px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: visible;
  color: var(--cream); border: 3px solid #ffd257; border-radius: 20px;
  background: #0a3a1e; background-image: linear-gradient(rgba(8,45,24,.9), rgba(6,34,18,.96)), var(--bg, none); background-size: cover; background-position: center;
  box-shadow: 0 0 0 3px #b3134f, 0 0 0 6px #ff9d1e, 0 18px 50px rgba(0,0,0,.65);
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(3, 18, 9, .8); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 8px 18px; margin: 0; }
.dlg-head h2 {
  margin: 0; font-size: 24px; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1;
  color: #ffd83d; text-shadow: 0 2px 0 #8c1d0a, 0 0 1px #8c1d0a, 2px 0 0 #8c1d0a, -2px 0 0 #8c1d0a, 0 -1px 0 #8c1d0a, 0 4px 8px rgba(0,0,0,.5);
}
.dlg-head button {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; padding: 0;
  background: var(--round-btn, none) center/100% 100% no-repeat, #e91e78; color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 0 var(--ink);
}
.dlg-body { padding: 4px 18px 20px; overflow-y: auto; margin: 0; }
.dlg-body h3 { margin: 16px 0 6px; font-size: 18px; font-weight: 900; font-style: italic; color: #5ff0d0; text-shadow: 0 2px 0 #06302a; }
.dlg-body h3:first-child { margin-top: 6px; }
.dlg-body p { margin: 8px 0; }
.dlg-body b { color: #ffd83d; }
.small { font-size: 14px; }

.facts { list-style: none; margin: 0; padding: 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts li { text-align: center; border-radius: 12px; padding: 6px 4px; background: linear-gradient(#ffe45c, #ff9d1e); color: var(--ink); border: 2px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.55); }
.facts b { display: block; font-size: 21px; font-weight: 900; font-style: italic; line-height: 1.1; }
.facts span { display: block; font-size: 12px; font-weight: 700; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px 18px 8px; }
.tabs button {
  height: 42px; padding: 0 2px; border-radius: 21px; border: 2px solid var(--ink); font-weight: 800; font-size: 15px; color: var(--ink);
  background: linear-gradient(#7af5df, #1fb9a0); box-shadow: inset 0 2px 0 rgba(255,255,255,.45);
}
.tabs button[aria-selected="true"] { background: linear-gradient(#ffe45c, #ff9d1e); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.card {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 7px; align-items: center; padding: 7px 8px; min-width: 0;
  background: linear-gradient(#fdf8e8, #ecdfbf); color: var(--ink); border: 2px solid #ffb52e; border-radius: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.card img { width: 52px; height: 52px; display: block; }
.card-t { min-width: 0; line-height: 1.2; }
.card-n { display: block; font-size: 14px; font-weight: 700; }
.card b { display: block; font-size: clamp(14px, 4.4vw, 19px); white-space: nowrap; font-weight: 900; color: #b3134f; font-variant-numeric: tabular-nums; }
.card-x { display: block; font-size: 12px; }
.card-note { display: block; font-size: 12px; font-weight: 700; margin-top: 3px; color: #0c5a2c; }
.card.wild, .card:last-child { grid-column: 1 / -1; }
.card.wild { grid-template-columns: 78px minmax(0, 1fr); background: linear-gradient(#fff3b0, #ffc94a); }
.card.wild img { width: 78px; height: 78px; }

.mini { display: flex; justify-content: center; gap: 8px; margin: 18px 0 10px; }
.mini-reel { position: relative; width: 64px; height: 174px; padding: 6px 0; border-radius: 10px; background: linear-gradient(#fdf8e8, #ecdfbf); border: 2px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.mini-reel img { width: 50px; height: 50px; display: block; }
.mini-reel.held { border: 4px solid var(--amber); }
.mini-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); width: 52px !important; height: auto !important; }
.mini-tag.txt { background: var(--amber); color: var(--ink); font-size: 11px; font-weight: 900; border: 2px solid var(--ink); border-radius: 9px; text-align: center; }
.mini-reel.spin { justify-content: center; background: repeating-linear-gradient(#fdf8e8 0 14px, #e7d9b6 14px 28px); }
.mini-arrow { font-size: 44px; font-weight: 900; color: #b3134f; line-height: 1; animation: turn 1.6s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

.mults { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.mults img { width: 100%; max-width: 76px; height: auto; display: block; margin: 0 auto; }
.mult-txt { display: block; font-size: 26px; font-style: italic; }
.maxwin { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 14px; background: rgba(0,0,0,.28); border: 2px solid #ffb52e; }
.maxwin img { width: 100%; height: auto; display: block; }
.maxwin p { margin: 0; }
.maxwin div:empty { display: none; }
.maxwin div:empty + p { grid-column: 1 / -1; }

.lines { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0; }
.line-w { text-align: center; font-size: 12px; font-weight: 700; }
.line-d { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 4px; margin-bottom: 4px; border-radius: 8px; background: linear-gradient(#fdf8e8, #ecdfbf); border: 2px solid var(--ink); }
.line-d i { aspect-ratio: 1; border-radius: 3px; background: #d9cba6; }
.line-d i.on { background: #e91e78; box-shadow: inset 0 0 0 2px #7d0c3c; }
.age { font-weight: 800; color: #ffd83d; }
.credits { margin: 0; padding: 8px 18px 12px; text-align: center; font-size: 13px; color: #cfd8c9; border-top: 1px solid rgba(243,236,217,.18); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(243,236,217,.2); font-weight: 700; font-size: 17px; }
.switch-row:last-child { border-bottom: 0; }
[role="switch"] { position: relative; width: 66px; height: 36px; flex: none; border-radius: 18px; border: 3px solid var(--ink); background: #6b7a70; padding: 0; transition: background .15s; }
[role="switch"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--cream); border: 2px solid var(--ink); transition: transform .15s; }
[role="switch"][aria-checked="true"] { background: linear-gradient(#5ff0d0, #19b89c); }
[role="switch"][aria-checked="true"]::after { transform: translateX(30px); background: #ffd83d; }
@media (prefers-reduced-motion: reduce) { [role="switch"], [role="switch"]::after { transition: none; } }

/* Ventanas de ajustes: panel oscuro y plano */
dialog.flat { background: rgba(4, 12, 7, .93); border: 1px solid rgba(243,236,217,.16); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.7); width: min(470px, calc(100vw - 28px)); }
dialog.flat .dlg-head { justify-content: center; padding: 22px 54px 6px; position: relative; }
dialog.flat .dlg-head h2 { font-style: normal; font-size: 19px; letter-spacing: .04em; color: var(--amber); text-shadow: none; text-align: center; }
dialog.flat .dlg-head button { position: absolute; top: 0; right: 0; width: 50px; height: 50px; border: 0; border-radius: 0 14px 0 10px; background: rgba(255,255,255,.07); color: #fff; font-size: 22px; font-weight: 400; text-shadow: none; }
dialog.flat .dlg-body { padding: 12px 26px 26px; }
dialog.flat .small { color: #b9c4bc; text-align: center; }
#autoForm .check, .check { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 38px; height: 38px; flex: none; border: 2px solid rgba(255,255,255,.75); border-radius: 8px; display: grid; place-items: center; }
.check input:checked + .box { background: #2faa5a; border-color: #2faa5a; }
.check input:checked + .box::after { content: ""; width: 18px; height: 9px; border-left: 4px solid #fff; border-bottom: 4px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.check input:focus-visible + .box { outline: 3px solid var(--amber); outline-offset: 2px; }
.rng-l { display: block; margin: 22px 0 6px; text-align: center; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: 15px; }
.rng { display: grid; grid-template-columns: 1fr 104px; align-items: center; gap: 10px; }
.rng output { text-align: right; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rng input { -webkit-appearance: none; appearance: none; width: 100%; height: 48px; margin: 0; background: transparent; cursor: pointer; }
.rng input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(#2faa5a, #2faa5a) 0 / var(--fill, 25%) 100% no-repeat, rgba(255,255,255,.4); }
.rng input::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.4); }
.rng input::-moz-range-progress { height: 4px; border-radius: 2px; background: #2faa5a; }
.rng input::-webkit-slider-thumb { -webkit-appearance: none; width: 58px; height: 42px; margin-top: -19px; border: 0; border-radius: 8px;
  background: linear-gradient(#fff, #fff) calc(50% - 7px) 50% / 3px 14px no-repeat, linear-gradient(#fff, #fff) 50% 50% / 3px 14px no-repeat, linear-gradient(#fff, #fff) calc(50% + 7px) 50% / 3px 14px no-repeat, #2faa5a; }
.rng input::-moz-range-thumb { width: 58px; height: 42px; border: 0; border-radius: 8px;
  background: linear-gradient(#fff, #fff) calc(50% - 7px) 50% / 3px 14px no-repeat, linear-gradient(#fff, #fff) 50% 50% / 3px 14px no-repeat, linear-gradient(#fff, #fff) calc(50% + 7px) 50% / 3px 14px no-repeat, #2faa5a; }
.go { display: block; width: 100%; height: 62px; margin-top: 18px; border: 0; border-radius: 8px; background: #2faa5a; color: #fff; font-size: 19px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.go:active { background: #258a49; }
dialog.flat .switch-row { text-transform: uppercase; letter-spacing: .03em; font-size: 15px; font-weight: 800; }
dialog.flat [role="switch"][aria-checked="true"] { background: #2faa5a; }
dialog.flat [role="switch"][aria-checked="true"]::after { background: #fff; }
dialog:focus { outline: none; }

/* Giro automático: pocos elementos, con aire entre ellos */
dialog.af { width: min(400px, calc(100vw - 32px)); border-radius: 18px; }
dialog.af .dlg-head { padding: 26px 56px 18px; border-bottom: 1px solid rgba(243,236,217,.12); }
dialog.af .dlg-head h2 { font-size: 17px; letter-spacing: .06em; }
dialog.af .dlg-head button { background: transparent; font-size: 20px; opacity: .7; }
dialog.af .dlg-body { padding: 26px 28px 28px; display: grid; gap: 26px; }
.af-group { display: grid; gap: 10px; }
.af-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0; }
.af-row label, .af-switch > span { font-size: 14px; font-weight: 600; color: #c9d2cb; letter-spacing: .01em; text-transform: none; }
.af-row output { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.af input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.af input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(#2faa5a, #2faa5a) 0 / var(--fill, 25%) 100% no-repeat, rgba(255,255,255,.18); }
.af input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
.af input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: #2faa5a; }
.af input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: #fff; border: 5px solid #2faa5a; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.af input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 5px solid #2faa5a; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.af-switch { align-items: center; cursor: pointer; padding-top: 22px; border-top: 1px solid rgba(243,236,217,.12); }
.af-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-switch .tg { position: relative; width: 46px; height: 26px; flex: none; border-radius: 13px; background: rgba(255,255,255,.2); transition: background .15s; }
.af-switch .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.af-switch input:checked + .tg { background: #2faa5a; }
.af-switch input:checked + .tg::after { transform: translateX(20px); }
.af-switch input:focus-visible + .tg { outline: 3px solid var(--amber); outline-offset: 2px; }
.af-note { margin: -8px 0 0; font-size: 13px; line-height: 1.45; color: #93a097; text-align: left; }
dialog.af .go { height: 52px; margin: 0; border-radius: 12px; font-size: 16px; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .af-switch .tg, .af-switch .tg::after { transition: none; } }


table { border-collapse: collapse; width: 100%; }
.hist th, .hist td { padding: 6px; border-bottom: 1px solid rgba(243,236,217,.22); text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.hist th { color: #5ff0d0; font-size: 13px; }
.hist th:first-child, .hist td:first-child, .hist th:last-child, .hist td:last-child { text-align: left; }
.hist td.w { font-weight: 800; color: #ffd83d; }
.primary { width: 100%; height: 56px; margin-top: 14px; border-radius: 28px; border: 3px solid var(--ink); box-shadow: inset 0 3px 0 rgba(255,255,255,.5); background: linear-gradient(#ffe45c, #ff9d1e); color: var(--ink); font-weight: 900; font-size: 19px; }

/* Apaisado y escritorio bajo: carretes a la izquierda, controles a la derecha */
@media (orientation: landscape) and (max-height: 640px) {
  #app { max-width: 980px; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "stage top" "stage panel" "notice notice"; column-gap: 14px; }
  .panel { align-self: center; }
  .top { flex-wrap: wrap; }
}
@media (max-height: 560px) and (orientation: portrait) {
  .logo img { height: 46px; } .spin { width: 80px; height: 80px; } .spin svg { width: 48px; height: 48px; } .rb { width: 44px; height: 44px; } .pill { height: 40px; } .row-pills { margin-top: 6px; } .readout { margin-top: 6px; font-size: 14px; } .msg { margin: 2px 0; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .banner { animation: none; }
  .mini-arrow { animation: none; }
  .rb:active, .spin:active, .pill:active { transform: none; }
  .spin.busy .ic-spin { animation: none; }
}

/* Cifra del premio: casillas de ancho fijo para que crezca pareja desde el centro */
.bigwin { display: flex; justify-content: center; align-items: flex-end; white-space: nowrap; letter-spacing: 0; }
.bigwin .g { display: flex; justify-content: center; align-items: flex-end; flex: none; }
.bigwin .g.d { width: var(--gd, .64em); }
.bigwin .g.s { width: var(--gs, .3em); }
.bigwin .g img { margin: 0; flex: none; }

/* Cifra del premio centrada sin translate en X: en Safari translate(-50%) se calculaba antes de que la cifra tuviera ancho */
.bigwin { left: 0; right: 0; transform: translateY(-50%); }
@keyframes bigpop { from { transform: translateY(-50%) scale(.4); opacity: 0; } }
