: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: 72px; 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: 320px; height: 275px; 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; } }

/* Logo al centro, flameando como banderín, con un brillo que lo recorre */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 0 4px; }
.top .tools { justify-self: end; }
.top .tools.left { justify-self: start; }
.logo { position: relative; justify-self: center; }
.logo img { height: 84px; }
.logo.fx img { visibility: hidden; }
.flagc { position: absolute; left: 0; display: block; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
@media (max-height: 560px) and (orientation: portrait) { .logo img { height: 56px; } }

/* Carga: la pelota rueda sobre la barra */
.load-track { position: relative; width: min(70vw, 340px); margin-top: 16px; }
.load-track .load-bar { width: 100%; height: 14px; }
#loader .load-ball { position: absolute; top: 50%; left: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); will-change: transform, left; }

/* Comprar giros gratis */
.buy { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 10px; height: 42px; padding: 0 18px; border-radius: 21px;
  border: 2px solid var(--ink); background: linear-gradient(#ffe45c, #ff9d1e); color: var(--ink); font-weight: 800; font-size: 15px; white-space: nowrap;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 10px rgba(0,0,0,.4); }
.buy b { font-variant-numeric: tabular-nums; font-weight: 900; }
.buy:active { transform: scale(.97); }
/* con imagen: el botón es la imagen y el precio va dentro, bajo el título */
.buy.art { --bw: min(60vw, 240px); position: relative; width: var(--bw); height: auto; aspect-ratio: var(--ar, 2.7); padding: 0; margin-bottom: 10px; border: 0; border-radius: 0;
  background: var(--img) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.buy.art .buy-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.buy.art b { position: absolute; left: 62.5%; top: 66%; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap;
  font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif; font-style: italic; font-weight: 900; font-size: calc(var(--bw) * .19); letter-spacing: .01em; color: #6d0a12; }
.buy:disabled { filter: grayscale(.5) brightness(.8); }

dialog.buyd { width: min(360px, calc(100vw - 36px)); padding: 26px 22px 24px; text-align: center; overflow: visible;
  background: #0a1a3c; border: 4px solid var(--cream); border-radius: 18px; box-shadow: 0 0 0 4px #8a1228, 0 18px 50px rgba(0,0,0,.7); color: var(--cream); }
dialog.buyd[open] { display: block; }
dialog.buyd h2 { margin: 0 0 14px; font-size: 24px; font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 1.1; color: #ffd83d; text-shadow: 0 2px 0 #7a1206; }
.buy-cost { display: flex; justify-content: center; align-items: flex-end; height: 64px; font-size: 54px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.buy-cost img { height: 1em; width: auto; display: block; margin: 0 -.03em; }
.buy-warn { color: #ff9c8a; font-weight: 700; margin: 8px 0 0; min-height: 0; font-size: 15px; }
.buy-warn:empty { display: none; }
.buy-btns { display: flex; justify-content: center; gap: 34px; margin-top: 22px; }
.by { width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--cream); color: #fff; font-size: 40px; font-weight: 900; line-height: 1; padding: 0; box-shadow: 0 5px 0 rgba(0,0,0,.45); }
.by.yes { background: #2faa5a; } .by.no { background: #d8322e; }
.by:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.45); }
.by:disabled { opacity: .35; filter: grayscale(1); }
.by.art { width: 92px; height: 92px; border: 0; border-radius: 0; background: var(--img) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 4px 5px rgba(0,0,0,.5)); }
.by.art span { display: none; }
/* con imagen de ventana: el título viene dibujado en la imagen */
dialog.buyd.art { background: var(--img) center / 100% 100% no-repeat; border: 0; box-shadow: none; border-radius: 0; aspect-ratio: var(--ar, .9); padding: 0;
  display: none; grid-template-rows: 43% 21% 36%; align-items: center; filter: drop-shadow(0 14px 24px rgba(0,0,0,.7)); }
dialog.buyd.art[open] { display: grid; }
dialog.buyd.art h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
dialog.buyd.art .buy-cost { grid-row: 2; height: auto; font-size: clamp(34px, 12vw, 54px); }
dialog.buyd.art { grid-template-columns: 1fr; }
dialog.buyd.art .buy-btns { grid-row: 3; margin: 0; align-self: start; padding-top: 4%; }
dialog.buyd.art { width: min(340px, calc(100vw - 40px), calc((100dvh - 40px) * .9)); }
@media (max-height: 640px) { .buy { height: 36px; margin-bottom: 6px; font-size: 14px; } .buy.art { --bw: min(48vw, 190px); margin-bottom: 8px; } }

/* Transición de entrada y salida de los giros gratis: destello y logo en grande */
#fsTrans { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; overflow: hidden; --d: 1.7s; }
#fsTrans > div { animation-duration: var(--d); animation-fill-mode: both; }
.tr-dim { position: absolute; inset: 0; background: rgba(5, 12, 30, .78); animation-name: trdim; }
.tr-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, #fff 0%, rgba(255,250,225,.9) 30%, rgba(255,235,170,0) 72%); animation-name: trflash; animation-timing-function: ease-out; }
.tr-rays { position: absolute; left: 50%; top: 46%; width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax;
  background: repeating-conic-gradient(rgba(255,226,140,.34) 0 7deg, rgba(255,226,140,0) 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 42%); mask: radial-gradient(circle, #000 0%, transparent 42%); animation-name: trrays; animation-timing-function: linear; }
.tr-box { position: relative; text-align: center; animation-name: trlogo; animation-timing-function: cubic-bezier(.2, 1.4, .4, 1); margin-top: -8vh; }
.tr-logo { position: relative; width: min(80vw, 62vh, 540px); margin: 0 auto; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.tr-logo img { display: block; width: 100%; height: auto; }
.tr-shine { position: absolute; inset: 0; -webkit-mask: var(--logo) center / 100% 100% no-repeat; mask: var(--logo) center / 100% 100% no-repeat;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%) no-repeat; background-size: 260% 100%;
  animation: trshine calc(var(--d) * .55) ease-in-out calc(var(--d) * .22) both; }
.tr-text { margin: 14px 0 0; font-size: clamp(22px, 6.5vw, 40px); font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .03em; color: #ffd83d;
  text-shadow: 0 2px 0 #7a1206, 2px 0 0 #7a1206, -2px 0 0 #7a1206, 0 -2px 0 #7a1206, 0 6px 12px rgba(0,0,0,.6); }
@keyframes trdim { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes trflash { 0% { opacity: 0; transform: scale(.4); } 10% { opacity: 1; transform: scale(1.3); } 45% { opacity: 0; transform: scale(1.8); } 100% { opacity: 0; } }
@keyframes trrays { 0% { opacity: 0; transform: rotate(0deg) scale(.6); } 18% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; transform: rotate(50deg) scale(1.1); } }
@keyframes trlogo { 0% { opacity: 0; transform: scale(.2); } 22% { opacity: 1; transform: scale(1); } 82% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes trshine { from { background-position: 130% 0; } to { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) {
  .tr-flash, .tr-rays, .tr-shine { display: none; }
  .tr-box, .tr-dim { animation-name: trdim; animation-timing-function: linear; }
}

/* Juego de 5 carretes: tarjetas con tres pagos, 20 líneas, arte de giros gratis */
.card-p { list-style: none; margin: 2px 0 0; padding: 0; }
.card-p li { display: flex; align-items: baseline; gap: 6px; line-height: 1.25; }
.card-p i { font-style: normal; font-weight: 800; font-size: 12px; width: 1em; color: #0c5a2c; }
.card-p b { font-size: clamp(12px, 3.6vw, 15px); }
.card-p li:first-child b { font-size: clamp(13px, 3.9vw, 16px); }
.card:not(.wild) { grid-template-columns: 40px minmax(0, 1fr); gap: 6px; padding: 7px 6px; }
.card:not(.wild) img { width: 40px; height: 40px; }
.card:last-child { grid-column: auto; }
.lines.l5 { grid-template-columns: repeat(5, 1fr); gap: 8px 6px; }
.lines.l5 .line-d { grid-template-columns: repeat(5, 1fr); padding: 3px; gap: 1px; }
.fs-art { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 8px 0; }
.fs-art img { width: 84px; height: 84px; }
.banner { top: 40%; font-size: clamp(18px, 5.5vw, 34px); }
.banner.img { width: 52%; top: 38%; }
.bigwin.low { top: 84%; }
.pin { right: -1%; top: -12%; width: 17%; }

/* Slotsmania: arena oscura, logo ancho, cuadrícula 6x5 */
body { background: #17130f radial-gradient(ellipse at 50% 22%, #7a1f17 0%, #3a1410 38%, #17130f 75%); }
.top { grid-template-columns: 52px 1fr 52px; }
.logo img, .logo .flagc { max-width: min(100%, 300px); }
.logo img { height: auto; width: min(64vw, 300px); }
.pill { min-width: 66px; padding: 0 12px; }
.row-pills { gap: 8px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; padding: 0; }
.chips li { padding: 3px 10px; border-radius: 12px; background: #f2b61f; color: #17130f; border: 2px solid #17130f; font-weight: 900; font-style: italic; font-size: 14px; }
.card-p i { width: 2.9em; font-size: 11px; }
.banner small { text-transform: uppercase; letter-spacing: .06em; }
.pin.txt { right: 1%; top: -9%; background: #d1382c; color: #f3ecd9; border-color: #17130f; font-style: italic; }
.bigwin { color: #f2b61f; text-shadow: .045em 0 0 #17130f, -.045em 0 0 #17130f, 0 .045em 0 #17130f, 0 -.045em 0 #17130f, .032em .032em 0 #17130f, -.032em .032em 0 #17130f, .032em -.032em 0 #17130f, -.032em -.032em 0 #17130f, 0 .1em 0 #d1382c, 0 .14em .12em rgba(0,0,0,.55); }
@media (max-height: 640px) { .logo img { width: min(46vw, 220px); } }

/* Slotsmania: ventanas en los colores del logo (tinta, crema, rojo, amarillo) */
:root { --felt: #17130f; --felt-dark: #0f0c0a; --felt-light: #2a1512; }
.rb, .spin, .pill { background: rgba(23, 19, 15, .78); }
.spin { background: rgba(23, 19, 15, .85); }
dialog { background: #1d1612; background-image: linear-gradient(rgba(34,20,16,.94), rgba(20,15,12,.97)), var(--bg, none); border-color: #f2b61f; box-shadow: 0 0 0 3px #17130f, 0 0 0 6px #d1382c, 0 18px 50px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(10, 7, 6, .82); }
.dlg-head h2, dialog.buyd h2 { color: #f2b61f; text-shadow: 0 2px 0 #17130f, 2px 0 0 #17130f, -2px 0 0 #17130f, 0 -1px 0 #17130f, 0 4px 0 #d1382c; }
.dlg-head button { background: var(--round-btn, none) center/100% 100% no-repeat, #d1382c; border: 2px solid #17130f; }
.dlg-body h3 { color: #f2b61f; text-shadow: 0 2px 0 #17130f; }
.dlg-body b { color: #f2b61f; }
.facts li, .tabs button[aria-selected="true"] { background: #f2b61f; box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.tabs button { background: #f3ecd9; box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.card { background: #f3ecd9; }
.card b { color: #d1382c; }
.card-note { color: #17130f; }
.double { background: #f2b61f; box-shadow: inset 0 -4px 0 rgba(0,0,0,.16), 0 4px 12px rgba(0,0,0,.5); }
dialog.buyd:not(.art) { background: #1d1612; }
.dbl-amounts > span { border-color: #f2b61f; }

/* Slotsmania con arte: cifra del botón de compra, ventana de compra y carteles */
.buy.art { --bw: min(66vw, 264px); }
.buy.art b { left: 78.5%; top: 50%; font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif; font-size: calc(var(--bw) * .082); color: #17130f; letter-spacing: 0; }
dialog.buyd.art { grid-template-rows: 49% auto 1fr; }
dialog.buyd.art .buy-cost { font-size: clamp(30px, 10vw, 46px); }
dialog.buyd.art .buy-btns { padding-top: 5%; }
dialog.buyd.art .by.art, dialog.buyd.art .by { width: 76px; height: 76px; }
.banner.img { width: 74%; top: 44%; }
.banner.img small { position: absolute; left: 0; right: 0; bottom: 21%; margin: 0; font-size: clamp(15px, 4.6vw, 26px); color: #17130f; text-shadow: none; font-weight: 900; font-style: italic; }
body.has-bg { background-image: linear-gradient(rgba(23,19,15,.5) 0, rgba(23,19,15,.25) 14%, rgba(23,19,15,.3) 55%, rgba(23,19,15,.86) 72%, rgba(23,19,15,.94) 100%), var(--bg); background-size: cover; background-position: center top; }
@media (min-aspect-ratio: 1/1) { body.has-bg { background-image: linear-gradient(rgba(23,19,15,.35), rgba(23,19,15,.35)), var(--bg-wide); background-position: center; } }

.bigwin.plate { top: 51.8%; animation: none; }
.bigwin.plate img { filter: 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; } }
