:root {
  --bg0: #e8ecf7;
  --bg1: #ffffff;
  --bg2: #f0f3fb;
  --line: rgba(26, 29, 38, 0.09);
  --text: #141824;
  --muted: #5a6478;
  --accent: #4f63d8;
  --accent-soft: rgba(79, 99, 216, 0.14);
  --accent2: #0d9b8c;
  --warn: #d97706;
  --danger: #dc2626;
  --card: #ffffff;
  --shadow: 0 20px 50px rgba(32, 48, 102, 0.09), 0 4px 16px rgba(32, 48, 102, 0.04);
  --shadow-hover: 0 28px 64px rgba(32, 48, 102, 0.12), 0 8px 24px rgba(32, 48, 102, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --header-bg: rgba(255, 255, 255, 0.78);
  --header-border: rgba(79, 99, 216, 0.12);
  --noise-opacity: 0.28;
  --noise-blend: multiply;
  --mesh-1: rgba(99, 120, 230, 0.14);
  --mesh-2: rgba(20, 160, 140, 0.1);
  --mesh-3: rgba(255, 190, 120, 0.06);
}

[data-theme="dark"] {
  --bg0: #0a0c12;
  --bg1: #141824;
  --bg2: #1c2230;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9ecf4;
  --muted: #8b95a8;
  --accent: #8b9cff;
  --accent-soft: rgba(139, 156, 255, 0.12);
  --accent2: #3dd4c3;
  --card: #161c28;
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 32px 72px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(20, 24, 34, 0.82);
  --header-border: rgba(139, 156, 255, 0.12);
  --noise-opacity: 0.14;
  --noise-blend: soft-light;
  --mesh-1: rgba(99, 120, 230, 0.12);
  --mesh-2: rgba(20, 200, 170, 0.08);
  --mesh-3: rgba(200, 160, 255, 0.05);
}

.muted {
  color: var(--muted);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(ellipse 1000px 560px at 8% -12%, var(--mesh-1), transparent 58%),
    radial-gradient(ellipse 880px 480px at 102% 8%, var(--mesh-2), transparent 52%),
    radial-gradient(ellipse 600px 400px at 50% 100%, var(--mesh-3), transparent 45%),
    linear-gradient(165deg, var(--bg0) 0%, var(--bg2) 48%, var(--bg0) 100%);
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  transition: background 0.35s ease, color 0.25s ease;
}

.bg-clovers {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  /* 100svh = altura do viewport “pequeno” (barra de URL visível) — não muda ao mostrar/ocultar a barra no mobile,
     evitando que top:% dos trevos seja recalculado e “teleporte”. Fallback: 100vh. */
  height: 100vh;
  height: 100svh;
  z-index: 0;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.clover-float {
  position: absolute;
  left: var(--x, 10%);
  top: var(--y, 10%);
  /* Proporção ~reta do SVG da Wikimedia (trevo alto) */
  width: calc(52px * var(--s, 1));
  height: calc(72px * var(--s, 1));
  opacity: var(--o, 0.28);
  will-change: transform;
  animation: clover-drift var(--dur, 55s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.bg-clovers .clover-float .clover-bg-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.5))
    drop-shadow(0 2px 6px rgba(0, 60, 35, 0.35));
}

[data-theme="dark"] .bg-clovers .clover-float .clover-bg-img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3)) drop-shadow(0 0 3px rgba(34, 197, 94, 0.4))
    drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
}

[data-theme="dark"] .clover-float {
  opacity: var(--o, 0.22);
}

