:root {
  color-scheme: dark;
  --bg-app: #040a1a;
  --bg-panel: #0a1731;
  --bg-elevated: #122743;
  --bg-control: #060f23;
  --bg-control-hover: #102242;
  --border-soft: rgba(93, 126, 176, 0.3);
  --border-strong: rgba(48, 128, 255, 0.52);
  --text-main: #f3f7ff;
  --text-muted: #9caecc;
  --text-soft: #778cab;
  --accent-red: #e40014;
  --accent-red-hover: #ff2937;
  --accent-blue: #3080ff;
  --accent-green: #00c758;
  --danger: #ff5f6b;
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.32);
  --shadow-panel: 0 18px 34px rgba(0, 0, 0, 0.44);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background-color: var(--bg-app);
  background-image:
    radial-gradient(circle at 14% -12%, rgba(48, 128, 255, 0.2), transparent 46%),
    radial-gradient(circle at 90% -10%, rgba(228, 0, 20, 0.16), transparent 40%),
    radial-gradient(rgba(31, 53, 89, 0.54) 1px, transparent 1px),
    linear-gradient(180deg, #061126 0%, #040a1a 100%);
  background-size: auto, auto, 22px 22px, auto;
}

body {
  color: var(--text-main);
  font-family: "Inter", "Segoe UI", "Trebuchet MS", sans-serif;
  overflow-x: hidden;
}

::selection {
  background: rgba(48, 128, 255, 0.42);
  color: #fff;
}

a {
  color: inherit;
}

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.topbar {
  margin-bottom: 12px;
  background: linear-gradient(145deg, rgba(12, 27, 53, 0.92), rgba(7, 17, 33, 0.94));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 240px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-red) 0%, rgba(228, 0, 20, 0.05) 100%);
}

