/* =========================
   RESET BÁSICO
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #fdf8f0 0, #f1ecff 40%, #e8f4ff 100%);
  color: #222;
}

/* Pequeño patrón de fondo sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

/* =========================
   CONTENEDOR PRINCIPAL
   ========================= */
.app {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px 12px;
}

/* =========================
   PANTALLAS
   ========================= */
.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 4px;
}

.screen--active {
  display: flex;
  animation: fadeIn 260ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen__inner {
  background: linear-gradient(145deg, #ffffff 0%, #fbfbff 40%, #f6fbff 100%);
  border-radius: 22px;
  padding: 22px 18px 26px;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(148, 163, 184, 0.18);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* halo decorativo */
.screen__inner::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 100%;
  background: radial-gradient(circle, rgba(76, 201, 240, 0.16), transparent 60%);
  top: -120px;
  right: -80px;
  pointer-events: none;
}

/* =========================
   TIPOGRAFÍA
   ========================= */
.title {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -0.04em;
  color: #111827;
}

.subtitle {
    text-align: center;
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 18px;
}

.title-small {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111827;
}

/* =========================
   BOTONES
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 130ms ease,
    box-shadow 130ms ease,
    background 130ms ease,
    color 130ms ease,
    border-color 130ms ease;
  width: 100%;
  letter-spacing: 0.01em;
}

.btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.btn--primary {
    background: linear-gradient(135deg, #6842ff, #ac42ff);
    color: #ffffff;
    box-shadow: 0px 3px 10px rgb(142 66 255 / 74%);
    margin-bottom: 10px;
}

.btn--primary:hover {
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0px 8px 20px rgb(142 66 255 / 55%);
  transform: translateY(-1px);
}






.btn--secondary{
  background: linear-gradient(180deg,#f8fbff 0%, #e7eefb 45%, #d7dfef 100%) !important;
  color:#0f172a !important;
  border-radius: 14px !important;
  padding: 12px 18px !important;
  font-weight: 800 !important;
  letter-spacing: .2px !important;
  box-shadow:
    0 14px 24px rgba(15,23,42,.18),
    0 6px 10px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -10px 18px rgba(15,23,42,.08) !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.7) !important;
  cursor: pointer !important;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease !important;
}

.btn--secondary:hover{
  transform: translateY(-2px) !important;
  box-shadow:
    0 18px 30px rgba(15,23,42,.22),
    0 8px 14px rgba(15,23,42,.12),
    inset 0 1px 0 rgba(255,255,255,.98),
    inset 0 -10px 18px rgba(15,23,42,.06) !important;
  filter: brightness(1.02) !important;
}

.btn--secondary:active{
  transform: translateY(1px) !important;
  box-shadow:
    0 10px 18px rgba(15,23,42,.18),
    inset 0 10px 16px rgba(15,23,42,.10),
    inset 0 -1px 0 rgba(255,255,255,.9) !important;
}

.btn--secondary:focus-visible{
  outline: none !important;
  box-shadow:
    0 0 0 3px rgba(59,130,246,.35),
    0 14px 24px rgba(15,23,42,.18),
    inset 0 1px 0 rgba(255,255,255,.95) !important;
}












.btn--ghost {
  background: transparent;
  color: #4b5563;
  border: 1px dashed rgba(148, 163, 184, 0.9);
}

.menu-buttons,
.results-buttons {
  width: 100%;
  margin-top: 18px;
}

.game-buttons {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15%;
}

.game-buttons .btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.85rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* =========================
   CARDS DE RECORDS
   ========================= */
.records {
    width: 100%;
    font-size: 1rem;
    letter-spacing: -0.3px;
    color: #4b5563;
    background: rgba(248, 250, 252, 0.96);
    border-radius: 16px;
    padding: 30px 12px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.records::before {
    content: "Récords";
    position: absolute;
    top: -10px;
    left: 12px;
    font-size: 0.68rem;
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.35);
}

.records p {
  display: flex;
  justify-content: space-between;
}

.records span {
  font-weight: 600;
  color: #111827;
}

/* =========================
   LINK DOMINIO
   ========================= */
.domain-link {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #222;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.domain-link:hover {;
  color: #010101;
}

/* =========================
   BANNER ANUNCIO
   ========================= */
.ad-box {
  width: 100%;
  max-width: 340px;
  min-height:565px;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #cbd5f5);
  margin-top: 0px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.ad-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 200ms ease-out;
}

.ad-box:hover img {
  transform: scale(1.05);
}

.ad-countdown {
  margin-top: 12px;
  font-size: 1rem;
  color: #374151;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(243, 244, 246, 0.95);
  border: 1px solid rgba(209, 213, 219, 0.8);
}

/* =========================
   CABECERA JUEGO
   ========================= */
.game-header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mode-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0b0b0b;
  background: linear-gradient(180deg, #e1e6fb 25%, #ffffff 45%, #e0e6fa 100%);
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: -0.15px;
  border: 1px solid #d1d5e9;
}

.round-label {
    font-size: 0.9rem;
    color: #0b0b0b;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #e1e6fb 25%, #ffffff 45%, #e0e6fa 100%);
    border: 1px solid #d1d5e9;
}

/* =========================
   CRONÓMETRO
   ========================= */
.timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 10px 0 14px;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, #e1e6fb 25%, #ffffff 45%, #e0e6fa 100%) !important;
    border: 1px solid #cbd4e8;
}

/* Cada dígito tiene su propia caja fija */
.timer-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;        /* ANCHO FIJO → no se mueve NUNCA */
  height: 38px;       /* ALTO FIJO */
  border-radius: 4px;
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25);
  border: 1px solid #d1d5ea;
  color: #000000;
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1;     /* sin saltos verticales */

  /* Fuente monoespaciada para que todos los números ocupen igual */
  font-family: "Roboto Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Centésimas un poco más pequeñas pero misma caja fija */
