:root {
  color-scheme: dark;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color: #fff3df;
  background: #150c19;
  font-synthesis: none;
  --oro: #f5d18b;
  --muted: #c5afb9;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
  isolation: isolate;
  background: radial-gradient(ellipse at 72% 44%, #9d1c4538, transparent 57%),
    radial-gradient(ellipse at 20% 18%, #62315b20, transparent 45%), #150c19;
}
body::after {
  --fondo-slots: url("./slots-bg.webp");
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(#150c1940, #150c1940), var(--fondo-slots) center / cover no-repeat;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, #6e4b25, #f7d58a 48%, #6e4b25);
}
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid #ffe0a1; outline-offset: 4px; }
[hidden] { display: none !important; }
.pagina { width: min(1200px, 100% - 64px); margin-inline: auto; padding: 26px 0 36px; }
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 40px; margin-bottom: 26px; }
.cabecera img { display: block; width: clamp(126px, 15vw, 170px); height: auto; }
.acciones { display: flex; align-items: center; gap: 8px; }
.modo { text-align: right; line-height: 1.2; color: var(--muted); font-size: 12px; margin-right: 10px; }
.icono {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #76505a;
  border-radius: 10px;
  background: #281523;
  color: var(--oro);
  font-size: 23px;
}
.icono[aria-pressed="true"] { background: #654329; border-color: #e3bf77; }
.juego { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); grid-template-areas: "panel maquina"; gap: 46px; align-items: center; }
.zona-maquina { grid-area: maquina; min-width: 0; padding-right: 30px; }
.maquina {
  --alto-rodillo: min(37vw, 420px);
  position: relative;
  width: 100%;
  padding: 12px;
  border-radius: 46px 46px 24px 24px;
  background: linear-gradient(115deg, #8e5a1e, #ffe8a5 4%, #ba7c2c 8%, #fff1b7 12%, #d69e45 16%, #8e511d 50%, #eec674 84%, #fff0ab 91%, #a46722 96%, #f2d28a);
  box-shadow: 0 26px 52px #0009, 0 0 60px #da345a16, inset 0 0 0 1px #fff0ae,
    inset 0 0 0 4px #683211, inset 0 0 0 6px #eab968;
}
.marquesina { display: grid; place-items: center; height: 56px; margin-bottom: 10px; }
h1 {
  margin: 0;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 51px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .16em;
  padding-left: .16em;
  color: #fff0be;
  text-shadow: 0 2px 0 #7c3c16, 0 -1px 0 #fff7ce, 0 4px 6px #55250c80;
}
.carcasa {
  padding: 10px;
  border: 2px solid #481021;
  border-radius: 26px;
  background: linear-gradient(110deg, #330c20, #ed3650 3%, #7c1532 7%, #210d19 13%, #5c1429 87%, #f34759 95%, #3c0e1d);
  box-shadow: inset 0 1px 0 #ffab96, 0 1px 0 #fff0b3;
}
.ventana { position: relative; height: var(--alto-rodillo); border-radius: 17px; background: #eee2c9; }
.rodillos { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 100%; overflow: hidden; border-radius: inherit; box-shadow: 0 0 0 3px #25131a; }
.rodillo { position: relative; overflow: hidden; background: linear-gradient(90deg, #a99678, #eee3d0 11%, #fff6e9 43%, #e4d6bc 88%, #a38a63); }
.rodillo + .rodillo { border-left: 4px solid #b08038; box-shadow: inset 3px 0 4px #6e451540; }
.rodillo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#342016c7, #35251e35 13%, transparent 32%, transparent 68%, #35251e35 87%, #25150bc9);
  box-shadow: inset 0 1px 14px #28160866;
}
.tira { will-change: transform; }
.celda { height: calc(var(--alto-rodillo) / 3); display: grid; place-items: center; }
.simbolo {
  display: block;
  height: 94%;
  aspect-ratio: 1;
  max-width: 100%;
  background-image: url("./simbolos.webp");
  background-size: 300% 200%;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
}
.siete { background-position: 0 0; }
.bar { background-position: 50% 0; }
.campana { background-position: 100% 0; }
.cereza { background-position: 0 100%; }
.limon { background-position: 50% 100%; }
.diamante { background-position: 100% 100%; }
.linea { position: absolute; z-index: 2; top: 50%; left: -15px; right: -15px; height: 2px; background: #ffeeb6b8; box-shadow: 0 0 10px #ffcd58c9; pointer-events: none; }
.linea::before, .linea::after { content: ""; position: absolute; top: -9px; border-block: 10px solid transparent; filter: drop-shadow(0 0 3px #ffd66f); }
.linea::before { left: -1px; border-left: 15px solid #ffdb75; }
.linea::after { right: -1px; border-right: 15px solid #ffdb75; }
.rodillos[data-ganadora="true"] { box-shadow: 0 0 0 3px #f7d183, 0 0 26px #ffcb5f88; }
.rodillo[data-girando="true"] .simbolo { filter: blur(.55px); }
.base { height: 14px; margin-top: 8px; border-radius: 8px; background: linear-gradient(#4a2614, #fbe3a2 26%, #b88133 48%, #fff0b3 70%, #78441e); }
.palanca { position: absolute; right: -24px; top: 34%; width: 13px; height: 39%; border-radius: 10px; background: linear-gradient(90deg, #633617, #f8d68c 48%, #a77229); box-shadow: 3px 5px 9px #0007; }
.palanca::before { content: ""; position: absolute; top: -24px; left: -8px; width: 30px; height: 34px; border: 2px solid #e9c373; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #ffb3a5, #d52443 25%, #780c2b 70%, #390c21); box-shadow: 0 4px 7px #0006; }
.palanca::after { content: ""; position: absolute; bottom: 0; left: -10px; width: 22px; height: 26px; border: 2px solid #a87732; border-radius: 50%; background: linear-gradient(90deg, #eac06c, #fff0ad 35%, #82501e); }
.resultado { min-height: 70px; margin-top: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; text-align: center; }
#estado { color: #dbc6cc; font-size: 14px; }
#premio { font-size: 37px; line-height: 1.1; color: #ffe2a2; font-variant-numeric: tabular-nums; font-weight: 750; }
.panel { grid-area: panel; min-width: 0; padding: 24px 22px; border: 1px solid #66404b; border-radius: 18px; background: #261325a6; box-shadow: 0 16px 36px #0002; }
.datos { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; margin: 0 0 28px; }
.datos > div { min-width: 0; }
.datos dt { margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.datos dd { margin: 0; color: #ffdfa0; font-size: clamp(20px, 2vw, 26px); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controles { display: grid; gap: 12px; }
.controles label { color: #ecdae1; font-size: 14px; }
select { appearance: none; width: 100%; height: 48px; padding: 0 34px 0 12px; background-image: linear-gradient(45deg, transparent 50%, #e7c38d 50%), linear-gradient(135deg, #e7c38d 50%, transparent 50%); background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px; background-size: 5px 5px; background-repeat: no-repeat; border: 1px solid #86616b; border-radius: 9px; background-color: #160f1c; color: #fff4e9; font-size: 15px; }
.girar { height: 56px; margin-top: 4px; border: 1px solid #ffe9b5; border-radius: 11px; background: linear-gradient(#ffdfa1, #e4b66a 65%, #c89649); color: #321a20; box-shadow: inset 0 1px 0 #fff6d1, 0 4px 0 #855025, 0 9px 18px #0004; font-size: 19px; font-weight: 900; letter-spacing: .12em; }
.girar:not(:disabled):hover { filter: brightness(1.08); }
.girar:not(:disabled):active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff6d1, 0 2px 0 #855025; }
.boton-secundario {
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid #9c6a55;
  border-radius: 9px;
  background: #392331;
  color: #ffe0a1;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}
.boton-clave { background: #743348; border-color: #c98879; color: #fff3df; }
.boton-secundario:not(:disabled):hover { filter: brightness(1.18); }
.ver-tabla { min-height: 36px; border: 0; border-radius: 6px; padding: 4px; background: transparent; color: #e7c38d; text-decoration: underline; text-underline-offset: 4px; font-size: 14px; }
dialog { width: min(430px, calc(100% - 28px)); max-height: calc(100svh - 28px); padding: 24px; border: 1px solid #b08a55; border-radius: 18px; color: #fff0e3; background: #211426; box-shadow: 0 24px 60px #000a; }
dialog::backdrop { background: #100711cf; backdrop-filter: blur(5px); }
body:has(dialog[open]) { overflow: hidden; }
.inicio {
  width: min(500px, calc(100% - 32px));
  padding: clamp(18px, 5vh, 40px) clamp(18px, 5vw, 40px);
  border-color: #ad8654;
  border-radius: 24px;
  background: linear-gradient(145deg, #412336, #211225 70%);
  text-align: center;
}
.inicio img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.inicio h2 { margin: 14px 0 20px; color: var(--oro); font-size: clamp(32px, 8vw, 50px); line-height: 1.1; }
.inicio-acciones { display: grid; gap: 10px; }
.inicio-acciones button {
  height: auto;
  min-height: 46px;
  margin: 0;
  padding: 8px 12px;
  font-size: clamp(14px, 3.8vw, 17px);
  letter-spacing: normal;
}
.tabla-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h2 { margin: 0; color: #ffe1a3; font-size: 21px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: #c7aeb7; font-weight: 500; }
th, td { padding: 11px 0; border-bottom: 1px solid #533241; }
th:last-child, td:last-child { text-align: right; color: var(--oro); white-space: nowrap; }
dialog p { margin: 18px 0 0; color: #ccb5bd; font-size: 12px; line-height: 1.6; }
noscript { display: block; margin-top: 20px; }
@media (max-width: 700px) and (orientation: portrait) {
  body::after { --fondo-slots: url("./slots-bg-mobile.webp"); }
  .pagina { width: calc(100% - 32px); padding: 18px 0 26px; }
  .cabecera { height: 34px; margin-bottom: 20px; }
  .cabecera img { width: 112px; }
  .modo { margin-right: 2px; font-size: 12px; }
  .icono { width: 34px; height: 34px; font-size: 21px; border-radius: 8px; }
  .acciones { gap: 5px; }
  .juego { grid-template-columns: 1fr; grid-template-areas: "maquina" "panel"; gap: 14px; }
  .zona-maquina { width: 100%; max-width: 540px; padding-right: 22px; justify-self: center; }
  .maquina { --alto-rodillo: min(80vw, 420px); padding: 10px; border-radius: 35px 35px 20px 20px; }
  .marquesina { height: 45px; margin-bottom: 6px; }
  h1 { font-size: 40px; }
  .carcasa { padding: 8px; border-radius: 20px; }
  .palanca { right: -19px; width: 10px; }
  .palanca::before { width: 24px; height: 28px; left: -7px; }
  .palanca::after { left: -8px; width: 18px; height: 23px; }
  .resultado { min-height: 66px; margin-top: 8px; }
  .panel { width: 100%; max-width: 480px; justify-self: center; padding: 20px; }
  .datos { margin-bottom: 20px; }
}
@media (orientation: landscape) and (max-height: 760px) {
  .pagina { width: min(1200px, calc(100% - 32px)); height: 100svh; padding: 8px 0; }
  .cabecera { height: 32px; margin-bottom: 8px; }
  .cabecera img { width: 130px; }
  .icono { width: 32px; height: 32px; border-radius: 7px; font-size: 20px; }
  .modo { font-size: 12px; }
  .juego { height: calc(100% - 40px); grid-template-columns: minmax(185px, .32fr) minmax(0, 1fr); gap: 24px; }
  .zona-maquina { justify-self: center; width: 100%; padding-right: 22px; }
  .maquina { --alto-rodillo: min(420px, calc(100svh - 168px)); width: min(100%, calc(var(--alto-rodillo) * 1.65 + 72px)); margin-inline: auto; padding: 6px; border-radius: 28px 28px 16px 16px; }
  .marquesina { height: 30px; margin-bottom: 4px; }
  h1 { font-size: 29px; }
  .carcasa { padding: 6px; border-radius: 17px; }
  .ventana { border-radius: 11px; }
  .rodillo + .rodillo { border-left-width: 3px; }
  .base { height: 6px; margin-top: 4px; }
  .palanca { right: -19px; width: 10px; }
  .palanca::before { top: -18px; left: -6px; width: 23px; height: 26px; }
  .palanca::after { left: -8px; width: 18px; height: 23px; }
  .resultado { height: 32px; min-height: 32px; margin-top: 8px; flex-direction: row; gap: 14px; }
  #estado { font-size: 12px; }
  #premio { font-size: 27px; }
  .panel { padding: 14px; border-radius: 13px; }
  .datos { margin-bottom: 12px; gap: 10px; }
  .datos dt { font-size: 12px; margin-bottom: 4px; }
  .datos dd { font-size: 19px; }
  .controles { gap: 7px; }
  .controles label { font-size: 12px; }
  select { height: 40px; font-size: 14px; background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; }
  .girar { height: 44px; margin-top: 3px; font-size: 17px; }
  .boton-secundario { min-height: 32px; padding: 4px; font-size: 12px; }
  .ver-tabla { min-height: 28px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .rodillo[data-girando="true"] .simbolo { filter: none; }
}

#fuera-pruebas a { color: var(--oro); }
.panel-billetera .datos { margin-bottom: 12px; }
.panel-billetera input { min-width: 0; width: 100%; height: 44px; border: 1px solid #86616b; border-radius: 9px; padding: 0 12px; background: #160f1c; color: #fff4e9; font: inherit; }
#datos-saldo { grid-column: 1 / -1; }
.acciones-billetera { display: flex; gap: 8px; }
.acciones-billetera .boton-secundario { flex: 1; }
.panel-billetera > .boton-secundario { width: 100%; margin-top: 8px; }
#mensaje { margin: 8px 0 0; color: #ecdae1; font-size: 13px; }
#mensaje:empty { display: none; }
@media (orientation: landscape) and (max-height: 460px) {
  .panel-billetera { max-height: 100%; overflow-y: auto; }
  .panel-billetera .datos { margin-bottom: 7px; }
  .panel-billetera .datos dd { font-size: 17px; }
  .panel-billetera .controles { gap: 4px; }
  .panel-billetera input { height: 36px; }
}