body.auth-pending .topbar,
body.auth-login .topbar {
  display: none;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(228, 0, 20, 0.45);
  background: linear-gradient(160deg, rgba(228, 0, 20, 0.3), rgba(228, 0, 20, 0.12));
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

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

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  margin: 0 0 2px;
  font-size: 0.72rem;
  color: var(--text-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.brand a {
  text-decoration: none;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.topbar-match-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(48, 128, 255, 0.55);
  background: rgba(48, 128, 255, 0.18);
  color: #d9e9ff;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 13px;
}

.topnav {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(78, 103, 146, 0.4);
  background: rgba(5, 14, 30, 0.66);
  color: var(--text-soft);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.topnav-link:hover {
  border-color: rgba(48, 128, 255, 0.6);
  color: #e6f0ff;
}

.topnav-link.is-active {
  border-color: rgba(228, 0, 20, 0.6);
  background: linear-gradient(160deg, rgba(228, 0, 20, 0.28), rgba(228, 0, 20, 0.12));
  color: #ffe1e4;
}

.topnav-link:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.8);
  outline-offset: 2px;
}

.auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.auth-user {
  max-width: min(260px, 44vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-card-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-card-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-branding-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-branding-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid rgba(78, 103, 146, 0.4);
  background: rgba(4, 12, 27, 0.66);
  padding: 6px;
  flex-shrink: 0;
}

.settings-notice {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  border-left: 3px solid rgba(48, 128, 255, 0.5);
  padding-left: 10px;
}

.settings-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-field-label {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.settings-select {
  background: rgba(4, 12, 27, 0.66);
  color: var(--text-soft);
  border: 1px solid rgba(78, 103, 146, 0.5);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 0.86rem;
}

.settings-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings-input {
  width: min(100%, 360px);
  background: rgba(4, 12, 27, 0.78);
  color: var(--text-main);
  border: 1px solid rgba(78, 103, 146, 0.5);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  font-size: 0.92rem;
}

.settings-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.72);
  outline-offset: 2px;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.settings-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(78, 103, 146, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(5, 14, 30, 0.5);
  padding: 10px 12px;
}

.settings-summary-label {
  color: var(--text-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-summary-value {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.settings-status {
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.settings-status.success {
  color: #b9f5cf;
}

.settings-status.error {
  color: #ffd5da;
}

.panel {
  background: linear-gradient(160deg, rgba(16, 37, 68, 0.96), rgba(8, 21, 41, 0.96));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 132px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red) 0%, rgba(228, 0, 20, 0) 100%);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 20px;
}

.view-header-copy {
  min-width: 0;
}

.view-eyebrow {
  margin: 0 0 2px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.72rem;
}

.heading {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: clamp(1.85rem, 2.8vw, 2.6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.view-subtitle {
  margin: 7px 0 0;
  max-width: 70ch;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(48, 128, 255, 0.55);
  background: rgba(48, 128, 255, 0.18);
  color: #d9e9ff;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
}

.compact-toolbar {
  padding: 10px 12px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-group {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(78, 103, 146, 0.33);
  background: rgba(4, 12, 27, 0.66);
}

.toolbar-section-title {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.toolbar-inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-group-primary,
.action-group-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-compact-toolbar {
  align-items: stretch;
}

.home-selection-group {
  flex: 1 1 320px;
}

.home-selection-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border: 1px solid rgba(78, 103, 146, 0.36);
  border-radius: 999px;
  background: rgba(5, 14, 30, 0.68);
}

.selected-counter {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.home-save-group {
  flex: 1 1 420px;
}

.save-cameras-controls {
  justify-content: space-between;
}

.save-cameras-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-toggle-list .video-toggle {
  padding: 6px 9px;
  font-size: 0.76rem;
}

.save-camera-toggle {
  border-color: rgba(228, 0, 20, 0.38);
}

.save-camera-toggle:hover {
  border-color: rgba(255, 95, 107, 0.72);
}

.save-cameras-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.save-cameras-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.save-cameras-source {
  color: var(--text-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.save-cameras-status {
  min-height: 1.2em;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.save-cameras-status.error {
  color: #ffd5da;
}

.global-search-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.global-search-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.global-search-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.global-search-description {
  color: var(--text-muted);
}

.global-search-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.global-search-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 8px 10px;
}

.global-search-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.global-search-summary {
  color: var(--text-soft);
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.global-search-summary.error {
  color: #ffd5da;
}

.global-search-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.global-search-empty {
  margin-top: 2px;
}

.global-search-match-group {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.global-search-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.global-search-match-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.16rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.global-search-match-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.global-search-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

.global-search-video-card {
  padding: 12px;
  gap: 8px;
}

.global-search-video-card .card-title {
  font-size: 1.08rem;
  line-height: 1.05;
}

.global-search-video-meta {
  font-size: 0.8rem;
}

.global-search-video-footer {
  margin-top: auto;
  justify-content: flex-start;
  align-items: center;
}

/* ---- Organizador de la lista de partidos (filtro temporal + agrupación) ---- */
.match-organizer-panel {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-organizer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.organizer-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.organizer-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.organizer-segmented {
  flex-wrap: wrap;
}

.organizer-seg-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.organizer-seg-btn:hover {
  border-color: rgba(95, 168, 255, 0.5);
  color: #deebff;
}

.organizer-seg-btn.is-active {
  border-color: rgba(48, 128, 255, 0.62);
  background: rgba(48, 128, 255, 0.24);
  color: #ecf5ff;
}

.organizer-seg-btn:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 2px;
}

.organizer-clear {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.match-organizer-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid rgba(78, 103, 146, 0.33);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 27, 0.5);
}

.organizer-custom-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.organizer-custom-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.organizer-custom-input {
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-size: 0.84rem;
  padding: 5px 8px;
  color-scheme: dark;
}

.organizer-custom-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.organizer-custom-error {
  color: #ffd5da;
  font-size: 0.78rem;
}

.organizer-summary {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.organizer-summary.error {
  color: #ffd5da;
}

/* ---- Grupos colapsables de partidos ---- */
.matches-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.match-group {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-group.is-collapsed {
  gap: 0;
}

.match-group-header {
  margin: 0;
}

.match-group-toggle {
  width: 100%;
  border: 1px solid rgba(87, 115, 160, 0.42);
  border-radius: 10px;
  background: rgba(4, 12, 26, 0.7);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.match-group-toggle:hover {
  border-color: rgba(95, 168, 255, 0.5);
  background: rgba(12, 28, 53, 0.76);
}

.match-group-toggle:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 2px;
}

.match-group-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.match-group-chevron {
  width: 14px;
  color: #d8e7ff;
  text-align: center;
  flex-shrink: 0;
}

.match-group-title {
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-group-count {
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  color: var(--text-main);
  text-decoration: none;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.btn-compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-control-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.65);
  outline-offset: 1px;
}

.btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.btn-primary {
  border-color: rgba(228, 0, 20, 0.8);
  background: linear-gradient(130deg, #d10012 0%, #e40014 60%, #ff2233 100%);
  box-shadow: 0 8px 16px rgba(228, 0, 20, 0.26);
}

.btn-primary:hover {
  border-color: #ff5f6a;
  background: linear-gradient(130deg, #d80014 0%, var(--accent-red-hover) 62%, #ff4351 100%);
}

.btn-secondary {
  border-color: rgba(48, 128, 255, 0.46);
  background: rgba(48, 128, 255, 0.16);
  color: #deebff;
}

.btn-secondary:hover {
  border-color: rgba(95, 168, 255, 0.74);
  background: rgba(48, 128, 255, 0.27);
}

.btn-ghost {
  border-color: rgba(118, 141, 180, 0.4);
  background: rgba(6, 15, 35, 0.8);
}

.btn-ghost:hover {
  border-color: rgba(160, 183, 222, 0.72);
  background: rgba(14, 30, 57, 0.92);
}

.btn-danger {
  border-color: rgba(255, 95, 107, 0.55);
  background: rgba(228, 0, 20, 0.2);
  color: #ffd8dc;
}

.btn-danger:hover {
  border-color: rgba(255, 124, 135, 0.82);
  background: rgba(228, 0, 20, 0.34);
}

.status {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(13, 29, 56, 0.96), rgba(7, 18, 34, 0.96));
  color: var(--text-muted);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}

.status::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-blue);
}

.status.error {
  border-color: rgba(255, 95, 107, 0.6);
  color: #ffd9de;
}

.status.error::before {
  background: var(--accent-red);
}

.login-panel {
  width: min(460px, 100%);
  margin: 48px auto 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.login-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form .settings-field {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
}

.login-form .settings-input,
.login-form .btn {
  width: 100%;
}

.login-status {
  margin: 0;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.matches {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.grid.videos {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.card {
  background: linear-gradient(160deg, rgba(16, 36, 67, 0.96), rgba(8, 20, 40, 0.96));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  transition: border-color 120ms ease, transform 120ms ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.card:focus-within {
  border-color: rgba(97, 174, 255, 0.78);
}

.match-card.is-selected {
  border-color: rgba(228, 0, 20, 0.74);
  box-shadow: inset 0 0 0 1px rgba(228, 0, 20, 0.35), var(--shadow-soft);
}

.card-top {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.card-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  white-space: nowrap;
}

.chip-blue {
  background: rgba(48, 128, 255, 0.2);
  border-color: rgba(48, 128, 255, 0.56);
  color: #d7e9ff;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.87rem;
  word-break: break-word;
}

.match-select,
.video-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  user-select: none;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-select input,
.video-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-red);
  cursor: pointer;
}

.video-toggle.selection-toggle input {
  accent-color: var(--accent-green);
}

.match-select input:focus-visible,
.video-toggle input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.74);
  outline-offset: 2px;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.match-card .card-footer .btn {
  margin-left: auto;
}

.video-subtitle {
  font-size: 0.79rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.video-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.video-metadata-badge {
  background: rgba(255, 171, 42, 0.2);
  border-color: rgba(255, 171, 42, 0.62);
  color: #ffe7c1;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  padding: 3px 9px;
  line-height: 1.1;
}

.video-context-meta {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #97abcb;
}

.video-metadata-state {
  color: var(--text-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.video-card.is-manual-metadata {
  position: relative;
  border-color: rgba(255, 171, 42, 0.62);
}

.video-card.is-manual-metadata::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  border-top-left-radius: calc(var(--radius-md) - 1px);
  border-top-right-radius: calc(var(--radius-md) - 1px);
  background: linear-gradient(90deg, rgba(255, 210, 109, 0.94), rgba(255, 143, 18, 0.94));
  pointer-events: none;
}

.video-card.is-manual-metadata .card-title {
  color: #ffe0a7;
}

.video-card.is-manual-metadata .video-subtitle,
.video-card.is-manual-metadata .video-list-subtitle,
.video-card.is-manual-metadata .video-context-meta {
  color: #ffd3a0;
}

.metadata-edit-btn {
  white-space: nowrap;
}

.video-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-toggle {
  border-radius: 999px;
  border: 1px solid rgba(106, 132, 176, 0.35);
  background: rgba(5, 13, 28, 0.56);
  padding: 7px 10px;
}

.video-toggle.selection-toggle {
  border-color: rgba(0, 199, 88, 0.38);
}

.video-toggle:hover {
  border-color: var(--border-strong);
}

.video-toggle.selection-toggle:hover {
  border-color: rgba(0, 199, 88, 0.68);
}

/* Check unificado: "seleccionado" (verde) = AWS + overlay. */
.video-card.is-selected {
  border-color: rgba(0, 199, 88, 0.74);
  box-shadow: inset 0 0 0 1px rgba(0, 199, 88, 0.34), var(--shadow-soft);
}

/* Ya subido a AWS (acento azul, combinable con seleccionado). */
.video-card.is-uploaded {
  border-color: rgba(48, 128, 255, 0.6);
}

.video-card.is-selected.is-uploaded {
  border-color: rgba(0, 199, 88, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(0, 199, 88, 0.34),
    inset 0 0 0 2px rgba(48, 128, 255, 0.28),
    var(--shadow-soft);
}

.chip-green,
.video-uploaded-badge {
  background: rgba(0, 199, 88, 0.2);
  border-color: rgba(0, 199, 88, 0.56);
  color: #b6f3cf;
}

.video-uploaded-badge {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  padding: 3px 9px;
  line-height: 1.1;
}

/* Jugada destacada (dorado). El borde solo aplica si el clip no está
   seleccionado: la selección (verde) es el estado operativo primario. */
.video-card.is-featured:not(.is-selected) {
  border-color: rgba(255, 193, 7, 0.62);
}

.chip-gold,
.video-featured-badge {
  background: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 193, 7, 0.56);
  color: #ffe9a8;
}

.video-featured-badge {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  padding: 3px 9px;
  line-height: 1.1;
}

/* Toggle de jugada destacada: mismo lenguaje del chip dorado pero clicable.
   Apagado se ve gris ("☆ DESTACAR"); prendido, dorado ("★ DESTACADA"). */
.video-featured-toggle {
  cursor: pointer;
  appearance: none;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  padding: 3px 9px;
  line-height: 1.1;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.video-featured-toggle:not(.is-on) {
  background: rgba(158, 158, 158, 0.12);
  border-color: rgba(158, 158, 158, 0.45);
  color: #c9c9c9;
}

.video-featured-toggle:not(.is-on):hover {
  border-color: rgba(255, 193, 7, 0.56);
  color: #ffe9a8;
}

.video-featured-toggle.is-on:hover {
  background: rgba(255, 193, 7, 0.3);
}

.video-featured-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.video-box {
  border-radius: 10px;
  overflow: hidden;
  background: #01050f;
  border: 1px solid rgba(72, 101, 148, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.video-thumb-button {
  width: 100%;
  display: block;
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}

.video-thumb-button:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.65);
  outline-offset: 1px;
}

video {
  width: 100%;
  display: block;
  background: #000;
}

.video-player {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-box img,
.video-box .video-thumb {
  width: 100%;
  display: block;
  background: #000;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.video-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: 42px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.18);
  transition: background 120ms ease;
}

.video-thumb-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  text-align: center;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 235, 235, 0.95);
  background: rgba(75, 0, 0, 0.55);
  pointer-events: none;
}

.video-thumb-error.is-hidden,
.video-thumb-play.is-hidden {
  display: none;
}

.video-thumb-button.is-preview-error {
  cursor: not-allowed;
}

.video-thumb-button:hover .video-thumb-play,
.video-thumb-button:focus-visible .video-thumb-play {
  background: rgba(0, 0, 0, 0.28);
}

.copy-feedback {
  min-height: 1.15em;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-feedback.error,
.selection-status.error,
.upload-status.error {
  color: #ffd5da;
}

.detail-header {
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-header-main {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-header-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-header-title-row .heading {
  flex: 1 1 220px;
}

.match-title-edit-button {
  align-self: flex-start;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.match-title-editor {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(88, 118, 164, 0.36);
  border-radius: var(--radius-sm);
  background: rgba(4, 12, 27, 0.66);
}

.match-title-editor-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.match-title-editor-label {
  color: var(--text-soft);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.match-title-editor-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 8px 10px;
}

.match-title-editor-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.match-title-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.match-title-editor-status {
  grid-column: 1 / -1;
  min-height: 1.2em;
}

.match-title-editor-status.error {
  color: #ffd5da;
}

.detail-header-game-id {
  color: var(--text-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.match-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.match-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(80, 140, 220, 0.35);
  border-radius: 999px;
  background: rgba(5, 20, 45, 0.55);
  color: #9bbcff;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: none;
  white-space: normal;
  word-break: break-word;
}

.match-meta-chip.error {
  border-color: rgba(255, 95, 107, 0.46);
  background: rgba(80, 12, 24, 0.42);
}

.detail-header-tools {
  flex: 1 1 700px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-compact-toolbar {
  padding: 0;
  gap: 8px;
}

.detail-compact-toolbar .toolbar-group {
  padding: 8px 10px;
}

.detail-view-group {
  flex: 1 1 230px;
}

.detail-options-group {
  flex: 2 1 340px;
}

.detail-actions-group {
  flex: 2 1 390px;
}

.detail-view-switcher-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-view-select {
  min-height: 32px;
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
}

.detail-view-select:hover {
  border-color: rgba(95, 168, 255, 0.55);
}

.detail-view-select:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(88, 118, 164, 0.38);
  background: rgba(4, 11, 25, 0.74);
}

.detail-view-switcher-controls {
  width: fit-content;
}

.detail-view-switcher-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.detail-view-switcher-btn:hover {
  border-color: rgba(95, 168, 255, 0.5);
  color: #deebff;
}

.detail-view-switcher-btn.is-active {
  border-color: rgba(48, 128, 255, 0.62);
  background: rgba(48, 128, 255, 0.24);
  color: #ecf5ff;
}

.detail-view-switcher-btn:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 2px;
}

.detail-quarter-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-quarter-control-btn {
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: 999px;
  background: rgba(4, 11, 25, 0.74);
  color: var(--text-muted);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.detail-quarter-control-btn:hover {
  border-color: rgba(95, 168, 255, 0.55);
  color: #deebff;
}

.detail-quarter-control-btn:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 2px;
}

.detail-quarter-control-btn:disabled {
  opacity: 0.56;
  cursor: default;
}

.detail-actions-group .action-group-primary {
  width: 100%;
}

.detail-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
}

.detail-search-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.detail-search-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-size: 0.88rem;
  padding: 7px 10px;
}

.detail-search-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.detail-search-result {
  color: var(--text-soft);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metadata-editor-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metadata-editor-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metadata-editor-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metadata-editor-video {
  color: var(--text-soft);
}

.metadata-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metadata-editor-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.metadata-editor-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metadata-editor-field-label {
  color: var(--text-soft);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metadata-editor-input {
  min-height: 36px;
  border: 1px solid rgba(88, 118, 164, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(4, 11, 25, 0.78);
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 8px 10px;
}

.metadata-editor-input:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 1px;
}

.metadata-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metadata-editor-status {
  min-height: 1.2em;
}

.metadata-editor-status.error {
  color: #ffd5da;
}

.detail-search-empty {
  margin-top: 2px;
}

.match-videos-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quarter-section {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quarter-section-header {
  margin: 0;
}

.quarter-section-toggle {
  width: 100%;
  border: 1px solid rgba(87, 115, 160, 0.42);
  border-radius: 10px;
  background: rgba(4, 12, 26, 0.7);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.quarter-section-toggle:hover {
  border-color: rgba(95, 168, 255, 0.5);
  background: rgba(12, 28, 53, 0.76);
}

.quarter-section-toggle:focus-visible {
  outline: 2px solid rgba(48, 128, 255, 0.64);
  outline-offset: 2px;
}

.quarter-section-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quarter-section-chevron {
  width: 14px;
  color: #d8e7ff;
  text-align: center;
  flex-shrink: 0;
}

.quarter-section-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quarter-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(48, 128, 255, 0.45);
  background: rgba(48, 128, 255, 0.16);
  color: #dbeeff;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
}

.quarter-section-body {
  padding-top: 2px;
}

.quarter-section.is-collapsed {
  gap: 8px;
}

.grid.videos.videos-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.videos.videos-grid.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.videos.videos-grid.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid.videos.videos-grid.grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.videos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Vista GridPoint ─────────────────────────────────────────────────────
   Distribución estilo PointsLog: local | cámara central | visita. Cada fila
   es una jugada (correlación por CC). */
.gridpoint-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gridpoint-columns-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gridpoint-column-title {
  border-bottom: 2px solid rgba(48, 128, 255, 0.45);
  color: #dbeeff;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 6px 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gridpoint-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gridpoint-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gridpoint-cell-label {
  display: none;
  color: var(--text-soft);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gridpoint-cell-empty {
  border: 1px dashed rgba(88, 118, 164, 0.4);
  border-radius: var(--radius-md);
  background: rgba(4, 11, 25, 0.35);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.gridpoint-cell-empty-text {
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.85;
}

.gridpoint-cell-discarded {
  border-style: dotted;
  opacity: 0.66;
}

/* Jugada sin teamSide del Manager: se muestran ambos aros (sin descarte). */
.gridpoint-row-fallback .gridpoint-cell {
  position: relative;
}

.gridpoint-config-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-color: rgba(255, 196, 87, 0.5);
  background: rgba(84, 60, 12, 0.28);
}

.gridpoint-config-banner-text {
  margin: 0;
  color: #ffe9c2;
}

/* ── Modal "Opciones de vista" ─────────────────────────────────────────── */
.view-options-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 8, 20, 0.66);
}

.view-options-backdrop.hidden {
  display: none;
}

.view-options-modal {
  width: min(560px, 100%);
  max-height: min(560px, 90vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.view-options-title {
  margin: 0;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.view-options-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(78, 103, 146, 0.33);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 27, 0.66);
  padding: 10px 12px;
}

.view-options-team-name {
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-options-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-options-status {
  min-height: 1.2em;
}

.view-options-status.error {
  color: #ffd5da;
}

.video-list-row {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(220px, 1.05fr) minmax(250px, 1.2fr) minmax(170px, 220px);
  gap: 12px;
  align-items: start;
}

.video-list-preview {
  min-width: 0;
}

.video-list-preview .video-box {
  height: 100%;
}

.video-list-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.video-list-main .card-title {
  font-size: 1.12rem;
  line-height: 1.05;
}

.video-list-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.video-list-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px 10px;
  min-width: 0;
}

.video-detail-item {
  margin: 0;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(86, 116, 161, 0.28);
  background: rgba(3, 10, 23, 0.5);
}

.video-detail-label {
  margin: 0 0 2px;
  color: var(--text-soft);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.video-detail-value {
  margin: 0;
  color: var(--text-main);
  font-size: 0.83rem;
  line-height: 1.35;
  word-break: break-word;
}

.video-list-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.video-list-actions .video-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-list-actions .video-toggle,
.video-list-actions .btn {
  width: 100%;
}

.upload-progress-panel {
  background: rgba(4, 11, 25, 0.86);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-progress-panel.running {
  border-color: rgba(48, 128, 255, 0.58);
}

.upload-progress-panel.success {
  border-color: rgba(0, 199, 88, 0.63);
}

.upload-progress-panel.error {
  border-color: rgba(255, 95, 107, 0.63);
}

.upload-progress-panel.paused {
  border-color: rgba(255, 196, 0, 0.6);
}

.upload-progress-panel.paused .upload-progress-bar-fill {
  background: linear-gradient(90deg, #c79100 0%, #ffc400 100%);
}

.upload-pause-toggle.hidden {
  display: none;
}

.upload-progress-bar {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(67, 98, 141, 0.52);
  background: #081228;
}

.upload-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3080ff 0%, #4ea7ff 45%, #e40014 100%);
  transition: width 160ms linear;
}

.upload-progress-panel.success .upload-progress-bar-fill {
  background: linear-gradient(90deg, #00a24a 0%, #00c758 100%);
}

.upload-progress-panel.error .upload-progress-bar-fill {
  background: linear-gradient(90deg, #e40014 0%, #ff6171 100%);
}

.upload-progress-error-simple {
  color: #ffd5da;
}

.upload-progress-error-technical {
  color: #ffb8bf;
  font-size: 0.76rem;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.35;
  white-space: pre-wrap;
  max-height: 96px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  background: rgba(228, 0, 20, 0.09);
  border: 1px solid rgba(228, 0, 20, 0.3);
  padding: 6px 8px;
}

.overlay-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: #000;
  overflow: hidden;
}

.overlay-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: #000;
}

.overlay-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms linear;
  background: #000;
}

.overlay-video.is-active {
  opacity: 1;
}

.overlay-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #b3c4e5;
  background: #000;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overlay-empty.hidden {
  display: none;
}

.overlay-empty.error {
  color: #ffd5da;
}

body.overlay-mode {
  background: #000;
}

body.overlay-mode .page {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body.overlay-mode .topbar {
  display: none;
}

body.overlay-mode .content {
  min-height: 100vh;
  gap: 0;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #3a4f75 #081024;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: #081024;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #304669;
  border: 2px solid #081024;
}

*::-webkit-scrollbar-thumb:hover {
  background: #426291;
}

@media (max-width: 1680px) {
  .grid.videos.videos-grid.grid-6 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1480px) {
  .grid.videos.videos-grid.grid-5,
  .grid.videos.videos-grid.grid-6 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  .grid.videos.videos-grid.grid-4,
  .grid.videos.videos-grid.grid-5,
  .grid.videos.videos-grid.grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-list-row {
    grid-template-columns: minmax(170px, 240px) minmax(200px, 1fr);
  }

  .video-list-details,
  .video-list-actions {
    grid-column: 1 / -1;
  }

  .video-list-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .video-list-actions .video-toggles {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .video-list-actions .video-toggle,
  .video-list-actions .btn {
    width: auto;
  }
}

@media (max-width: 1024px) {
  .page {
    padding: 18px 14px 30px;
  }

  .heading {
    font-size: clamp(1.65rem, 4.2vw, 2.2rem);
  }

  .view-header {
    padding: 16px;
  }

  .compact-toolbar {
    padding: 9px 10px;
  }

  .toolbar-group {
    flex: 1 1 100%;
  }

  .detail-header-main,
  .detail-header-tools,
  .detail-view-group,
  .detail-options-group,
  .detail-actions-group {
    width: 100%;
  }

  .detail-search {
    width: 100%;
    max-width: none;
  }

  .detail-quarter-controls {
    width: 100%;
  }

  .grid.videos.videos-grid.grid-3,
  .grid.videos.videos-grid.grid-4,
  .grid.videos.videos-grid.grid-5,
  .grid.videos.videos-grid.grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* GridPoint apilado: cabecera de columnas fuera, etiqueta por celda dentro
     y celdas vacías ocultas (no aportan en una sola columna). */
  .gridpoint-columns-header {
    display: none;
  }

  .gridpoint-row {
    grid-template-columns: 1fr;
    border-bottom: 1px dashed rgba(88, 118, 164, 0.3);
    padding-bottom: 10px;
  }

  .gridpoint-cell-label {
    display: inline-flex;
  }

  .gridpoint-cell-empty {
    display: none;
  }

  .video-list-row {
    grid-template-columns: 1fr;
  }

  .video-list-details {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .video-list-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .video-list-actions .video-toggles {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .video-list-actions .video-toggle,
  .video-list-actions .btn {
    width: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px;
  }

  .brand-header {
    align-items: flex-start;
  }

  .brand-header-main {
    align-items: flex-start;
  }

  .topbar-match-count {
    align-self: flex-start;
  }

  .auth-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .brand-logo-link {
    width: 50px;
    height: 50px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .compact-toolbar {
    padding: 8px;
  }

  .toolbar-group {
    width: 100%;
    padding: 8px 9px;
  }

  .action-group-primary,
  .action-group-secondary {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-view-switcher-controls {
    width: 100%;
    overflow-x: auto;
  }

  .detail-quarter-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-view-switcher-btn {
    flex: 1 0 auto;
  }

  .detail-quarter-control-btn {
    flex: 1 0 auto;
  }

  .match-title-edit-button {
    width: 100%;
  }

  .match-title-editor {
    grid-template-columns: 1fr;
  }

  .match-title-editor-actions .btn {
    flex: 1 1 120px;
  }

  .detail-actions-group .action-group-primary .btn {
    width: 100%;
  }

  .metadata-editor-actions .btn {
    width: 100%;
  }

  .home-selection-tools {
    width: 100%;
    border-radius: var(--radius-sm);
    justify-content: space-between;
  }

  .global-search-videos-grid {
    grid-template-columns: 1fr;
  }

  .global-search-match-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .global-search-match-actions .btn {
    width: 100%;
  }

  .save-cameras-actions {
    width: 100%;
    align-items: stretch;
  }

  .save-cameras-meta {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .save-cameras-actions .btn {
    width: 100%;
  }

  .grid.matches,
  .grid.videos {
    grid-template-columns: 1fr;
  }

  .match-organizer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .organizer-group {
    align-items: flex-start;
  }

  .organizer-segmented {
    width: 100%;
  }

  .organizer-seg-btn {
    flex: 1 1 auto;
  }

  .grid.videos.videos-grid.grid-3,
  .grid.videos.videos-grid.grid-4,
  .grid.videos.videos-grid.grid-5,
  .grid.videos.videos-grid.grid-6 {
    grid-template-columns: 1fr;
  }

  .video-list-row {
    grid-template-columns: 1fr;
  }

  .video-list-details {
    grid-template-columns: 1fr;
  }

  .video-list-actions,
  .video-list-actions .video-toggles {
    flex-direction: column;
    align-items: stretch;
  }

  .video-list-actions .video-toggle,
  .video-list-actions .btn {
    width: 100%;
  }

  .quarter-section-toggle {
    padding: 8px 10px;
  }

  .card-footer {
    align-items: stretch;
  }

  .match-card .card-footer .btn {
    margin-left: 0;
    width: 100%;
  }

  .detail-header-title-row .heading {
    width: 100%;
  }
}

/* Overlay Global — URL fija para OBS */
.home-global-overlay-group {
  flex: 1 1 420px;
}

.global-overlay-controls {
  justify-content: space-between;
}

.global-overlay-meta {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.global-overlay-url {
  word-break: break-all;
}

.match-card.is-global-overlay {
  border-color: rgba(48, 128, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(48, 128, 255, 0.35), var(--shadow-soft);
}

.match-card.is-global-overlay .match-global-overlay {
  color: #dce9ff;
  font-weight: 600;
}

/* ===== Vista GLOBAL de highlights ===== */
/* Zona de control fija: cabecera + filtros + acciones quedan pegadas arriba
   mientras solo la lista de highlights hace scroll (el contador no se pierde). */
.global-highlights-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
  background: var(--bg-app);
  box-shadow: 0 14px 18px -10px rgba(0, 0, 0, 0.6);
}

/* Los .panel no traen padding propio (lo aporta su contenido). Sin esto el
   texto pega al borde redondeado y se recorta (ej. el "2" del contador). */
.global-highlights-header,
.global-highlights-filters,
.global-highlights-actions {
  padding: 13px 18px;
}

/* Cabecera compacta: título + subconteo a la izquierda, contador como chip a la
   derecha (una sola fila) para no gastar alto en la zona fija. */
.global-highlights-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
}

.global-highlights-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.global-highlights-counter {
  flex: none;
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #b6f3cf;
  background: rgba(0, 199, 88, 0.16);
  border: 1px solid rgba(0, 199, 88, 0.5);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

.global-highlights-subcount {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.global-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

/* Segunda fila: grupos segmentados que envuelven sin encimarse (como Partidos). */
.global-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: flex-end;
  margin-top: 14px;
}

.global-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.global-filter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.global-filter-search,
.global-filter-multiselect,
.global-filter-custom input {
  background: rgba(5, 13, 28, 0.56);
  border: 1px solid rgba(106, 132, 176, 0.35);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.86rem;
}

.global-filter-multiselect {
  min-height: 108px;
}

.global-filter-custom {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* El panel del dropdown se ancla absoluto y debe poder salir de la tarjeta. */
.global-highlights-filters {
  overflow: visible;
}

.global-filters-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: "Barlow Condensed", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0 0 10px;
  display: block;
}

.global-filters-toggle:hover {
  color: #deebff;
}

/* Desplegable multi-selección con buscador */
.ms-dropdown {
  position: relative;
}

.ms-trigger {
  width: 100%;
  text-align: left;
  background: rgba(5, 13, 28, 0.56);
  border: 1px solid rgba(106, 132, 176, 0.35);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 28px 8px 10px;
  font-size: 0.86rem;
  cursor: pointer;
  position: relative;
}

.ms-trigger::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  font-size: 0.7rem;
}

.ms-trigger:hover,
.ms-trigger.is-open {
  border-color: var(--border-strong);
}

.ms-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms-search {
  background: var(--bg-control);
  border: 1px solid rgba(106, 132, 176, 0.35);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 9px;
  font-size: 0.84rem;
}

.ms-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
}

.ms-option:hover {
  background: var(--bg-control-hover);
  color: var(--text-main);
}

.ms-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.ms-empty {
  padding: 6px;
  color: var(--text-soft);
}

.global-filters-row .btn-ghost {
  align-self: flex-end;
}

.global-highlights-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.global-highlights-action-status {
  font-size: 0.84rem;
  color: var(--text-soft);
}

.global-highlights-action-status.error {
  color: #ffd5da;
}

.global-highlights-list {
  margin-top: 4px;
}

.global-highlight-match {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #97abcb;
  font-weight: 600;
}

.global-highlight-date {
  font-size: 0.74rem;
  color: var(--text-soft);
}

.global-overlay-order {
  margin-top: 10px;
}