/* Só px na animação — vw/vh mudam com a barra do browser e causam saltos no telemóvel */
@keyframes clover-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  20% {
    transform: translate3d(12px, -22px, 0) rotate(14deg);
  }
  40% {
    transform: translate3d(-10px, 18px, 0) rotate(-11deg);
  }
  60% {
    transform: translate3d(15px, 14px, 0) rotate(9deg);
  }
  80% {
    transform: translate3d(-11px, -16px, 0) rotate(-7deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clover-float {
    animation: none;
    opacity: 0.14;
  }

  [data-theme="dark"] .clover-float {
    opacity: 0.12;
  }
}

.bg-noise {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: var(--noise-blend);
  z-index: 0;
  transition: opacity 0.35s ease;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.5rem;
}

body.page-loader-active {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-backdrop {
  position: absolute;
  inset: 0;
  background: var(--card);
  opacity: 0.97;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .page-loader-backdrop {
  opacity: 0.98;
  background: var(--bg1);
}

.page-loader-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 22rem;
}

.page-loader-logo {
  display: block;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.page-loader-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.page-loader-text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.page-loader-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.page-loader-bar-fill {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: page-loader-indeterminate 1.1s ease-in-out infinite;
}

@keyframes page-loader-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader-bar-fill {
    animation: none;
    width: 100%;
    opacity: 0.5;
  }
}

.wrap {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 4px 24px rgba(32, 48, 102, 0.05);
  transition: background 0.35s ease, border-color 0.25s ease, box-shadow 0.35s ease;
}

[data-theme="dark"] .site-header {
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(32, 48, 102, 0.06);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent);
  border-color: rgba(79, 99, 216, 0.35);
  background: var(--accent-soft);
  outline: none;
  box-shadow: 0 4px 16px rgba(79, 99, 216, 0.12);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

/* Tema claro: mostra lua (ir para escuro). Tema escuro: mostra sol (ir para claro). */
.theme-toggle .theme-ico-sun {
  display: none;
}

.theme-toggle .theme-ico-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .theme-ico-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-ico-sun {
  display: block;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: var(--accent-soft);
  outline: none;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link:focus-visible {
  background: rgba(139, 156, 255, 0.12);
}

.main {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0 4rem;
}

/* Trevo de 4 folhas — cor por modalidade (identidade visual próxima às loterias Caixa) */
.lot-clover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--clover, #209869);
}

.lot-clover svg {
  display: block;
}

/* Modo escuro: contorno branco de 1px (só cardeais — sem diagonais para não espessar) */
[data-theme="dark"] .lot-clover svg {
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff);
}

.card-lot-clover {
  margin-top: 2px;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.card-lot-heading-row {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.panel-label .lot-clover svg {
  width: 22px;
  height: 22px;
}

.lottery-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.lottery-title-row .lot-clover svg {
  width: 40px;
  height: 40px;
}

.hero {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2.75rem;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
  color: var(--text);
}

/* Modo claro: contorno branco nítido no título e no texto (leitura sobre o fundo) */
[data-theme="light"] .hero-copy h1 {
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 -1px 0 #fff, 0 1px 0 #fff,
    -1px 0 0 #fff, 1px 0 0 #fff;
}

.hero-copy p {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

[data-theme="light"] .hero-copy p {
  text-shadow: -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff, 0.5px 0.5px 0 #fff, 0 -0.5px 0 #fff,
    0 0.5px 0 #fff, -0.5px 0 0 #fff, 0.5px 0 0 #fff;
}

.hero-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  min-height: 120px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.panel:hover {
  border-color: rgba(79, 99, 216, 0.22);
  box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .panel:hover {
  border-color: rgba(139, 156, 255, 0.2);
}

.panel-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.panel-body {
  min-height: 3rem;
}

.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg2), #e4e9f5, var(--bg2));
  background-size: 200% 100%;
  animation: sk 1.2s ease-in-out infinite;
}

.skeleton + .skeleton {
  margin-top: 0.5rem;
  width: 70%;
}

@keyframes sk {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-modalidades {
  width: 100%;
}

.home-modalidades > .section-title {
  text-align: center;
}

.grid-lotteries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.card-lot {
  text-align: left;
  flex: 0 1 260px;
  max-width: min(320px, 100%);
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 1.25rem 1.35rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.card-lot:hover,
.card-lot:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(79, 106, 216, 0.28);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.card-lot-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.card-lot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.02em;
  min-width: 0;
  flex: 1;
}

.card-lot-badge {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg2);
}

.card-lot-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.card-lot-meta {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.lottery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1.25rem 3rem;
  min-height: 12rem;
  color: var(--muted);
}

.lottery-loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.lottery-loading-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: lottery-loading-spin 0.75s linear infinite;
}

@keyframes lottery-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lottery-loading-spinner {
    animation: none;
    border-top-color: var(--line);
    opacity: 0.65;
  }
}

.lottery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  box-shadow: 0 4px 14px rgba(26, 41, 82, 0.04);
}

