:root {
  --bg: #07130f;
  --panel: #0d211a;
  --panel-2: #102d23;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --text: #f3fff9;
  --muted: #9db9ad;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #62f29a;
  --primary-dark: #24b95f;
  --warning: #f8d96f;
  --danger: #ff6b6b;
  --shadow: 0 18px 60px rgba(0,0,0,0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top left, #174c35 0, var(--bg) 42%, #030706 100%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { width: min(1480px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(18px); position: sticky; top: 12px; z-index: 10; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 2.8vw, 2.6rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.15rem, 2vw, 1.65rem); letter-spacing: -0.03em; }
h3 { font-size: 1rem; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; margin-bottom: 6px; }
.topnav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .admin-tabs button { padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; }
.topnav a.active, .admin-tabs button.active { background: var(--primary); color: #062112; border-color: transparent; font-weight: 800; }
.session-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.session-identity { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.login-card { width: min(680px, 100%); margin: clamp(26px, 8vh, 90px) auto 0; }
.auth-copy { margin: 10px 0 18px; }

.view { display: none; margin-top: 22px; }
.view.active { display: block; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.045)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head.wrap { flex-wrap: wrap; }
.spacing-top { margin-top: 18px; }
.hidden { display: none !important; }

button { border: 0; border-radius: 14px; padding: 11px 15px; color: var(--text); background: rgba(255,255,255,.1); cursor: pointer; transition: .15s ease; border: 1px solid var(--line); }
button:hover:not(:disabled) { transform: translateY(-1px); background: rgba(255,255,255,.15); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: linear-gradient(135deg, var(--primary), #2edb79); color: #062112; border-color: transparent; font-weight: 900; }
button.secondary { background: rgba(98,242,154,.1); color: var(--primary); border-color: rgba(98,242,154,.28); }
button.danger { background: rgba(255,107,107,.12); color: #ffb5b5; border-color: rgba(255,107,107,.26); }
button.ghost { background: transparent; }
.button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button-row.small button, .admin-match-actions button { padding: 8px 10px; font-size: .82rem; border-radius: 11px; }

input, select { width: 100%; background: rgba(0,0,0,.22); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 12px 13px; outline: 0; }
select option { background: #0d211a; color: white; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .9rem; }
.field-label { margin-bottom: 7px; }
.form-row { display: grid; gap: 12px; margin-bottom: 14px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact { margin-top: 12px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 16px; }
.small-input { max-width: 220px; padding: 10px 12px; }
.hint { color: var(--muted); font-size: .9rem; line-height: 1.45; margin-top: 10px; }
.muted-block { color: var(--muted); background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 16px; padding: 14px; line-height: 1.5; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.badge.live { color: #061b0e; background: var(--primary); }
.badge.completed, .badge.bye { color: #061b0e; background: #91e7ff; }
.badge.ready { color: #061b0e; background: var(--warning); }
.badge.pending { color: var(--muted); }
.warning { background: rgba(248,217,111,.12); border: 1px solid rgba(248,217,111,.32); color: #ffeeb2; padding: 14px 16px; border-radius: 16px; margin: 14px 0; }

.bracket-host {
  width: 100%;
  min-width: 0;
}

.bracket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0,0,0,.24);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.bracket-summary {
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}

.bracket-summary strong { color: var(--primary); }
.bracket-summary span { color: var(--muted); font-size: .82rem; }

.bracket-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bracket-tool {
  min-width: 38px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(98,242,154,.1);
  color: var(--primary);
  border-color: rgba(98,242,154,.24);
  font-weight: 900;
}

.bracket-tool.text { min-width: auto; font-size: .78rem; }
.bracket-zoom-label { width: 48px; text-align: center; color: var(--muted); font-size: .8rem; font-weight: 800; }

.bracket-viewport {
  position: relative;
  width: 100%;
  height: clamp(520px, 68vh, 820px);
  min-height: 520px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  outline: 0;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(98,242,154,.055), rgba(0,0,0,.19));
  background-size: 28px 28px, 28px 28px, auto;
  border: 1px solid rgba(98,242,154,.24);
  border-radius: 20px;
  box-shadow: inset 0 0 45px rgba(0,0,0,.25);
}

.bracket-viewport:focus-visible { box-shadow: inset 0 0 45px rgba(0,0,0,.25), 0 0 0 2px var(--primary); }
.bracket-viewport.dragging { cursor: grabbing; }

.bracket-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.bracket-board {
  display: flex;
  align-items: stretch;
  gap: 18px;
  width: max-content;
  padding: 4px;
}

.round {
  flex: 0 0 302px;
  width: 302px;
  min-width: 302px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: linear-gradient(180deg, rgba(98,242,154,.075), rgba(255,255,255,.025));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.round-stage-head {
  min-height: 72px;
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 10px 11px;
  background: rgba(0,0,0,.26);
  border: 1px solid rgba(98,242,154,.2);
  border-radius: 14px;
}

.round-stage-head > span {
  color: var(--primary);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 900;
}

.round-stage-head h3 {
  margin: 0;
  color: var(--text);
  text-transform: none;
  letter-spacing: -.01em;
  font-size: 1rem;
}

.round-stage-head small { color: var(--muted); font-size: .72rem; }

.round-matches {
  display: flex;
  flex-direction: column;
  padding-top: var(--round-offset, 0px);
  gap: var(--round-gap, 18px);
}

.bracket-pan-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 7px 11px;
  color: var(--muted);
  background: rgba(3,11,8,.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .72rem;
  white-space: nowrap;
  pointer-events: none;
}

.match-card {
  position: relative;
  display: block !important;
  width: 100%;
  box-sizing: border-box;
  background: rgba(4,15,11,.9);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px;
  min-height: 180px;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}

.admin-board .match-card { min-height: 232px; }

.match-card.completed {
  border-color: rgba(145,231,255,.4);
}

.match-card.live {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(98,242,154,.25), 0 0 30px rgba(98,242,154,.1);
}

.match-meta {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: .80rem;
  margin-bottom: 8px;
}

.match-meta > :first-child { color: var(--primary); font-weight: 900; }

.match-meta > :last-child {
  justify-self: end;
  text-align: right;
  min-width: 0;
}

.match-team {
  display: grid !important;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .9rem;
}

.match-team.winner {
  background: rgba(98,242,154,.16);
  border-color: rgba(98,242,154,.4);
}

.match-team.pending-slot {
  opacity: .96;
}

.match-team .code {
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
  line-height: 1.1;
}

.match-team.pending-slot .code {
  font-size: .88rem;
}

.match-team span:last-child {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.match-team + .versus {
  margin: 5px 0;
}

.versus {
  text-align: center;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  font-weight: 900;
}

.match-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
  margin-top: 9px;
}

.admin-match-actions {
  display: block !important;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.admin-match-actions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: var(--primary);
  background: rgba(98,242,154,.08);
  border: 1px solid rgba(98,242,154,.22);
  border-radius: 11px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 900;
  list-style: none;
}

.admin-match-actions summary::-webkit-details-marker { display: none; }
.admin-match-actions summary span { transition: transform .15s ease; }
.admin-match-actions[open] summary span { transform: rotate(180deg); }
.admin-actions-body { display: grid; gap: 7px; padding-top: 8px; }

.admin-match-actions .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-match-actions button {
  flex: 0 0 auto;
}

.bracket-host.bracket-fullscreen {
  position: fixed;
  inset: 8px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: #07130f;
  border: 1px solid rgba(98,242,154,.3);
  border-radius: 20px;
  box-shadow: 0 30px 120px rgba(0,0,0,.8);
}

.bracket-host.bracket-fullscreen .bracket-toolbar { flex: 0 0 auto; }
.bracket-host.bracket-fullscreen .bracket-viewport { flex: 1 1 auto; height: auto; min-height: 0; }
body.bracket-view-open { overflow: hidden; }


.live-score-placeholder, .empty, .empty-scoreboard { color: var(--muted); background: rgba(0,0,0,.2); border: 1px dashed var(--line); padding: 18px; border-radius: 18px; text-align: center; }
.live-score-mini { display: grid; gap: 10px; }
.padel-score-table {
  --set-col: 56px;
  --points-col: 76px;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: #06100d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.padel-score-head,
.padel-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, var(--set-col)) var(--points-col);
  align-items: stretch;
}

.padel-score-head {
  color: var(--muted);
  background: rgba(255,255,255,.045);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

.padel-score-head span {
  display: grid;
  min-height: 30px;
  padding: 7px 5px;
  place-items: center;
  border-left: 1px solid rgba(255,255,255,.08);
}

.padel-score-head .team-heading {
  justify-items: start;
  padding-left: 14px;
  border-left: 0;
}

.padel-score-row + .padel-score-row { border-top: 1px solid rgba(255,255,255,.12); }
.padel-score-row .team-name,
.score-cell { min-height: 58px; }
.padel-score-row .team-name {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 14px;
  overflow-wrap: anywhere;
  font-weight: 900;
  line-height: 1.2;
}

.score-cell {
  display: grid;
  place-items: center;
  color: #f7fff9;
  border-left: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
}

.score-cell.set-score { background: rgba(255,255,255,.055); }
.score-cell.set-score.current-set {
  color: var(--primary);
  background: rgba(98,242,154,.11);
  box-shadow: inset 0 -3px 0 rgba(98,242,154,.65);
}
.score-cell.points {
  color: #07130f;
  background: linear-gradient(145deg, var(--primary), #b8ffd1);
  font-size: 1.7rem;
  text-shadow: 0 1px rgba(255,255,255,.22);
}

.tie-break-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  color: #07130f;
  background: linear-gradient(135deg, var(--warning), #ff9f43);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(248,217,111,.15);
}

.tie-break-banner strong { font-size: .88rem; letter-spacing: .13em; }
.tie-break-banner span { font-size: .78rem; font-weight: 800; text-align: right; }
.tie-break-banner.big { padding: 14px 18px; border-radius: 18px; }
.tie-break-banner.big strong { font-size: clamp(1rem, 2vw, 1.5rem); }
.tie-break-banner.big span { font-size: clamp(.85rem, 1.5vw, 1.1rem); }

.padel-score-table.is-tie-break .score-cell.points {
  color: #07130f;
  background: linear-gradient(135deg, var(--warning), #ff9f43);
  box-shadow: 0 0 24px rgba(248,217,111,.17);
}

.tie-break-inline { display: inline-block; margin-top: 5px; color: var(--warning); letter-spacing: .08em; }

.tie-break-launch,
.tie-break-admin-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  margin-bottom: 12px;
  background: rgba(248,217,111,.06);
  border: 1px solid rgba(248,217,111,.2);
  border-radius: 16px;
}

.tie-break-launch > div,
.tie-break-admin-title { display: grid; gap: 3px; }
.tie-break-launch strong,
.tie-break-admin-title strong { color: var(--warning); }
.tie-break-launch span,
.tie-break-admin-title span { color: var(--muted); font-size: .8rem; }
.tie-break-launch.ready { background: rgba(248,217,111,.12); border-color: rgba(248,217,111,.42); }

.tie-break-admin-panel { display: grid; align-items: stretch; }
.tie-break-control-grid { margin: 0; }
.tie-break-admin-panel > .danger { justify-self: start; }

.advantage-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.advantage-mode.active {
  background: rgba(98,242,154,.08);
  border-color: rgba(98,242,154,.35);
}

.advantage-mode > div { display: grid; gap: 3px; }
.advantage-mode strong { color: var(--primary); }
.advantage-mode span { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.score-utility-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 12px; }

.scoreboard-view.active { display: grid; min-height: calc(100vh - 150px); place-items: center; }
.scoreboard-panel { width: min(1100px, 96vw); background: radial-gradient(circle at top, rgba(98,242,154,.17), rgba(255,255,255,.06)); border: 1px solid var(--line); border-radius: 34px; padding: clamp(22px, 4vw, 48px); box-shadow: var(--shadow); }
.scoreboard-label { color: var(--primary); text-transform: uppercase; letter-spacing: .18em; font-weight: 900; }
.scoreboard-panel h2 { font-size: clamp(2rem, 6vw, 5.5rem); margin-top: 8px; }
.scoreboard-meta { color: var(--muted); font-size: clamp(1rem, 2vw, 1.5rem); margin: 10px 0 28px; }
.scoreboard-content { display: grid; gap: 18px; }
.padel-score-table.big {
  --set-col: clamp(70px, 9vw, 112px);
  --points-col: clamp(92px, 12vw, 144px);
  border-radius: 24px;
}
.padel-score-table.big .padel-score-head { font-size: clamp(.7rem, 1.2vw, 1rem); }
.padel-score-table.big .padel-score-head span { min-height: 42px; padding: 10px 7px; }
.padel-score-table.big .padel-score-row .team-name,
.padel-score-table.big .score-cell { min-height: clamp(82px, 11vw, 132px); }
.padel-score-table.big .padel-score-row .team-name { padding: 16px clamp(16px, 2vw, 26px); font-size: clamp(1.25rem, 3vw, 2.8rem); }
.padel-score-table.big .score-cell { font-size: clamp(2.2rem, 5vw, 4.7rem); }
.padel-score-table.big .score-cell.points { font-size: clamp(2.6rem, 6vw, 5.6rem); }

.login-card { max-width: 680px; margin: 0 auto; }
.admin-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }
.category-editor { margin-top: 14px; }
.list { display: grid; gap: 10px; max-height: 540px; overflow: auto; padding-right: 4px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); background: rgba(0,0,0,.18); border-radius: 16px; }
.list-item div:first-child { display: grid; gap: 3px; }
.list-item span, .list-item small { color: var(--muted); }
.pair-item strong { font-size: 1.25rem; color: var(--primary); }
.live-control-card { min-height: 360px; }
.admin-live-score { display: grid; gap: 10px; margin: 12px 0; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.score-help { margin: -2px 0 12px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.link-boxes { display: grid; gap: 12px; }
.link-boxes div { background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.link-boxes span { color: var(--primary); word-break: break-all; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 440px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 50; background: #102d23; color: var(--text); }
.toast.ok { border-color: rgba(98,242,154,.45); }
.toast.error { border-color: rgba(255,107,107,.6); color: #ffd0d0; }

.court-dialog {
  width: min(560px, calc(100% - 28px));
  color: var(--text);
  background: linear-gradient(180deg, #123126, #091a14);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 30px 100px rgba(0,0,0,.65);
}

.court-dialog::backdrop {
  background: rgba(2,8,6,.78);
  backdrop-filter: blur(5px);
}

.court-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
}

.court-match-summary {
  background: rgba(0,0,0,.22);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.court-match-summary strong { color: var(--text); }

.court-status {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.court-status.ok {
  color: #caffdc;
  background: rgba(98,242,154,.09);
  border-color: rgba(98,242,154,.3);
}

.court-status.conflict {
  color: #ffe8aa;
  background: rgba(248,217,111,.1);
  border-color: rgba(248,217,111,.34);
}

.court-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
}

@media (max-width: 1300px) {
  .round {
    flex-basis: 286px;
    width: 286px;
    min-width: 286px;
  }
}

@media (max-width: 900px) {
  .topbar, .admin-banner { align-items: stretch; flex-direction: column; }
  .topnav { justify-content: stretch; }
  .topnav a { flex: 1; text-align: center; }
  .session-controls { justify-content: space-between; }
  .grid.two, .two-col { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; }
  .list-item { align-items: flex-start; flex-direction: column; }
  .padel-score-table {
    --set-col: clamp(38px, 11vw, 48px);
    --points-col: clamp(52px, 15vw, 66px);
  }
  .padel-score-head { font-size: .58rem; letter-spacing: .04em; }
  .padel-score-head span { min-height: 27px; padding: 6px 2px; }
  .padel-score-head .team-heading { padding-left: 10px; }
  .padel-score-row .team-name, .score-cell { min-height: 52px; }
  .padel-score-row .team-name { padding: 8px 10px; font-size: .82rem; }
  .score-cell { font-size: 1.15rem; }
  .score-cell.points { font-size: 1.35rem; }
  .padel-score-table.big {
    --set-col: clamp(44px, 12vw, 62px);
    --points-col: clamp(58px, 17vw, 82px);
  }
  .padel-score-table.big .padel-score-row .team-name { font-size: clamp(.9rem, 4vw, 1.25rem); }
  .padel-score-table.big .score-cell { font-size: clamp(1.5rem, 7vw, 2.4rem); }
  .padel-score-table.big .score-cell.points { font-size: clamp(1.8rem, 8vw, 2.8rem); }
  .control-grid { grid-template-columns: 1fr; }
  .tie-break-banner, .tie-break-launch, .advantage-mode { align-items: stretch; flex-direction: column; }
  .tie-break-banner span { text-align: left; }

  .bracket-toolbar { align-items: stretch; flex-direction: column; }
  .bracket-summary { justify-content: space-between; }
  .bracket-tools { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .bracket-tool { flex: 0 0 auto; }
  .bracket-viewport { height: 64vh; min-height: 430px; border-radius: 16px; }
  .bracket-board { gap: 12px; }
  .round {
    flex-basis: 268px;
    min-width: 268px;
    width: 268px;
    padding: 8px;
  }
  .round-stage-head { min-height: 68px; padding: 9px; }
  .match-card { padding: 10px; }
  .bracket-pan-hint { font-size: .66rem; }
  .bracket-host.bracket-fullscreen { inset: 4px; padding: 6px; border-radius: 16px; }
}

/* --------------------------------------------------------------------------
   Pádel El Encuentro · identidad visual V1.4
   -------------------------------------------------------------------------- */

:root {
  --bg: #eef0e9;
  --panel: #ffffff;
  --panel-2: #f5f6f1;
  --card: #ffffff;
  --card-strong: #f7f8f3;
  --text: #141511;
  --muted: #6f736a;
  --line: #daddd3;
  --primary: #98d900;
  --primary-dark: #6fa700;
  --warning: #f3bd21;
  --danger: #d93d3d;
  --ink: #11120f;
  --ink-soft: #20221d;
  --paper: #f7f8f3;
  --shadow: 0 18px 46px rgba(24, 28, 17, .09);
  --radius: 24px;
}

html { scroll-behavior: smooth; }

html,
body {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(152, 217, 0, .13), transparent 24rem),
    var(--bg);
  font-family: "Arial Narrow", "Roboto Condensed", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .35;
  pointer-events: none;
  background-image: radial-gradient(rgba(17, 18, 15, .18) .7px, transparent .7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  padding: 16px 0 54px;
}

.topbar {
  min-height: 78px;
  padding: 10px 12px 10px 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(17, 18, 15, .11);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(24, 28, 17, .09);
  backdrop-filter: blur(18px);
}

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

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

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 13px;
  border-left: 1px solid var(--line);
}

.brand-copy small {
  color: var(--primary-dark);
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.brand-copy strong {
  max-width: 310px;
  overflow: hidden;
  font-size: .95rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav {
  padding: 5px;
  gap: 3px;
  background: #f0f2eb;
  border: 1px solid #e1e4da;
  border-radius: 13px;
}

.topnav a,
.admin-tabs button {
  padding: 10px 16px;
  color: #565a51;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 800;
}

.topnav a:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }

.topnav a.active,
.admin-tabs button.active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 5px 15px rgba(17, 18, 15, .17);
}

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

.view { margin-top: 16px; }

.tournament-hero {
  position: relative;
  display: grid;
  min-height: 370px;
  margin-bottom: 18px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 81% 42%, rgba(152, 217, 0, .20), transparent 24%),
    linear-gradient(120deg, #11120f 0%, #1b1d18 68%, #0d0e0c 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(18, 20, 14, .20);
}

.tournament-hero::before,
.tournament-hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.tournament-hero::before {
  top: -170px;
  right: -50px;
  width: 560px;
  height: 560px;
  border: 2px solid rgba(152, 217, 0, .24);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(152, 217, 0, .035), 0 0 0 112px rgba(152, 217, 0, .025);
}

.tournament-hero::after {
  right: 0;
  bottom: 0;
  width: 54%;
  height: 7px;
  background: var(--primary);
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(680px, 68%);
  padding: clamp(34px, 6vw, 76px);
}

.hero-copy .eyebrow { color: var(--primary); }

.hero-copy h2 {
  max-width: 660px;
  font-size: clamp(2.65rem, 6.4vw, 6.5rem);
  font-stretch: condensed;
  font-weight: 1000;
  letter-spacing: -.065em;
  line-height: .83;
  text-transform: uppercase;
}

.hero-copy h2 span { color: var(--primary); }

.hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin-top: 22px;
  color: #c7cbc0;
  font-size: clamp(.95rem, 1.7vw, 1.15rem);
  line-height: 1.55;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 12px 17px;
  color: var(--ink);
  background: var(--primary);
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero-action span { font-size: 1.05rem; }

.hero-mark {
  position: absolute;
  right: clamp(24px, 7vw, 110px);
  bottom: clamp(28px, 5vw, 68px);
  display: grid;
  justify-items: end;
  z-index: 1;
}

.hero-ball {
  position: relative;
  width: clamp(116px, 17vw, 230px);
  aspect-ratio: 1;
  border: clamp(18px, 2.5vw, 34px) solid var(--primary);
  border-radius: 50%;
  opacity: .92;
  transform: rotate(-18deg);
}

.hero-ball::before,
.hero-ball::after {
  position: absolute;
  inset: 14% -18%;
  content: "";
  border: clamp(7px, 1vw, 13px) solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
}

.hero-ball::after { transform: rotate(180deg); }

.hero-word {
  margin-top: -12px;
  color: rgba(255, 255, 255, .08);
  font-size: clamp(3rem, 8vw, 8.5rem);
  font-weight: 1000;
  letter-spacing: -.08em;
  line-height: .8;
}

.card {
  color: var(--text);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(17, 18, 15, .11);
  box-shadow: var(--shadow);
}

.card-head { margin-bottom: 18px; }
.card h2 { color: var(--ink); font-weight: 950; }
.eyebrow { color: var(--primary-dark); }
.hint,
label,
.session-identity { color: var(--muted); }

button {
  color: var(--ink);
  background: #eef0e9;
  border-color: #daddd3;
  border-radius: 10px;
  font-weight: 750;
}

button:hover:not(:disabled) { background: #e5e8de; }

button.primary {
  color: var(--ink);
  background: var(--primary);
  box-shadow: 0 7px 18px rgba(111, 167, 0, .18);
}

button.secondary {
  color: #507a00;
  background: rgba(152, 217, 0, .12);
  border-color: rgba(111, 167, 0, .28);
}

button.danger {
  color: #ad2424;
  background: #fff0f0;
  border-color: #f1bcbc;
}

input,
select {
  color: var(--ink);
  background: #f7f8f3;
  border-color: #d8dcd1;
  border-radius: 10px;
}

input:focus,
select:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(152, 217, 0, .17);
}

select option { color: var(--ink); background: #fff; }

.muted-block,
.list-item,
.link-boxes div,
.live-score-placeholder,
.empty,
.empty-scoreboard {
  color: var(--muted);
  background: #f4f6f0;
  border-color: #daddd3;
}

.live-card {
  color: #fff;
  background: linear-gradient(135deg, #171814, #242720);
  border-color: rgba(255, 255, 255, .08);
}

.live-card h2 { color: #fff; }
.live-card .live-score-placeholder { color: #989e91; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14); }

.badge {
  color: #60655a;
  background: #e9ece4;
}

.badge.live { color: var(--ink); background: var(--primary); }
.badge.completed,
.badge.bye { color: #fff; background: #343832; }
.badge.ready { color: var(--ink); background: var(--warning); }

.fixture-shell {
  padding: clamp(16px, 2vw, 28px);
  background: #fff;
}

.fixture-shell > .card-head {
  align-items: end;
  padding: 2px 4px 4px;
}

.fixture-shell > .card-head h2 {
  font-size: clamp(1.8rem, 3.3vw, 3.2rem);
  line-height: .95;
  text-transform: uppercase;
}

.bracket-toolbar {
  padding: 10px;
  color: #fff;
  background: #11120f;
  border-color: #292b26;
  border-radius: 12px;
}

.bracket-summary strong { color: #fff; letter-spacing: .05em; text-transform: uppercase; }
.bracket-summary span,
.bracket-zoom-label { color: #92978d; }

.bracket-tool {
  color: #d8dcd3;
  background: #22241f;
  border-color: #343730;
  border-radius: 8px;
}

.bracket-tool:hover:not(:disabled) { color: var(--ink); background: var(--primary); }
.bracket-tool.fullscreen-tool { color: var(--primary); border-color: rgba(152, 217, 0, .38); }

.bracket-viewport {
  height: clamp(650px, 78vh, 980px);
  min-height: 650px;
  background:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px),
    radial-gradient(circle at 50% 30%, #282b24, #151713 72%);
  background-size: 32px 32px, 32px 32px, auto;
  border-color: #10110e;
  border-radius: 18px;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .28);
}

.bracket-board {
  --bracket-card-height: 160px;
  --connector-span: 19px;
  gap: 22px;
  padding: 14px;
}

.admin-board { --bracket-card-height: 248px; }

.round {
  position: relative;
  flex-basis: 276px;
  width: 276px;
  min-width: 276px;
  padding: 8px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.round-stage-head {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  padding: 8px 11px;
  color: #fff;
  background: rgba(17, 18, 15, .94);
  border-color: rgba(255, 255, 255, .12);
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(9px);
}

.round-stage-head h3 { color: #fff; font-size: .88rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.round-stage-head small { color: #8e9587; font-size: .72rem; font-weight: 900; }

.linear-board .round:last-child .round-stage-head,
.final-round .round-stage-head {
  color: var(--ink);
  background: var(--primary);
  border-color: var(--primary);
}

.linear-board .round:last-child .round-stage-head h3,
.linear-board .round:last-child .round-stage-head small,
.final-round .round-stage-head h3,
.final-round .round-stage-head small { color: var(--ink); }

.round-matches {
  position: relative;
  z-index: 1;
  gap: var(--round-gap, 18px);
}

.match-card {
  position: relative;
  z-index: 2;
  height: var(--bracket-card-height);
  min-height: var(--bracket-card-height);
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border-color: #dfe2d8;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

.admin-board .match-card { height: auto; min-height: var(--bracket-card-height); }

.match-card::after,
.match-card::before {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.linear-board .round:not(:first-child) .match-card::before,
.mirrored-board .side-left:not(.outermost) .match-card::before,
.mirrored-board .side-right:not(.innermost) .match-card::before,
.mirrored-board .final-round .match-card::before {
  top: 50%;
  left: calc(var(--connector-span) * -1);
  width: var(--connector-span);
  border-top: 2px solid rgba(152, 217, 0, .72);
}

.linear-board .round:not(:last-child) .match-card:nth-child(odd)::after,
.mirrored-board .side-left:not(.innermost) .match-card:nth-child(odd)::after,
.mirrored-board .side-right:not(.outermost) .match-card:nth-child(odd)::after {
  top: 50%;
  right: calc(var(--connector-span) * -1);
  width: var(--connector-span);
  height: calc((var(--round-gap) + var(--bracket-card-height)) / 2);
  border-top: 2px solid rgba(152, 217, 0, .72);
  border-right: 2px solid rgba(152, 217, 0, .72);
  border-radius: 0 7px 0 0;
}

.linear-board .round:not(:last-child) .match-card:nth-child(even)::after,
.mirrored-board .side-left:not(.innermost) .match-card:nth-child(even)::after,
.mirrored-board .side-right:not(.outermost) .match-card:nth-child(even)::after {
  right: calc(var(--connector-span) * -1);
  bottom: 50%;
  width: var(--connector-span);
  height: calc((var(--round-gap) + var(--bracket-card-height)) / 2);
  border-right: 2px solid rgba(152, 217, 0, .72);
  border-bottom: 2px solid rgba(152, 217, 0, .72);
  border-radius: 0 0 7px 0;
}

.mirrored-board .side-left.innermost .match-card::after,
.mirrored-board .final-round .match-card::after {
  top: 50%;
  right: calc(var(--connector-span) * -1);
  width: var(--connector-span);
  border-top: 2px solid rgba(152, 217, 0, .72);
}

.mirrored-board .side-right.innermost .match-card::before {
  top: 50%;
  left: calc(var(--connector-span) * -1);
  width: var(--connector-span);
  border-top: 2px solid rgba(152, 217, 0, .72);
}

.mirrored-board .final-round {
  width: 298px;
  min-width: 298px;
  flex-basis: 298px;
}

.final-identity {
  position: absolute;
  top: 104px;
  left: 36px;
  right: 36px;
  display: grid;
  height: 108px;
  place-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(152, 217, 0, .55);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
}

.final-identity img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.bracket-placeholder {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.bracket-placeholder > * { visibility: hidden; }

.match-card.completed { border-color: #aeb5a8; }

.match-card.live {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(152, 217, 0, .22), 0 14px 34px rgba(0, 0, 0, .28);
}

.match-meta {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  color: #72776d;
}
.match-meta > :first-child { color: var(--primary-dark); }
.match-meta .badge { justify-self: end; padding: 4px 7px; font-size: .61rem; }

.match-team {
  min-height: 47px;
  color: var(--ink);
  background: #f2f4ee;
  border-color: #e0e3da;
  border-radius: 8px;
}

.match-team.winner {
  background: rgba(152, 217, 0, .24);
  border-color: rgba(111, 167, 0, .46);
  box-shadow: inset 4px 0 0 var(--primary);
}

.match-team .code { color: #598500; }
.versus { color: #8c9187; }
.match-footer { color: #73786e; }

.public-board .match-card {
  padding: 9px;
  color: #fff;
  background: #171815;
  border-color: #30332d;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.public-board .match-meta {
  height: 25px;
  margin-bottom: 5px;
  color: #8d9388;
  font-size: .7rem;
}

.public-board .match-meta > :first-child { color: #c2c8bc; }
.public-board .match-meta .badge { color: #c8cdc2; background: #2a2c27; }
.public-board .match-meta .badge.live { color: var(--ink); background: var(--primary); }

.public-board .match-team {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 46px;
  padding: 7px 9px;
  color: #d3d7cf;
  background: #20221e;
  border: 0;
  border-radius: 0;
  font-size: .79rem;
}

.public-board .match-team + .versus { display: none; }
.public-board .match-team + .versus + .match-team { border-top: 1px solid #30332d; }
.public-board .match-team .code { color: #949a8f; }

.public-board .match-team.winner {
  color: var(--primary);
  background: rgba(152, 217, 0, .17);
  border: 0;
  box-shadow: inset 3px 0 0 var(--primary);
  font-weight: 900;
}

.public-board .match-team.winner .code { color: var(--primary); }
.public-board .match-footer { min-height: 17px; margin-top: 5px; color: #aeb4a9; font-size: .7rem; }

.admin-match-actions { border-top-color: #e0e3da; }
.admin-match-actions summary { color: #517a00; background: #f1f7e4; border-color: #d8e8b7; }

.bracket-pan-hint {
  color: #c0c6b9;
  background: rgba(17, 18, 15, .90);
  border-color: rgba(255, 255, 255, .14);
}

.bracket-host.bracket-fullscreen {
  inset: 10px;
  padding: 10px;
  background: #090a08;
  border-color: #343730;
  border-radius: 12px;
}

.bracket-host.bracket-fullscreen .bracket-toolbar {
  min-height: 54px;
  margin-bottom: 8px;
  border-radius: 7px;
}

.bracket-host.bracket-fullscreen .bracket-viewport {
  border-color: #292b26;
  border-radius: 7px;
}

.padel-score-table { background: var(--ink); border-color: #34372f; }
.padel-score-head { color: #9fa598; background: #1d1f1a; }
.padel-score-row .team-name { color: #fff; }
.score-cell { color: #fff; border-left-color: #34372f; background: #22251f; }
.score-cell.set-score { background: #22251f; }
.score-cell.set-score.current-set { color: var(--primary); background: rgba(152, 217, 0, .10); box-shadow: inset 0 -3px 0 var(--primary); }
.score-cell.points { color: var(--ink); background: var(--primary); }

.scoreboard-view.active { min-height: calc(100vh - 118px); }
.scoreboard-panel {
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(152, 217, 0, .16), transparent 32%),
    linear-gradient(145deg, #11120f, #20231d);
  border-color: rgba(255, 255, 255, .10);
}
.scoreboard-panel h2 { color: #fff; }
.scoreboard-label { color: var(--primary); }
.scoreboard-meta { color: #a6aca0; }

.admin-banner,
.admin-tabs { color: var(--ink); }

.admin-tabs {
  padding: 6px;
  background: rgba(255, 255, 255, .66);
  border: 1px solid #daddd3;
  border-radius: 14px;
}

.pair-item strong,
.link-boxes span { color: #5f8e00; }

.toast { color: var(--ink); background: #fff; border-color: #daddd3; }
.toast.ok { border-color: var(--primary-dark); }
.toast.error { color: #a32121; border-color: #e87b7b; }

.court-dialog {
  color: var(--text);
  background: #fff;
  border-color: #daddd3;
}

.court-dialog::backdrop { background: rgba(13, 14, 12, .72); }
.court-match-summary,
.court-status { color: var(--muted); background: #f4f6f0; border-color: #daddd3; }
.court-match-summary strong { color: var(--ink); }

@media (max-width: 1080px) {
  .brand-copy { display: none; }
  .hero-copy { width: 74%; }
}

@media (max-width: 900px) {
  .app-shell { width: min(100% - 18px, 1480px); padding-top: 9px; }
  .topbar { align-items: center; flex-direction: row; flex-wrap: wrap; padding: 8px 9px 8px 13px; }
  .brand { flex: 1 1 auto; }
  .brand img { width: 112px; height: 48px; }
  .topnav { order: 3; width: 100%; }
  .topnav a { padding: 10px 8px; }
  .session-controls { flex: 1 0 100%; order: 4; }

  .tournament-hero { min-height: 440px; border-radius: 22px; }
  .hero-copy { align-self: end; width: 100%; padding: 32px 24px 34px; }
  .hero-copy h2 { font-size: clamp(2.8rem, 14vw, 5.4rem); }
  .hero-copy > p:not(.eyebrow) { max-width: 90%; }
  .hero-mark { top: 34px; right: 24px; bottom: auto; opacity: .68; }
  .hero-word { display: none; }
  .hero-ball { width: 108px; border-width: 17px; }

  .fixture-shell { padding: 12px; }
  .fixture-shell > .card-head { padding: 5px 7px; }
  .bracket-viewport { height: 72vh; min-height: 570px; border-radius: 13px; }
  .bracket-board { gap: 18px; padding: 8px; --connector-span: 16px; }
  .round { flex-basis: 258px; min-width: 258px; width: 258px; padding: 6px; }
  .round-stage-head { min-height: 62px; }
}

@media (max-width: 540px) {
  .topbar { top: 6px; border-radius: 15px; }
  .brand img { width: 102px; }
  .topnav a { font-size: .75rem; }
  .tournament-hero { min-height: 410px; }
  .hero-copy { padding: 26px 20px 28px; }
  .hero-copy h2 { letter-spacing: -.075em; }
  .hero-action { width: 100%; justify-content: space-between; }
  .card { padding: 16px; border-radius: 18px; }
  .bracket-summary { width: 100%; }
  .bracket-tools { width: 100%; }
}
