/* DD Sport — Veedores (mobile first). Todo bajo .ddv para no chocar con el tema. */
.ddv {
	--ink: #0e1726;
	--muted: #5a6577;
	--line: #d7dde6;
	--paper: #ffffff;
	--bg: #eef1f5;
	--brand: #1b4f8f;
	--brand-ink: #ffffff;
	--live: #0e8a4b;
	--yellow: #f5c400;
	--red: #d62828;
	--radius: 10px;
	max-width: 560px;
	margin: 0 auto;
	color: var(--ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	-webkit-tap-highlight-color: transparent;
}
.ddv *, .ddv *::before, .ddv *::after { box-sizing: border-box; }
:where(.ddv) button { font: inherit; color: inherit; cursor: pointer; }
.ddv button:focus-visible, .ddv select:focus-visible, .ddv a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.ddv svg { display: block; }

.ddv .ddv-empty { padding: 20px 16px; background: var(--bg); border-radius: var(--radius); color: var(--muted); }
.ddv .ddv--plain form { margin-top: 12px; }

/* Barra superior */
.ddv .ddv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-bottom: 8px; }
.ddv .ddv-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 4px; border: 0; background: none; color: var(--brand); font-weight: 600; }
.ddv .ddv-back svg { width: 20px; height: 20px; }
.ddv .ddv-title { margin: 4px 0 16px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.ddv .ddv-sub { margin: -10px 0 16px; color: var(--muted); font-size: 14px; }
.ddv .ddv-save { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ddv .ddv-save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ddv .ddv-save.is-saved::before { background: var(--live); }
.ddv .ddv-save.is-saving::before { background: var(--yellow); }
.ddv .ddv-save.is-error { color: var(--red); }
.ddv .ddv-save.is-error::before { background: var(--red); }

/* Categorías */
.ddv .ddv-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ddv .ddv-cat {
	width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px;
	padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--paper); text-align: left;
}
.ddv .ddv-cat[data-depth="1"] { margin-left: 20px; width: calc(100% - 20px); }
.ddv .ddv-cat[data-depth="2"] { margin-left: 40px; width: calc(100% - 40px); }
.ddv .ddv-cat__name { flex: 1; font-weight: 700; font-size: 17px; }
.ddv .ddv-cat[data-depth="1"] .ddv-cat__name, .ddv .ddv-cat[data-depth="2"] .ddv-cat__name { font-weight: 600; }
.ddv .ddv-cat__count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.ddv .ddv-cat:active { background: var(--bg); }

.ddv .ddv-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ddv .ddv-pill--live { background: var(--live); color: #fff; }
.ddv .ddv-pill--done { background: var(--ink); color: #fff; }

/* Partidos */
.ddv .ddv-day { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ddv .ddv-day:first-child { margin-top: 0; }
.ddv .ddv-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ddv .ddv-event {
	display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
	padding: 12px 12px 12px 16px; background: var(--paper);
	border: 1px solid var(--line); border-radius: var(--radius);
}
.ddv .ddv-event.is-live { border-color: var(--live); box-shadow: inset 4px 0 0 var(--live); }
.ddv .ddv-event__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.ddv .ddv-event__meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.ddv .ddv-event__teams { min-width: 0; font-weight: 700; font-size: 16px; }
.ddv .ddv-event__teams span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddv .ddv-event__teams span + span { font-weight: 600; }

.ddv .ddv-btn {
	min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px;
	background: var(--brand); color: var(--brand-ink); font-weight: 700; white-space: nowrap;
}
.ddv .ddv-btn:disabled { opacity: .5; cursor: default; }
.ddv .ddv-btn--live { background: var(--live); }
.ddv .ddv-btn--ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.ddv .ddv-btn--block { width: 100%; min-height: 52px; font-size: 17px; }
.ddv .ddv-btn--finish { background: var(--ink); }

/* Marcador fijo */
.ddv .ddv-board {
	position: sticky; top: 0; z-index: 5;
	margin: 0 -4px 12px; padding: 6px 12px;
	background: var(--ink); color: #fff; border-radius: var(--radius);
	box-shadow: 0 6px 16px -10px rgba(14, 23, 38, .7);
}
.admin-bar .ddv-board { top: 46px; }
@media (min-width: 783px) { .admin-bar .ddv-board { top: 32px; } }
.ddv .ddv-board__row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.ddv .ddv-board__row + .ddv-board__row { border-top: 1px solid rgba(255, 255, 255, .15); }
.ddv .ddv-board__name { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddv .ddv-board__score { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; line-height: 1; }
.ddv .ddv-board__score.is-bump { animation: ddv-bump .35s ease-out; }
@keyframes ddv-bump { 0% { transform: scale(1); color: var(--yellow); } 40% { transform: scale(1.35); color: var(--yellow); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ddv-board__score.is-bump { animation: none; } }
.ddv .ddv-board__meta { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0 2px; font-size: 12px; color: rgba(255, 255, 255, .7); }

/* Bloque de equipo */
.ddv .ddv-team { margin-bottom: 16px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.ddv .ddv-team__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ddv .ddv-team__logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg); flex: none; }
.ddv .ddv-team__name { flex: 1; margin: 0; font-size: 19px; font-weight: 800; }
.ddv .ddv-team__score { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ddv .ddv-team__side { font-size: 12px; font-weight: 600; color: var(--muted); }

.ddv .ddv-add { display: flex; gap: 8px; }
.ddv .ddv-add select {
	flex: 1; min-width: 0; min-height: 44px; padding: 0 10px;
	border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 16px;
}
.ddv .ddv-add .ddv-btn { padding: 0 14px; }
.ddv .ddv-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Renglón de jugador */
.ddv .ddv-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.ddv .ddv-row { padding: 10px 0; border-top: 1px solid var(--line); }
.ddv .ddv-row__top { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.ddv .ddv-row__name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddv .ddv-row__controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }

.ddv .ddv-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; border-radius: 8px; }
.ddv .ddv-icon:active { background: var(--bg); }

.ddv .ddv-card svg rect { transition: fill .15s; }
.ddv .ddv-card[data-card="none"] rect { fill: #fff; stroke: #8a94a6; }
.ddv .ddv-card[data-card="yellow"] rect { fill: var(--yellow); stroke: #b38f00; }
.ddv .ddv-card[data-card="red"] rect { fill: var(--red); stroke: #8f1515; }

.ddv .ddv-remove { color: var(--red); width: 40px; height: 40px; }

.ddv .ddv-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.ddv .ddv-step button { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; font-weight: 700; line-height: 1; border-radius: 50%; }
.ddv .ddv-step button:active { background: var(--line); }
.ddv .ddv-step button:disabled { opacity: .3; }
.ddv .ddv-step__val { display: inline-flex; align-items: center; gap: 4px; min-width: 52px; justify-content: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.ddv .ddv-step__val svg { width: 22px; height: 22px; }
.ddv .ddv-step--own .ddv-step__val { color: var(--red); }

.ddv .ddv-footer { margin: 8px 0 32px; }
.ddv .ddv-footer p { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }

.ddv-toast {
	position: fixed; left: 50%; bottom: 16px; z-index: 99999; transform: translateX(-50%);
	width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 8px;
	background: #0e1726; color: #fff; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.ddv-toast.is-error { background: #d62828; }
.ddv-toast[hidden] { display: none; }
.ddv .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ddv .ddv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.ddv .ddv-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ddv .ddv-legend svg { width: 16px; height: 16px; }