.timer-digit--small {
  width: 26px;
  height: 38px;
  font-size: 1.8rem;
}

/* Separador ":" también con tamaño fijo */
.timer-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 32px;
  color: #111;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
}



/* =========================
   LETRAS OBJETIVO
   ========================= */
.target-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 40px;
}

.target-letter {
  width: 39px;
  height: 39px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.99rem;
  font-weight: 700;
  background: linear-gradient(180deg, #e1e6fb 25%, #ffffff 45%, #e0e6fa 100%);
  color: #111827;
  border: 1px solid #d1d5e9;
}

.target-letter--hit {
  background: radial-gradient(circle at top, #4ade80, #16a34a);
  color: #fff;
  box-shadow: 0 3px 8px rgba(34, 197, 94, 0.55);
  transform: translateY(1px);
  border: 1px solid #24b258;
}

/* =========================
   ROSCO
   ========================= */
.rosco-container {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.rosco {
    position: relative;
    width: min(320px, 85vw);
    height: min(320px, 85vw);
    border-radius: 50%;
    background: radial-gradient(circle at center, #f9fafb00 0, #e5e7eb2e 55%, #d1d5db 100%);
}

/* Letras del rosco */
.rosco-letter {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 4px solid #fff !important;
  border: none;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 2px 2px rgba(0,0,0,.28) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35);
  transform: translate(-50%, -50%);
  transition:
    transform 80ms ease,
    box-shadow 80ms ease,
    opacity 130ms ease,
    filter 130ms ease;
}

/* Colores variados para el rosco */
.rosco-letter--color-0{background:radial-gradient(circle at 30% 25%,#ffd1d1 0%,#ff7b7b 35%,#f04444 75%,#c81d1d 100%)}
.rosco-letter--color-1  { background: radial-gradient(circle at 30% 25%, #ffe2cf 0%, #fdba74 35%, #fb923c 75%, #c2410c 100%); }
.rosco-letter--color-2  { background: radial-gradient(circle at 30% 25%, #fff3c4 0%, #fcd34d 35%, #fbbf24 75%, #b45309 100%); }
.rosco-letter--color-3  { background: radial-gradient(circle at 30% 25%, #c9f7d6 0%, #4ade80 35%, #22c55e 75%, #15803d 100%); }
.rosco-letter--color-4  { background: radial-gradient(circle at 30% 25%, #c9fff7 0%, #5eead4 35%, #2dd4bf 75%, #0f766e 100%); }
.rosco-letter--color-5  { background: radial-gradient(circle at 30% 25%, #cdefff 0%, #38bdf8 35%, #0ea5e9 75%, #075985 100%); }
.rosco-letter--color-6  { background: radial-gradient(circle at 30% 25%, #d7e6ff 0%, #60a5fa 35%, #3b82f6 75%, #1d4ed8 100%); }
.rosco-letter--color-7  { background: radial-gradient(circle at 30% 25%, #dde0ff 0%, #818cf8 35%, #6366f1 75%, #3730a3 100%); }
.rosco-letter--color-8  { background: radial-gradient(circle at 30% 25%, #f0d9ff 0%, #c084fc 35%, #a855f7 75%, #6b21a8 100%); }
.rosco-letter--color-9  { background: radial-gradient(circle at 30% 25%, #ffd2ea 0%, #f472b6 35%, #ec4899 75%, #9d174d 100%); }
.rosco-letter--color-10 { background: radial-gradient(circle at 30% 25%, #ffe2cc 0%, #fdba74 35%, #f97316 75%, #c2410c 100%); }
.rosco-letter--color-11 { background: radial-gradient(circle at 30% 25%, #c9f7d6 0%, #4ade80 35%, #22c55e 75%, #15803d 100%); }


.rosco-letter:hover {
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);

}

.rosco-letter:active {
  transform: translate(-50%, -50%) scale(0.95);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

.rosco-letter--hit {

  filter: grayscale(0.15);
}

/* =========================
   RESULTADOS
   ========================= */
.final-time,
.best-time {
  font-size: 1rem;
  margin-top: 8px;
  color: #374151;
}

.final-time span {
  font-weight: 700;
  color: #111827;
}

.best-time span {
  font-weight: 600;
  color: #0f172a;
}

.new-record {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid #14b8a6;
}

.new-record--hidden {
  display: none;
}

/* =========================
   FOOTER JUEGO
   ========================= */
.game-footer {
  margin-top: 18px;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (min-width: 600px) {
  .screen__inner {
    padding: 26px 26px 30px;
    border-radius: 26px;
  }
  
  .rosco-letter {
    position: absolute;
    width: 58px;
    height: 58px;}

  .rosco {
    width: 350px;
    height: 350px;
  }
}



/* Quitar subrayados / decoraciones raras en Safari */
.mode-label,
.round-label,
.target-letter,
.timer-digit,
.timer-separator,
.rosco-letter {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  text-decoration-skip-ink: none;
}

body, p, span, div, button {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
}










/* 1) Mata subrayados en TODA la app */
*,
*::before,
*::after {
  text-decoration: none !important;
}

/* 2) Enlaces: nunca subrayados, ni al hover, ni al tap, ni visitados */
a, a:visited, a:hover, a:active, a:focus {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
}

/* 3) iOS/Safari: quita estilos “automáticos” de links/telefonos */
a, button, input, textarea, select {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
}

a {
  -webkit-text-fill-color: currentColor !important; /* evita el azul raro en iOS */
}

/* 4) iOS: evita el “auto-link” azul (tel/email/direcciones) */
a[x-apple-data-detectors],
a[x-apple-data-detectors]:hover,
a[x-apple-data-detectors]:active,
a[x-apple-data-detectors]:visited {
  color: inherit !important;
  text-decoration: none !important;
  font: inherit !important;
}






/* =========================
   ZOOM SUAVE AL MOSTRAR PUBLICIDAD
   (pégalo al FINAL del CSS)
   ========================= */

/* Animación más realista (lenta + suave) */
@keyframes adZoomInSmooth {
  from {
    transform: scale(0.80);
    opacity: 0.0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Aplicamos el efecto al contenedor del banner cuando aparece la pantalla */
.screen--active#screen-ad .ad-box {
  /* “más lento” y con easing suave */
  animation: adZoomInSmooth 6000ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Asegura que el hover no rompa la animación (tu hover sigue funcionando) */
.screen--active#screen-ad .ad-box img {
  transform: scale(1.02);
}




















/* =========================
   BOTÓN MÚSICA (PLAY/STOP)
   ========================= */
.btn--music {
  margin-top: 10px;
}
.btn--music.is-off {
  opacity: 0.92;
  filter: grayscale(0.25);
}














/* --- Menú: botón de música opcional --- */
.btn--music {
  margin-top: 10px;
}

.btn--home {
  margin-top: 10px;
}

/* --- Pantalla juego: 4 botones en grid (2x2) para que no queden enanos --- */
.game-buttons {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15%;
}

.game-buttons .btn {
  width: 100%;
  padding: 10px 8px;
  font-size: 0.85rem;
  border-radius: 3px;
  white-space: nowrap;
}










/* Botón reset récords (menú) */
#btn-reset-records{
  margin-top: 10px;
  border-style: solid;
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

#btn-reset-records:hover{
  border-color: rgba(239, 68, 68, 0.55);
}
























/* Overlay cuenta atrás centrado en el rosco */
#rosco {
  position: relative; /* por si acaso */
}

#rosco-countdown-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 72%;
  height: 72%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: 3.2rem;
  letter-spacing: -0.04em;
  color: #0b1220;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* aparición suave */
#rosco-countdown-overlay.rcd-show {
  animation: rcdFadeIn 220ms ease-out both;
}

@keyframes rcdFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* “pop” por cada número */
#rosco-countdown-overlay.rcd-pop {
  animation: rcdPop 220ms cubic-bezier(.2,.9,.25,1.2) both;
}

@keyframes rcdPop {
  0%   { transform: translate(-50%, -50%) scale(0.88); filter: blur(0.2px); }
  100% { transform: translate(-50%, -50%) scale(1.00); filter: blur(0); }
}

/* GO! más impactante */
#rosco-countdown-overlay.rcd-go {
  color: #0b3b1f;
}