/*
 * whl.css — estilos MÍNIMOS del motor de loterías, para que las bolas, las
 * tarjetas y el tablero se vean bien con CUALQUIER tema. El tema White Hat
 * Lotto añade su diseño encima (tipografía, sombras, espaciados); aquí solo
 * lo estructural y lo accesible.
 *
 * Variables:
 *   --whl-c   color de la lotería (lo pone cada tarjeta/sección en su style="")
 *   --whl-ink color del texto sobre ese color
 * Modo oscuro: respeta prefers-color-scheme y el atributo data-theme="dark".
 */

:root {
	--whl-bg: #ffffff;
	--whl-fg: #0f172a;
	--whl-muted: #64748b;
	--whl-line: #e2e8f0;
	--whl-card: #ffffff;
	--whl-ball-bg: #f1f5f9;
	--whl-ball-fg: #0f172a;
	--whl-ok: #15803d;
	--whl-warn: #b45309;
	--whl-bad: #b91c1c;
	--whl-radius: 14px;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--whl-bg: #0b1220; --whl-fg: #e5e7eb; --whl-muted: #94a3b8; --whl-line: #1f2a3d;
		--whl-card: #111a2c; --whl-ball-bg: #1e293b; --whl-ball-fg: #f8fafc;
	}
}
:root[data-theme="dark"] {
	--whl-bg: #0b1220; --whl-fg: #e5e7eb; --whl-muted: #94a3b8; --whl-line: #1f2a3d;
	--whl-card: #111a2c; --whl-ball-bg: #1e293b; --whl-ball-fg: #f8fafc;
}

