/* ============================= */
/* RESET + BASE                  */
/* ============================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #e5e7eb;
}

/* ============================= */
/* SCREEN FULLSCREEN NATIVO      */
/* ============================= */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding:
    env(safe-area-inset-top, 24px)
    20px
    env(safe-area-inset-bottom, 24px);
}

.screen.active {
  display: block;
}

/* ============================= */
/* CONTENIDO INTERNO             */
/* ============================= */

.screen-content {
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================= */
/* TEXTOS                        */
/* ============================= */

h1, h2 {
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  opacity: 0.7;
  margin-bottom: 20px;
}

.hint {
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  margin-top: 10px;
}

.legal {
  margin-top: auto;
  text-align: center;
  font-size: 11px;
  opacity: 0.5;
  padding-top: 20px;
}

/* ============================= */
/* LOGIN DIVIDER                 */
/* ============================= */

.divider {
  position: relative;
  text-align: center;
  margin: 20px 0 10px;
  opacity: 0.7;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: #334155;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider span {
  background: #0f172a; /* mismo color que body */
  padding: 0 12px;
  position: relative;
  z-index: 1;
}

/* ============================= */
/* GOOGLE SIGNIN CENTER FIX      */
/* ============================= */

#google-signin-btn {
  margin-top: 20px;
  text-align: center;
}

#google-signin-btn > div {
  display: inline-block !important;
}

/* ============================= */
/* CARD PRINCIPAL                */
/* ============================= */

.card {
  background: #020617;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #334155;
}

/* ============================= */
/* NÚMEROS (BOLAS)               */
/* ============================= */

.numeros {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.bola {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

/* ============================= */
/* BOTONES                       */
/* ============================= */

button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #2563eb;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

/* Separación SOLO en pantalla de activación */
#buy-screen .screen-content button + button {
  margin-top: 16px;
}

button:active {
  background: #1d4ed8;
}

.secondary-btn {
  margin-top: 16px;
  padding: 14px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #3b82f6;
  background-color: transparent;
  color: #3b82f6;
  font-weight: 600;
  font-size: 16px;
}

.primary-btn {
  background: #D4AF37;
  color: #111827;
  font-weight: 600;
  transition: 0.2s ease;
}

.primary-btn:hover {
  background: #e6c65c;
}

/* ============================= */
/* GENERAR BOTONES               */
/* ============================= */

.generar-botones {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  justify-content: space-between;
}

.btn-juego {
  flex: 1;
  padding: 10px 6px;        /* un poco más compacto */
  font-size: 14px;          /* reduce ligeramente */
  text-align: center;
  white-space: nowrap;
}

/* ============================= */
/* RESULTADO / BLOQUE DEMO       */
/* ============================= */

.result {
  margin-top: 20px;
  padding: 16px;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #334155;
}

.flag {
  text-align: center;
  font-weight: bold;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.flag.yellow { background: #ca8a04; }
.flag.green  { background: #16a34a; }
.flag.red    { background: #2563eb; }

.hidden {
  display: none;
}

/* ============================= */
/* SELECT PLAN                   */
/* ============================= */

select {
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  background: #020617;
  color: #e5e7eb;
}

/* ============================= */
/* QR + PAGO                     */
/* ============================= */

.qr-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.qr-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
}

.payment-id-box {
  background: #020617;
  border: 1px dashed #3b82f6;
  padding: 12px;
  border-radius: 10px;
}

/* ============================= */
/* FIX BOTÓN INFERIOR iOS        */
/* ============================= */

#payment-info-screen .screen-content {
  justify-content: flex-start;
}

#paid-btn {
  margin-top: 24px;
  margin-bottom: calc(24px + env(safe-area-inset-bottom));
}