.btn-back:hover,
.btn-back:focus-visible {
  background: var(--bg2);
  border-color: rgba(79, 106, 216, 0.35);
  outline: none;
}

.btn-back svg {
  width: 20px;
  height: 20px;
}

.lottery-title-wrap {
  flex: 1;
  min-width: 200px;
}

.lottery-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0;
  letter-spacing: -0.03em;
}

.lottery-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search-row label {
  font-size: 0.85rem;
  color: var(--muted);
}

.input-num {
  width: 8rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font: inherit;
}

.input-num:focus {
  outline: 2px solid rgba(79, 106, 216, 0.35);
  border-color: transparent;
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 106, 216, 0.35);
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover,
.btn:focus-visible {
  background: rgba(79, 106, 216, 0.2);
  outline: none;
}

.result-block {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 1.5rem 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

.result-concurso {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}

.result-dates {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
}

.pill--sm {
  min-width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
}

.pill-group-title {
  width: 100%;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.5rem 0 0.25rem;
}

.pill-accent {
  border-color: rgba(13, 155, 140, 0.35);
  background: rgba(13, 155, 140, 0.1);
  color: var(--text);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.meta-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg2);
}

.meta-item dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.meta-item dd {
  margin: 0.35rem 0 0;
  font-weight: 600;
  font-size: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg1);
}

table.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.result-table th,
.result-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.result-table th {
  background: var(--bg2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-table tr:last-child td {
  border-bottom: none;
}

.result-table td.num {
  font-variant-numeric: tabular-nums;
}

.history {
  margin-top: 0.5rem;
}

.history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pager {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pager button {
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 41, 82, 0.04);
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg1);
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg1);
  cursor: pointer;
  transition: background 0.12s;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover,
.history-item:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.history-item strong {
  font-weight: 600;
}

.history-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: var(--bg1);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--warn);
  margin-bottom: 0.75rem;
}

.error-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  color: var(--text);
  margin-bottom: 1.5rem;
}

.error-banner svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--danger);
}

.toast-host {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, 100% - 2rem);
}

.toast {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-hover);
  font-size: 0.9rem;
  color: var(--text);
}

.toast--err {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.1);
}

@media (max-width: 640px) {
  .hero-panels {
    grid-template-columns: 1fr;
  }

  .lottery-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-row {
    width: 100%;
  }

  .input-num {
    flex: 1;
  }
}

/* Página estática Sobre */
.sobre-page {
  padding: 2rem 0 3.5rem;
  max-width: 52rem;
}

.sobre-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.sobre-h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.sobre-lead,
.sobre-p {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.65;
}

.sobre-lead {
  color: var(--muted);
}

.sobre-dl {
  margin: 1.25rem 0 0;
  padding: 0;
}

.sobre-dl dt {
  margin: 1.25rem 0 0.35rem;
  font-weight: 600;
}

.sobre-dl dt:first-child {
  margin-top: 0;
}

.sobre-dl dt a {
  color: var(--accent);
  text-decoration: none;
}

.sobre-dl dt a:hover {
  text-decoration: underline;
}

.sobre-dl dd {
  margin: 0;
  padding-left: 0;
  color: var(--muted);
  line-height: 1.6;
}

.sobre-foot {
  margin: 2.5rem 0 0;
}

.sobre-back {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sobre-back:hover {
  text-decoration: underline;
}
