/* Ruleta de Celutimba. MOBILE-FIRST. Misma paleta que la portada (azul noche,
   azul electrico y naranja) con el verde/rojo/negro clasicos de la mesa. */

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('../fonts/oswald.woff2') format('woff2');
}

:root {
  --fondo:       #081226;
  --panel:       #0d1b38;
  --borde:       #1c3564;
  --azul:        #2f9df0;
  --azul-brillo: #6cc4ff;
  --naranja:     #f7941d;
  --naranja-brillo: #ffb54d;
  --dorado:      #e6b84c;
  --verde:       #0c8a45;
  --rojo:        #d4133a;
  --negro-mesa:  #1c1c24;
  --texto:       #eaf3ff;
  --texto-suave: #9fb4d8;
  --titulo: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* La barra (volver, saldo, sonido, menu) y su modal viven en css/barra.css,
   compartidos con los otros juegos y la portada. */

/* --- Mesa ------------------------------------------------------------------ */

.mesa {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 14px 12px 24px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* La rueda */
.rueda {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rueda__historial {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
}
.resultado {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--titulo);
  font-weight: 600;
  font-size: .95rem;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.resultado.verde { background: var(--verde); }
.resultado.rojo  { background: var(--rojo); }
.resultado.negro { background: var(--negro-mesa); border: 1px solid rgba(255, 255, 255, .15); }

.rueda__aro { position: relative; }
#rlWheel {
  width: min(66vw, 280px);
  height: min(66vw, 280px);
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55));
}
.rueda__flecha {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid var(--dorado);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6));
  z-index: 2;
}

/* Aviso de premio sobre la rueda */
.premio {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(8, 18, 38, .78);
  border-radius: 50%;
  z-index: 3;
}
.premio__numero {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 2.2rem;
  padding: 2px 18px;
  border-radius: 12px;
  color: #fff;
}
.premio__numero.verde { background: var(--verde); }
.premio__numero.rojo  { background: var(--rojo); }
.premio__numero.negro { background: var(--negro-mesa); border: 1px solid rgba(255,255,255,.2); }
.premio__monto {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--naranja-brillo);
  text-shadow: 0 0 18px rgba(247, 148, 29, .8);
}

/* --- Pano ------------------------------------------------------------------ */

.pano { width: 100%; }

.pano__acciones {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.enlace {
  font-family: var(--titulo);
  font-weight: 500;
  font-size: .85rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--texto-suave);
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
}
.enlace:hover { color: var(--texto); }

/* En el telefono la mesa NO se aplasta: scrollea de costado, asi cada casilla
   y cada zona de caballo sigue siendo tocable con el dedo. */
.pano__marco {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.pano__tabla {
  position: relative;
  display: grid;
  grid-template-columns: 38px repeat(12, 1fr) 40px;
  grid-template-rows: repeat(3, 40px) 34px 34px;
  gap: 4px;
  min-width: 560px;
}

.celda {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--titulo);
  font-weight: 600;
  font-size: .95rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: filter .1s;
}
.celda:hover { filter: brightness(1.25); outline: 1px solid var(--dorado); }
.celda.verde { background: var(--verde); }
.celda.rojo  { background: var(--rojo); }
.celda.negro { background: var(--negro-mesa); }
.celda.afuera {
  background: rgba(255, 255, 255, .05);
  font-size: .78rem;
  letter-spacing: .5px;
}
.celda.gano {
  outline: 2px solid var(--dorado);
  box-shadow: 0 0 14px rgba(230, 184, 76, .7);
  z-index: 1;
}

/* Zonas entre celdas (caballo, calle, esquina, linea) */
.zona {
  position: absolute;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
}
.zona::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.zona:hover { background: rgba(230, 184, 76, .22); }
.zona:hover::after { background: var(--dorado); width: 8px; height: 8px; }

/* La ficha apilada con su monto */
.ficha-puesta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--naranja-brillo), #c25f00);
  color: #331a00;
  border: 2px solid #fff;
  font-size: .6rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

/* --- Fichas y controles ---------------------------------------------------- */

.control { width: 100%; }

.fichas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ficha {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--titulo);
  font-weight: 600;
  font-size: .8rem;
  color: #fff;
  border: 2px dashed rgba(255, 255, 255, .5);
  background: radial-gradient(circle at 35% 30%, #555, #2a2a30);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s;
}
.ficha:hover { transform: translateY(-2px); }
.ficha.on {
  border-style: solid;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(247, 148, 29, .55), 0 4px 14px rgba(0, 0, 0, .5);
  transform: translateY(-2px);
}
.ficha[data-v="5"]    { background: radial-gradient(circle at 35% 30%, #7a8aa0, #3a4658); }
.ficha[data-v="10"]   { background: radial-gradient(circle at 35% 30%, #4d9bff, #1f5bbf); }
.ficha[data-v="25"]   { background: radial-gradient(circle at 35% 30%, #34d17a, #0c8a45); }
.ficha[data-v="50"]   { background: radial-gradient(circle at 35% 30%, #b98cff, #6d33d6); }
.ficha[data-v="100"]  { background: radial-gradient(circle at 35% 30%, #ff9b3d, #c25f00); }
.ficha[data-v="500"]  { background: radial-gradient(circle at 35% 30%, #ff5470, #b3122f); }

.control__fila {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.mini {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: .95rem;
  color: var(--texto-suave);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
}
.mini:hover { color: #fff; border-color: var(--azul); }

.total {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 4px 10px;
}
.total__etiqueta { color: var(--texto-suave); font-size: .72rem; }
.total__monto {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dorado);
}

.girar {
  font-family: var(--titulo);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  color: #331a00;
  background: linear-gradient(180deg, var(--naranja-brillo), var(--naranja) 55%, #d97407);
  border: 1px solid #ffd08a;
  border-radius: 12px;
  padding: 12px 30px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(247, 148, 29, .5);
  transition: transform .12s ease, box-shadow .12s ease;
}
.girar:hover:not(:disabled) { box-shadow: 0 6px 30px rgba(247, 148, 29, .75); }
.girar:active:not(:disabled) { transform: scale(.96); }
.girar:disabled { opacity: .55; cursor: default; }

.aviso {
  margin-top: 10px;
  text-align: center;
  color: #ff8fa3;
  font-weight: 600;
}

/* --- Velo de acceso -------------------------------------------------------- */

.velo {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 9, 20, .8);
  backdrop-filter: blur(4px);
}
.velo__caja {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 26px 24px;
  max-width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.velo__caja h2 { font-family: var(--titulo); font-weight: 600; }
.velo__caja p { color: var(--texto-suave); }
.velo__boton { text-decoration: none; display: inline-block; }

/* --- Pantalla grande ------------------------------------------------------- */

@media (min-width: 700px) {
  #rlWheel { width: 320px; height: 320px; }
  .pano__tabla { min-width: 0; }
  .mesa { gap: 20px; }
}
