:root {
  --ink: #151515;
  --muted: #686c72;
  --line: #d9dee5;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --red: #e00016;
  --red-soft: #ffe0e3;
  --blue: #005cff;
  --blue-soft: #dfeaff;
  --green: #0b7c64;
  --yellow: #f2b84b;
  --shadow: 0 14px 40px rgba(19, 25, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 3vw, 32px);
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.club-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-credit {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

h2 {
  font-size: 20px;
}

.tabs,
.setup-actions,
.timer-buttons,
.export-actions,
.section-actions,
.finish-controls,
.edit-actions,
.timeline-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.segmented,
.ghost-button,
.icon-button,
.primary-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
}

.tab.is-active,
.segmented.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.primary-action {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.danger-button {
  border-color: var(--red);
  color: var(--red);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 24px);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.setup-band,
.video-panel,
.action-pad,
.dashboard-band,
.compare-controls,
.export-band,
.report-shell,
.admin-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setup-band {
  padding: 16px;
}

.setup-grid,
.fighters-grid,
.saved-match-bar,
.workbench,
.dashboard-band,
.compare-controls,
.comparison-grid {
  display: grid;
  gap: 14px;
}

.setup-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.fighters-grid,
.dashboard-band {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.saved-match-bar {
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.6fr) auto auto;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.workbench {
  grid-template-columns: minmax(132px, 180px) minmax(420px, 1fr) minmax(132px, 180px);
  margin-top: 14px;
}

label,
.fighter-form {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.fighter-form {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.fighter-form strong {
  color: var(--ink);
  font-size: 18px;
}

.red-side {
  background: var(--red-soft);
}

.blue-side {
  background: var(--blue-soft);
}

.workbench {
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 92px;
}

.video-panel {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.control-panel {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
}

.timer-strip {
  display: grid;
  grid-template-columns: 88px 110px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.video-panel.video-mode .timer-strip {
  grid-template-columns: 88px 1fr;
}

.video-panel.video-mode .timer-buttons {
  display: none;
}

.video-panel.video-mode #time-display {
  font-size: 34px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

#round-display,
#time-display {
  font-size: 28px;
  line-height: 1;
}

.icon-button {
  min-width: 48px;
}

.icon-button.wide {
  min-width: 86px;
}

.video-loader {
  margin: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  place-items: center;
  text-align: center;
}

.video-loader input {
  display: none;
}

.youtube-loader {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.youtube-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.youtube-status.is-error {
  color: var(--red);
}

.video-panel.video-mode .youtube-loader {
  display: grid;
}

.youtube-player {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101010;
}

.youtube-player.has-youtube {
  display: block;
}

.youtube-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

video {
  display: none;
  width: 100%;
  max-height: 420px;
  background: #101010;
}

video.has-video {
  display: block;
}

.score-side {
  width: 100%;
  min-height: 118px;
  border: 3px solid transparent;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
}

.score-side span,
.score-side small {
  display: block;
}

.score-side strong {
  display: block;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 0.95;
}

.red-score {
  background: linear-gradient(180deg, #fff0f1 0%, #ffc7cd 100%);
  color: #b00012;
}

.blue-score {
  background: linear-gradient(180deg, #eff5ff 0%, #bdd5ff 100%);
  color: #0042c2;
}

.score-side.is-selected {
  border-color: currentColor;
}

.action-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.choice-row:has(.choice:nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four-choice,
.choice-row.four-choice:has(.choice:nth-child(3)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.points-row {
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
}

.choice {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
  color: var(--ink);
  padding: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.four-choice .choice {
  font-size: 18px;
}

.choice.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

body[data-match-active="true"]:not([data-show-setup="true"]) #analysis-view .setup-band {
  display: none;
}

.points-row .choice {
  background: #fff3cf;
  border-color: #ecc663;
  color: #4e3900;
}

.choice-row[data-choice="weapon"] .choice,
.choice-row[data-choice="correction"] .choice,
.choice-row[data-choice="combo"] .choice,
.choice-row[data-choice="spin"] .choice,
.technique-field,
.counter-field,
.clinch-field {
  background: #eef7ee;
  border-color: #a9d8af;
  color: #173f22;
}

.choice-row[data-choice="guardRelation"] .choice,
.choice-row[data-choice="stance"] .choice {
  background: #f3eefb;
  border-color: #cbb8e8;
  color: #352050;
}

.choice-row[data-choice="type"] .choice {
  background: #edf4ff;
  border-color: #a9c8f7;
  color: #12345e;
}

.choice-row[data-choice="type"] .choice[data-value="Amonestacion"] {
  background: #fff0e7;
  border-color: #efb082;
  color: #733300;
}

.choice-row[data-choice="zone"] .choice {
  background: #f5f6f8;
  border-color: #d1d7e0;
  color: #252a31;
}

.choice.is-active,
.choice-row[data-choice="type"] .choice.is-active,
.choice-row[data-choice="type"] .choice[data-value="Amonestacion"].is-active,
.points-row .choice.is-active,
.choice-row[data-choice="weapon"] .choice.is-active,
.choice-row[data-choice="correction"] .choice.is-active,
.choice-row[data-choice="combo"] .choice.is-active,
.choice-row[data-choice="spin"] .choice.is-active,
.choice-row[data-choice="guardRelation"] .choice.is-active,
.choice-row[data-choice="stance"] .choice.is-active,
.choice-row[data-choice="zone"] .choice.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.penalty-field,
.technique-field,
.counter-field,
.clinch-field {
  display: none;
  margin: 0;
}

.penalty-field.is-visible,
.technique-field.is-visible,
.counter-field.is-visible,
.clinch-field.is-visible {
  display: grid;
}

.is-hidden {
  display: none !important;
}

.edit-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.edit-actions .register-button {
  flex: 1 1 240px;
}

.edit-cancel {
  display: none;
}

.edit-cancel.is-visible {
  display: inline-flex;
  align-items: center;
}

.register-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 8px;
  background: var(--yellow);
  color: #2d210b;
  font-size: 20px;
  font-weight: 950;
}

.dashboard-band {
  padding: 16px;
}

.section-title,
.wide-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wide-title {
  margin-top: 4px;
}

.timeline {
  display: grid;
  gap: 8px;
  min-height: 120px;
  max-height: 460px;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline-action {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--ink);
  border-radius: 8px;
  background: white;
  padding: 9px 12px;
  text-align: left;
}

.timeline-action.red {
  border-left-color: var(--red);
}

.timeline-action.blue {
  border-left-color: var(--blue);
}

.timeline strong {
  display: block;
}

.timeline-tools {
  margin-top: 6px;
}

.timeline-tools button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.timeline-tools .delete-action {
  border-color: var(--red);
  color: var(--red);
}

.stats-grid,
.profiles-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric,
.profile-card,
.compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.metric span,
.profile-card span,
.compare-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.metric-win {
  border-color: rgba(11, 124, 100, 0.45);
  background: #edf8f3;
}

.metric-win strong {
  color: var(--green);
}

.metric-loss {
  border-color: rgba(224, 0, 22, 0.32);
  background: #fff0f1;
}

.metric-loss strong {
  color: var(--red);
}

.profiles-list {
  margin-top: 16px;
}

.round-score-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.round-score-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  background: white;
  padding: 9px 10px;
}

.round-score-card.red {
  border-left-color: var(--red);
}

.round-score-card.blue {
  border-left-color: var(--blue);
}

.round-score-card.is-current {
  box-shadow: inset 0 0 0 2px rgba(21, 21, 21, 0.08);
}

.round-score-card span,
.round-score-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.round-score-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  font-size: 24px;
}

.round-score-card em {
  color: var(--muted);
  font-style: normal;
}

.round-score-card.red strong b:first-child,
.round-score-card.tie strong b:first-child {
  color: var(--red);
}

.round-score-card.blue strong b:last-child,
.round-score-card.tie strong b:last-child {
  color: var(--blue);
}

.profile-card {
  display: grid;
  gap: 10px;
}

.profile-card h3 {
  margin: 0;
  font-size: 22px;
}

.dna {
  line-height: 1.45;
}

.compare-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.comparison-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.compare-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.export-band {
  padding: 18px;
}

.report-shell {
  padding: 18px;
}

.report-empty {
  display: grid;
  gap: 8px;
  min-height: 220px;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.report-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.report-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.report-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.report-visual {
  width: 100%;
  min-height: 250px;
  overflow: auto;
}

.report-visual svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}

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

.conclusion-card {
  border-left: 5px solid var(--ink);
  border-radius: 8px;
  background: #f7f7f4;
  padding: 12px 14px;
}

.conclusion-card.red {
  border-left-color: var(--red);
}

.conclusion-card.blue {
  border-left-color: var(--blue);
}

.conclusion-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.conclusion-card h4 {
  font-size: 18px;
  margin: 4px 0 8px;
}

.conclusion-card p {
  color: #333;
  line-height: 1.45;
  margin: 0;
}

.export-band p {
  max-width: 760px;
  margin: 8px 0 14px;
  color: var(--muted);
}

.finish-controls {
  align-items: center;
}

.finish-controls select {
  width: auto;
  min-width: 150px;
}

.admin-shell {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.access-gate {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.access-gate[hidden],
.tabs[hidden],
.view[hidden] {
  display: none !important;
}

.access-card {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px);
  gap: 16px;
  width: min(760px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.access-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
}

.password-login-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
}

.password-login-form p {
  grid-column: 1 / -1;
}

.access-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.access-actions p {
  flex: 1 1 240px;
}

.google-json-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f7f4;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}

.muted-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.1fr) minmax(130px, 0.7fr) minmax(160px, 0.8fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
}

.sync-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f4;
}

.sync-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.sync-actions,
.manual-sync-list,
.profile-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-actions {
  justify-content: flex-end;
}

.manual-sync-links {
  margin-top: 10px;
}

.manual-sync-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.report-action-table-wrap {
  overflow: auto;
}

.report-action-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.report-action-table th,
.report-action-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.report-action-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.report-action-table tr.red td:first-child {
  border-left: 4px solid var(--red);
}

.report-action-table tr.blue td:first-child {
  border-left: 4px solid var(--blue);
}

.profile-history {
  display: grid;
  gap: 8px;
}

.profile-match-list {
  display: grid;
  gap: 8px;
}

.profile-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--ink);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.profile-match-row.red {
  border-left-color: var(--red);
}

.profile-match-row.blue {
  border-left-color: var(--blue);
}

.profile-match-row strong,
.profile-match-row small {
  display: block;
}

.profile-match-row small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.management-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
  box-shadow: var(--shadow);
}

.management-card.full-span {
  grid-column: 1 / -1;
}

.compact-title h3 {
  margin: 0;
  font-size: 18px;
}

.compact-title input {
  max-width: 320px;
}

.management-list,
.championship-list {
  display: grid;
  gap: 8px;
}

.management-row,
.championship-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.management-row strong,
.management-row small,
.championship-row strong,
.championship-row small {
  display: block;
}

.management-row small,
.championship-row small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.danger-mini {
  border-color: var(--red);
  color: var(--red);
}

.championship-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.championship-participants span {
  border-radius: 999px;
  background: #eef1f5;
  padding: 6px 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
}

.check-row input {
  width: auto;
  min-height: 0;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.users-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  background: white;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.users-table th {
  background: #f1f2f4;
  font-size: 12px;
  text-transform: uppercase;
}

.users-table td {
  font-size: 13px;
  font-weight: 700;
}

.users-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-subtitle {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e8f5ef;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.is-off {
  background: #f3e4e2;
  color: var(--red);
}

pre {
  overflow: auto;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  color: #f7f7f4;
  font-size: 12px;
}

@media (max-width: 980px) {
  .topbar,
  .brand-block,
  .section-title,
  .wide-title {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-grid,
  .fighters-grid,
  .saved-match-bar,
  .workbench,
  .dashboard-band,
  .admin-form,
  .password-login-form,
  .sync-panel,
  .access-card,
  .compare-controls,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .profile-match-row {
    grid-template-columns: 1fr;
  }

  .management-grid,
  .management-row,
  .championship-row {
    grid-template-columns: 1fr;
  }

  .championship-participants {
    justify-content: flex-start;
  }

  .timer-strip {
    grid-template-columns: 1fr 1fr;
  }

  .workbench {
    grid-template-columns: 1fr 1fr;
  }

  .red-side-panel {
    grid-column: 1;
    order: 2;
  }

  .blue-side-panel {
    grid-column: 2;
    order: 2;
  }

  .control-panel {
    grid-column: 1 / -1;
    order: 3;
  }

  .side-panel,
  .video-panel {
    position: static;
  }

  .video-panel {
    grid-column: 1 / -1;
    order: 1;
  }

  .action-pad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .timer-buttons {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  main {
    padding: 10px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .setup-band {
    padding: 10px;
  }

  .score-side {
    min-height: 86px;
    padding: 10px;
  }

  .score-side strong {
    font-size: 40px;
  }

  .action-pad {
    gap: 7px;
    padding: 10px;
  }

  .action-pad::before {
    grid-column: 1 / -1;
    min-height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  body[data-selected-competitor="red"] .action-pad::before {
    content: "Registrando rojo";
    background: var(--red);
  }

  body[data-selected-competitor="blue"] .action-pad::before {
    content: "Registrando azul";
    background: var(--blue);
  }

  .choice-row,
  .choice-row:has(.choice:nth-child(3)),
  .four-choice,
  .choice-row.four-choice:has(.choice:nth-child(3)),
  .points-row,
  .stats-grid,
  .profiles-list {
    grid-template-columns: 1fr 1fr;
  }

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

  .choice {
    min-height: 44px;
    padding: 6px;
    font-size: 12px;
    line-height: 1.1;
  }

  .four-choice .choice {
    font-size: 14px;
  }

  .conclusion-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .topbar,
  .setup-band,
  .action-pad,
  .timer-buttons,
  .video-loader,
  video,
  .export-actions,
  .ghost-button,
  .tabs {
    display: none !important;
  }

  .view {
    display: none !important;
  }

  #report-view {
    display: block !important;
  }

  .report-shell {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-header,
  .report-card h3 {
    display: none !important;
  }

  .report-grid {
    margin-top: 0;
    gap: 10px;
  }

  .report-card {
    border: 0;
    padding: 0;
    break-inside: avoid;
  }

  .report-visual {
    min-height: 0;
    overflow: visible;
  }

  .report-visual svg {
    min-width: 0;
  }

  body {
    background: white;
  }
}
