/* Sorteo 106 · Mis números — mobile first */
.tbx-page,
.tbx-embed {
  --tbx-bg: #0b0b0b;
  --tbx-panel: #141414;
  --tbx-panel-2: #1b1b1b;
  --tbx-line: #2b2b2b;
  --tbx-line-2: #3a3a3a;
  --tbx-text: #f2f2f2;
  --tbx-soft: #b9b9b9;
  --tbx-mute: #8c8c8c;
  --tbx-orange: #ff5d05;
  --tbx-orange-2: #ff7a2e;
  --tbx-err: #ffb08a;
  --tbx-radius: 12px;
  --tbx-display: rigid-square, "Montserrat", system-ui, sans-serif;
  --tbx-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.tbx-page *,
.tbx-page *::before,
.tbx-page *::after,
.tbx-embed *,
.tbx-embed *::before,
.tbx-embed *::after { box-sizing: border-box; }

html:has(> .tbx-page) { background: #0b0b0b; }

.tbx-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--tbx-bg);
  color: var(--tbx-text);
  font-family: var(--tbx-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* Fondo: brillo naranja y grano suave, fijo detrás de todo */
.tbx-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 100% 0%, rgba(255, 93, 5, .22), transparent 60%),
    radial-gradient(50vmax 40vmax at 0% 100%, rgba(255, 93, 5, .10), transparent 65%),
    linear-gradient(180deg, #0f0f0f 0%, #0b0b0b 60%, #080808 100%);
}
.tbx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.tbx-top,
.tbx-main,
.tbx-foot { position: relative; z-index: 1; }

/* Encabezado */
.tbx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
}
.tbx-logo { display: inline-flex; line-height: 0; }
.tbx-logo img { display: block; width: auto; height: 34px; }
.tbx-back {
  color: var(--tbx-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 2px;
}
.tbx-back:hover { color: var(--tbx-text); }

/* Contenido */
.tbx-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 20px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.tbx-kicker {
  margin: 0 0 8px;
  color: var(--tbx-orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tbx-title {
  margin: 0;
  font-family: var(--tbx-display);
  font-weight: 700;
  font-size: clamp(34px, 10vw, 44px);
  line-height: 1.02;
  letter-spacing: -.01em;
}
.tbx-title span { color: var(--tbx-orange); }
.tbx-lead {
  margin: 12px 0 0;
  color: var(--tbx-soft);
  font-size: 15px;
}
.tbx-facts { display: none; }

/* Tarjeta */
.tbx-card {
  background: rgba(20, 20, 20, .9);
  border: 1px solid var(--tbx-line);
  border-radius: 18px;
  padding: 22px 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tbx-card { background: rgba(20, 20, 20, .78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}

.tbx-form { display: grid; gap: 16px; margin: 0; }
.tbx-field { display: grid; gap: 7px; }
.tbx-field label {
  color: var(--tbx-text);
  font-size: 14px;
  font-weight: 600;
}
.tbx-field input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--tbx-line-2);
  border-radius: var(--tbx-radius);
  background: #0e0e0e;
  color: var(--tbx-text);
  font: 500 16px/1.2 var(--tbx-body);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.tbx-field input::placeholder { color: #666; }
.tbx-field input:hover { border-color: #4a4a4a; }
.tbx-field input:focus {
  outline: none;
  border-color: var(--tbx-orange);
  box-shadow: 0 0 0 3px rgba(255, 93, 5, .25);
}
.tbx-field input[aria-invalid="true"] { border-color: var(--tbx-err); }
.tbx-help { margin: 0; color: var(--tbx-mute); font-size: 13px; }
.tbx-err { margin: 0; color: var(--tbx-err); font-size: 13px; font-weight: 600; }

/* Campo trampa: fuera de la vista y del lector de pantalla */
.tbx-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Botones */
.tbx-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 4px 0 0;
  padding: 0 18px;
  border: 0;
  border-radius: var(--tbx-radius);
  background: var(--tbx-orange);
  color: #fff;
  font: 700 16px/1 var(--tbx-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, transform .1s;
}
.tbx-btn:hover { background: var(--tbx-orange-2); }
.tbx-btn:active { transform: translateY(1px); }
.tbx-btn:focus-visible,
.tbx-link:focus-visible,
.tbx-back:focus-visible,
.tbx-logo:focus-visible,
.tbx-foot a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 6px; }
.tbx-btn[disabled] { cursor: progress; opacity: .85; }
.tbx-btn--ghost {
  background: transparent;
  border: 1px solid var(--tbx-line-2);
  color: var(--tbx-text);
}
.tbx-btn--ghost:hover { background: rgba(255, 255, 255, .05); border-color: #555; }

.tbx-spin {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tbx-gira .7s linear infinite;
}
.tbx-btn.is-loading .tbx-spin { display: inline-block; }
@keyframes tbx-gira { to { transform: rotate(360deg); } }

.tbx-link {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--tbx-soft);
  font: 600 14px/1.2 var(--tbx-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tbx-link:hover { color: var(--tbx-text); }

/* Mensaje de error o aviso */
.tbx-msg {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--tbx-orange);
  border-radius: 8px;
  background: rgba(255, 93, 5, .08);
  color: #ffd2bb;
  font-size: 14px;
}

/* Resultado */
.tbx-res__title {
  margin: 0;
  font-family: var(--tbx-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}
.tbx-res__title:focus { outline: none; }
.tbx-nums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  max-height: 46svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tbx-nums li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #3a2a20;
  border-radius: 10px;
  background: linear-gradient(180deg, #1f1712, #171310);
  color: #fff;
  font: 700 22px/1 var(--tbx-display);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.tbx-nums.is-rangos { grid-template-columns: 1fr; }
.tbx-nums.is-rangos li { font-size: 18px; }
.tbx-count { margin: 16px 0 0; color: var(--tbx-soft); font-size: 15px; }
.tbx-count strong { color: var(--tbx-text); }
.tbx-orders { margin: 4px 0 18px; color: var(--tbx-mute); font-size: 13px; }

/* Pie */
.tbx-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .06);
  color: var(--tbx-mute);
  font-size: 12px;
}
.tbx-foot a { color: var(--tbx-soft); text-decoration: none; padding: 6px 0; }
.tbx-foot a:hover { color: var(--tbx-text); }

[hidden] { display: none !important; }

/* Celulares bajos: menos aire */
@media (max-height: 680px) and (max-width: 899px) {
  .tbx-top { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .tbx-logo img { height: 30px; }
  .tbx-main { gap: 16px; padding-top: 0; padding-bottom: 20px; }
  .tbx-card { padding-top: 18px; padding-bottom: 16px; }
  .tbx-form { gap: 14px; }
  .tbx-lead { margin-top: 8px; font-size: 14px; }
  .tbx-title { font-size: 32px; }
}

/* Tablet */
@media (min-width: 600px) {
  .tbx-top { padding-left: 32px; padding-right: 32px; }
  .tbx-foot { padding-left: 32px; padding-right: 32px; }
  .tbx-card { padding: 28px 26px 24px; }
}

/* Escritorio: dos columnas centradas en el alto de la pantalla */
@media (min-width: 900px) {
  .tbx-top,
  .tbx-foot { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; }
  .tbx-top { padding: 22px 48px; }
  .tbx-logo img { height: 40px; }
  .tbx-main {
    max-width: 1120px;
    padding: 24px 48px 48px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 440px);
    align-items: center;
    align-content: center;
    gap: 72px;
  }
  .tbx-title { font-size: clamp(48px, 5vw, 68px); }
  .tbx-lead { max-width: 30em; margin-top: 18px; font-size: 17px; }
  .tbx-facts {
    display: grid;
    gap: 12px;
    max-width: 30em;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    color: var(--tbx-soft);
    font-size: 14px;
  }
  .tbx-facts li { position: relative; padding-left: 22px; }
  .tbx-facts li::before {
    content: "";
    position: absolute;
    left: 0; top: .55em;
    width: 10px; height: 10px;
    border: 2px solid var(--tbx-orange);
    border-radius: 2px;
  }
  .tbx-card { padding: 32px 30px 28px; }
  .tbx-foot { padding: 18px 48px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tbx-spin { animation-duration: 2s; }
  .tbx-btn, .tbx-field input { transition: none; }
}

/* Dentro de otra página (shortcode) */
.tbx-embed { max-width: 480px; margin: 0 auto; color: var(--tbx-text); font-family: var(--tbx-body); }