/* ---------- Bolas ---------- */
.whl-balls { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: .5rem 0; padding: 0; }
.whl-ball {
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
	min-width: 2.75rem; min-height: 2.75rem; padding: .25rem .45rem; border-radius: 999px;
	background: var(--whl-ball-bg); color: var(--whl-ball-fg); font-weight: 700;
	font-size: clamp(1.05rem, 4.2vw, 1.35rem); line-height: 1; text-decoration: none;
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.whl-balls--quiniela .whl-ball:first-child,
.whl-balls--derived .whl-ball:first-child { background: var(--whl-c, #334155); color: #fff; }
.whl-ball--extra { background: var(--whl-c, #334155); color: #fff; outline: 2px dashed rgba(255,255,255,.6); outline-offset: -4px; }
.whl-ball__lab { font-size: .62rem; font-weight: 600; opacity: .85; margin-top: .15rem; letter-spacing: .02em; }
.whl-ball--mini { min-width: 2.1rem; min-height: 2.1rem; font-size: .95rem; }
.whl-ball--big { min-width: 4.5rem; min-height: 4.5rem; font-size: 2rem; background: var(--whl-c, #334155); color: #fff; }
.whl-balls--ticket .whl-ball { border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.whl-balls--kino .whl-ball, .whl-balls--loto .whl-ball { min-width: 2.4rem; min-height: 2.4rem; font-size: 1rem; }

/* ---------- Tarjeta de sorteo ---------- */
.whl-card {
	background: var(--whl-card); border: 1px solid var(--whl-line); border-left: 5px solid var(--whl-c, #334155);
	border-radius: var(--whl-radius); padding: .85rem 1rem; margin: 0 0 .75rem; color: var(--whl-fg);
}
.whl-card__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; }
.whl-card__lottery { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--whl-c, #334155); text-decoration: none; }
.whl-card__title { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.whl-card__title a { color: inherit; text-decoration: none; }
.whl-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-left: auto; font-size: .8rem; color: var(--whl-muted); }
.whl-card__label { font-weight: 700; color: var(--whl-fg); }
.whl-card__pending { margin: .5rem 0; color: var(--whl-muted); font-size: .9rem; }
.whl-card__jackpot { margin: .25rem 0 0; font-size: .85rem; font-weight: 600; }
.whl-card__foot { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; font-size: .78rem; color: var(--whl-muted); margin-top: .35rem; }
.whl-card__src { color: inherit; }
.whl-card__unofficial { border: 1px solid var(--whl-line); border-radius: 6px; padding: 0 .35rem; }
.whl-card__last { margin: .35rem 0 .1rem; padding-top: .35rem; border-top: 1px dashed var(--whl-line); }
.whl-card__last-lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--whl-muted); }
.whl-card__last .whl-balls { margin: .25rem 0 0; }
.whl-card__last .whl-ball { min-width: 2.2rem; min-height: 2.2rem; font-size: .95rem; opacity: .9; }
.whl-card--compact { padding: .55rem .8rem; }
.whl-card--compact .whl-ball { min-width: 2.3rem; min-height: 2.3rem; font-size: 1rem; }
.whl-card--empty { opacity: .8; }
.whl-share, .whl-fav, .whl-bell {
	background: transparent; border: 1px solid var(--whl-line); border-radius: 8px; color: var(--whl-fg);
	padding: .15rem .5rem; font: inherit; font-size: .78rem; cursor: pointer; min-height: 32px;
}
.whl-fav[aria-pressed="true"] { background: #fbbf24; border-color: #f59e0b; color: #111; }
.whl-bell[aria-pressed="true"] { background: var(--whl-c, #334155); color: #fff; }

/* ---------- Estado ---------- */
.whl-status { border-radius: 6px; padding: .05rem .45rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--whl-ball-bg); }
.whl-status--confirmed { color: #fff; background: var(--whl-ok); }
.whl-status--provisional { color: #fff; background: var(--whl-warn); }
.whl-status--corrected { color: #fff; background: #7c3aed; }
.whl-status--delayed { color: #fff; background: var(--whl-bad); }
.whl-status--pending { color: var(--whl-muted); }

/* ---------- Tablero ---------- */
.whl-board { color: var(--whl-fg); }
.whl-board__bar {
	position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
	background: var(--whl-bg); border-bottom: 1px solid var(--whl-line); padding: .5rem 0; font-size: .9rem;
}
.whl-board__date { font-weight: 700; text-transform: capitalize; }
.whl-board__updated { color: var(--whl-muted); }
.whl-board__favs { margin-left: auto; }
.whl-board__favs[aria-pressed="true"] { background: #fbbf24; border-color: #f59e0b; color: #111; }
.whl-legend { font-size: .82rem; color: var(--whl-muted); margin: .25rem 0 .5rem; }
.whl-legend summary { cursor: pointer; }
.whl-legend ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.whl-chips { display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 0; scrollbar-width: thin; }
.whl-chip { flex: 0 0 auto; border-radius: 999px; padding: .3rem .75rem; background: var(--whl-c, #334155); color: #fff; text-decoration: none; font-size: .8rem; font-weight: 700; }
.whl-lottery { margin: 1rem 0 1.25rem; scroll-margin-top: 4rem; }
.whl-lottery__head {
	display: flex; align-items: center; gap: .75rem; margin: 0 0 .5rem; padding: .45rem .85rem;
	background: var(--whl-c, #334155); color: var(--whl-ink, #fff); border-radius: 10px; font-size: 1.05rem;
}
.whl-lottery__head a { color: inherit; text-decoration: none; }
.whl-lottery__toggle { margin-left: auto; background: rgba(255,255,255,.18); color: inherit; border: 0; border-radius: 8px; padding: .25rem .6rem; font: inherit; font-size: .75rem; cursor: pointer; }
.whl-lottery__body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: .5rem .75rem; }
.whl-lottery__body > .whl-card { margin: 0; }
.whl-last-known { grid-column: 1 / -1; }
.whl-last-known__lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--whl-muted); }
.whl-board[data-only-favs="1"] .whl-lottery:not([data-has-fav="1"]) { display: none; }
.whl-board[data-only-favs="1"] .whl-card:not(.whl-card--fav) { display: none; }

/* ---------- Juego, historial, fecha ---------- */
.whl-game__next { font-weight: 600; }
.whl-history__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .4rem 0; border-bottom: 1px solid var(--whl-line); }
.whl-history__date { min-width: 9rem; color: var(--whl-fg); text-decoration: none; font-weight: 600; }
.whl-daynav { display: flex; justify-content: space-between; margin: 1rem 0; }
.whl-corrections { margin: .5rem 0 1rem; font-size: .9rem; }
.whl-empty, .whl-muted { color: var(--whl-muted); }

/* ---------- Feed, próximos, horarios, tablas ---------- */
.whl-upcoming { list-style: none; margin: 0; padding: 0; }
.whl-upcoming__item { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--whl-line); border-left: 4px solid var(--whl-c, #334155); padding-left: .6rem; }
.whl-upcoming__item a { color: inherit; text-decoration: none; font-weight: 600; }
.whl-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.whl-table th, .whl-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--whl-line); text-align: left; vertical-align: top; }
.whl-table__time { white-space: nowrap; font-weight: 700; width: 6.5rem; }
.whl-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--whl-c, #334155); margin-right: .4rem; vertical-align: middle; }
.whl-schedule__day { border: 1px solid var(--whl-line); border-radius: 10px; padding: .4rem .8rem; margin: .5rem 0; }
.whl-schedule__day summary { cursor: pointer; font-weight: 700; }
.whl-schedule__note { font-size: .9rem; color: var(--whl-muted); }

/* ---------- Estadísticas ---------- */
.whl-stats__note { font-size: .9rem; color: var(--whl-muted); }
.whl-stats__windows { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.whl-stats__windows a { border: 1px solid var(--whl-line); border-radius: 999px; padding: .25rem .8rem; text-decoration: none; color: inherit; font-size: .85rem; }
.whl-stats__windows a[aria-current="true"] { background: var(--whl-fg); color: var(--whl-bg); }
.whl-stats__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.whl-stats__col h3 { font-size: 1rem; margin: 0 0 .5rem; }
.whl-stats__col ol { list-style: none; margin: 0; padding: 0; }
.whl-stats__col li { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.whl-stats__v { color: var(--whl-muted); font-size: .85rem; }
.whl-pair { font-weight: 700; }
.whl-number__big { text-align: center; }

/* ---------- Buscador de número ---------- */
.whl-numsearch { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.whl-numsearch input { width: 5.5rem; font-size: 1.4rem; text-align: center; padding: .3rem; border: 1px solid var(--whl-line); border-radius: 8px; background: var(--whl-card); color: var(--whl-fg); }
.whl-numsearch button { padding: .5rem 1rem; border-radius: 8px; border: 0; background: var(--whl-fg); color: var(--whl-bg); font: inherit; cursor: pointer; }

/* ---------- Legal ---------- */
.whl-legal { font-size: .8rem; color: var(--whl-muted); line-height: 1.5; }

/* ---------- Accesibilidad ---------- */
.whl-fav:focus-visible, .whl-share:focus-visible, .whl-bell:focus-visible, .whl-chip:focus-visible, .whl-lottery__toggle:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .whl-board * { transition: none !important; } }
