:root {
  color-scheme: light;
  --ink: #15211d;
  --muted: #6f7d77;
  --line: #e3e9e6;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #1f7a5a;
  --green-dark: #135d43;
  --green-soft: #e3f3eb;
  --lime: #ccec72;
  --orange: #f47b45;
  --red: #c94a4a;
  --shadow: 0 18px 50px rgba(23, 53, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 0%, rgba(204, 236, 114, 0.22), transparent 25rem),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px;
  color: #fff;
  background: #173b2f;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 34px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #173b2f;
  font-weight: 800;
  border-radius: 14px;
  background: var(--lime);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: #a9c0b7;
  font-size: 11px;
}

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

.nav-button {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  color: #b8c9c3;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  color: #bdd0c9;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.main {
  width: 100%;
  max-width: 1440px;
  padding: 38px 44px 64px;
}

.topbar,
.section-heading,
.inline-actions,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 32px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.subtitle,
.muted {
  color: var(--muted);
}

.subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.btn:hover {
  border-color: #c4d0cb;
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.btn.primary:hover {
  background: var(--green-dark);
}

.btn.soft {
  color: var(--green-dark);
  border-color: transparent;
  background: var(--green-soft);
}

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

.btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

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

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 34px;
}

.stat-card,
.card,
.tournament-card,
.match-card,
.wizard-card {
  border: 1px solid rgba(214, 224, 219, 0.86);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 138px;
  padding: 22px;
  border-radius: 18px;
}

.stat-card strong {
  display: block;
  margin: 16px 0 2px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  background: var(--green-soft);
}

.section-heading {
  margin: 32px 0 16px;
}

.section-heading p {
  margin: 0;
}

.tournament-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-fixtures {
  grid-template-columns: 1fr;
  max-width: 1050px;
}

.tennis-fixture {
  display: grid;
  gap: 16px;
}

.tennis-fixture h2 {
  font-size: 18px;
}

.tennis-score-head,
.tennis-score-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, 72px);
  gap: 8px;
  align-items: center;
}

.tennis-score-head {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.tennis-score-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tennis-set-input {
  width: 72px;
  height: 48px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.match-finish-bar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  max-width: 1050px;
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid #cfe4da;
  border-radius: 16px;
  background: var(--green-soft);
}

.match-finish-bar p {
  margin: 0;
}

.match-rating-result {
  max-width: 760px;
  margin-top: 22px;
}

.tournament-card {
  padding: 22px;
  border-radius: 18px;
}

.tournament-card-title {
  margin-top: 18px;
}

.tournament-card:hover {
  border-color: #b9c9c2;
}

.tournament-card-actions {
  justify-content: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--green-soft);
}

.badge.orange {
  color: #a54117;
  background: #fff0e8;
}

.badge.gray {
  color: #62706a;
  background: #edf1ef;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 52px 24px;
  text-align: center;
  border: 1px dashed #cbd6d1;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
}

.empty-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--green);
  font-size: 24px;
  border-radius: 18px;
  background: var(--green-soft);
}

.wizard-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.step {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #94a09b;
  font-size: 12px;
  font-weight: 700;
}

.step::before {
  content: attr(data-step);
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #dce4e0;
  border-radius: 50%;
  background: #fff;
}

.step.active,
.step.done {
  color: var(--green-dark);
}

.step.active::before {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.step.done::before {
  content: "✓";
  border-color: var(--green-soft);
  background: var(--green-soft);
}

.wizard-card,
.card {
  padding: 28px;
  border-radius: 22px;
}

.choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.choice {
  position: relative;
  padding: 24px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.choice:hover,
.choice.selected {
  border-color: var(--green);
}

.choice.selected {
  background: linear-gradient(145deg, #fff, #eef8f3);
}

.choice-tag {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  margin-bottom: 22px;
  place-items: center;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  border-radius: 12px;
  background: var(--green-soft);
}

.choice p {
  min-height: 42px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.location-field {
  position: relative;
}

.location-suggestions {
  position: absolute;
  z-index: 15;
  top: 78px;
  right: 0;
  left: 0;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d9e1dd;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(23, 53, 42, 0.16);
}

.location-suggestions.open {
  display: grid;
  gap: 3px;
}

.location-suggestion {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  color: var(--ink);
  text-align: left;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.location-suggestion:hover,
.location-suggestion:focus-visible {
  background: var(--green-soft);
}

.location-suggestion.custom {
  margin-top: 3px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 9px 9px;
}

.location-suggestion strong {
  font-size: 12px;
}

.location-suggestion span,
.location-no-results {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.location-no-results {
  padding: 11px;
}

.field input,
.field select,
.field textarea,
.score-input,
.lineup-select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid #d9e1dd;
  outline: 0;
  border-radius: 11px;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.score-input:focus,
.lineup-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.1);
}

.field textarea {
  min-height: 112px;
  padding: 13px 14px;
  line-height: 1.5;
  resize: vertical;
}

.tournament-rules-preview,
.tournament-rule-note {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 15px 17px;
  color: var(--green-dark);
  border: 1px solid #cfe4da;
  border-radius: 13px;
  background: var(--green-soft);
}

.tournament-rules-preview small,
.tournament-rule-note strong {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tournament-rules-preview strong,
.tournament-rule-note span {
  font-size: 12px;
  line-height: 1.55;
}

.tournament-description {
  white-space: pre-line;
}

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

.chip {
  min-width: 52px;
  height: 42px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.chip.selected {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.player-toolbar {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 10px;
  margin: 24px 0 16px;
}

.player-toolbar input {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 11px;
}

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

.player-link {
  padding: 0;
  color: var(--ink);
  text-align: left;
  border: 0;
  background: transparent;
}

.player-link:hover {
  color: var(--green);
}

.player-row {
  display: grid;
  grid-template-columns: 36px 1fr 90px 38px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.player-row.pair-row {
  grid-template-columns: 36px 1fr 1fr;
}

.player-select-content {
  flex: 1;
  text-align: left;
}

.player-number,
.avatar {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  background: var(--green-soft);
}

.player-number {
  width: 32px;
  height: 32px;
}

.avatar {
  width: 36px;
  height: 36px;
  color: var(--green-dark);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.icon-button:hover {
  color: var(--red);
  background: #fff0f0;
}

.notice {
  margin-top: 16px;
  padding: 13px 15px;
  color: #5d6a65;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 11px;
  background: #f1f5f3;
}

.notice.warning {
  color: #7d4d1b;
  background: #fff6e9;
}

.tournament-header {
  padding: 26px;
  border-radius: 22px;
  background:
    linear-gradient(120deg, rgba(204, 236, 114, 0.18), transparent 50%),
    #173b2f;
  color: #fff;
  box-shadow: var(--shadow);
}

.tournament-header .muted {
  color: #b9cbc4;
}

.tournament-header .eyebrow {
  color: var(--lime);
}

.header-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 24px;
}

.header-stats strong,
.header-stats span {
  display: block;
}

.header-stats strong {
  font-size: 18px;
}

.header-stats span {
  margin-top: 3px;
  color: #b9cbc4;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 22px 0;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.tab {
  min-width: max-content;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.tab.active {
  color: #fff;
  background: var(--green);
}

.match-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.match-card {
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(23, 53, 42, 0.07);
}

.court-label {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.court-title {
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 800;
}

.padel-court {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  min-height: 176px;
  margin: 12px 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid #c9ddd5;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(31, 122, 90, 0.035) 50%, transparent 50%),
    #f7fbf9;
  box-shadow: inset 0 0 0 4px #edf6f2;
}

.padel-court::before,
.padel-court::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 1px;
  background: #dcebe5;
}

.padel-court::before {
  left: 18%;
}

.padel-court::after {
  right: 18%;
}

.court-net {
  position: absolute;
  z-index: 3;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 8px;
  transform: translateX(-50%);
  border-right: 2px solid rgba(19, 93, 67, 0.3);
  border-left: 2px solid rgba(19, 93, 67, 0.3);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(19, 93, 67, 0.3) 0 2px,
      transparent 2px 6px
    ),
    rgba(255, 255, 255, 0.7);
}

.court-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
}

.court-side.top {
  grid-column: 1;
}

.court-side.bottom {
  grid-column: 3;
}

.court-players {
  display: grid;
  gap: 7px;
  align-items: center;
  width: 100%;
}

.court-player {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  color: var(--ink);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #dce8e3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(10, 50, 36, 0.06);
}

.court-player small {
  display: none;
}

.court-team-rating {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.court-score {
  position: relative;
  z-index: 4;
}

.court-score .score-input {
  width: 52px;
  height: 42px;
  color: var(--ink);
  border: 1px solid #c8d8d1;
  background: #fff;
  box-shadow: 0 5px 12px rgba(10, 50, 36, 0.08);
}

.team-row {
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
}

.team-row + .team-row {
  border-top: 1px solid var(--line);
}

.team-names {
  font-weight: 800;
}

.team-rating {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.score-input {
  height: 46px;
  padding: 0 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

.score-input:disabled {
  color: var(--ink);
  opacity: 1;
  background: #f4f7f5;
}

.match-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.lineup-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.lineup-select {
  height: 38px;
  font-size: 11px;
}

.round-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.round-actions.spread {
  justify-content: space-between;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: #f7f9f8;
}

td {
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  border-radius: 9px;
  background: #edf2ef;
}

tr:nth-child(1) .rank {
  color: #5d4a00;
  background: #f7e69a;
}

.rating-up {
  color: var(--green);
  font-weight: 800;
}

.rating-down {
  color: var(--red);
  font-weight: 800;
}

.profile-hero {
  padding: 26px;
  border: 1px solid rgba(214, 224, 219, 0.86);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0%, rgba(204, 236, 114, 0.3), transparent 18rem),
    #fff;
  box-shadow: var(--shadow);
}

.profile-back {
  margin-bottom: 24px;
}

.profile-identity {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  color: var(--green-dark);
  font-size: 22px;
  font-weight: 800;
  border-radius: 22px;
  background: var(--green-soft);
}

.profile-identity h1 {
  font-size: 34px;
}

.profile-rating {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 15px;
  background: #173b2f;
}

.profile-rating span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  border-radius: 10px;
  background: var(--lime);
}

.profile-rating strong {
  color: #fff;
  font-size: 24px;
}

.profile-rating small {
  grid-column: 1 / -1;
  color: #afc5bc;
  font-size: 9px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.profile-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 18px 0;
}

.profile-stat {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.profile-stat span,
.profile-stat small,
.profile-stat strong {
  display: block;
}

.profile-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-stat strong {
  margin: 9px 0 3px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.profile-stat small {
  color: var(--muted);
  font-size: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.compact-heading {
  margin-top: 0;
}

.rating-chart {
  display: flex;
  gap: 8px;
  align-items: end;
  height: 150px;
  padding: 10px 4px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.rating-bar-wrap {
  display: grid;
  min-width: 42px;
  height: 100%;
  grid-template-rows: 20px 1fr 18px;
  align-items: end;
  justify-items: center;
}

.rating-bar-value,
.rating-bar-wrap small {
  color: var(--muted);
  font-size: 9px;
}

.rating-bar {
  width: 20px;
  min-height: 28px;
  border-radius: 7px 7px 2px 2px;
  background: var(--green);
}

.rating-bar.down {
  background: var(--orange);
}

.height-30 { height: 30%; }
.height-40 { height: 40%; }
.height-50 { height: 50%; }
.height-60 { height: 60%; }
.height-70 { height: 70%; }
.height-80 { height: 80%; }
.height-90 { height: 90%; }
.height-100 { height: 100%; }

.format-stats {
  display: grid;
  gap: 18px;
}

.format-stat {
  display: grid;
  gap: 7px;
  font-size: 12px;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ef;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.width-0 { width: 0; }
.width-10 { width: 10%; }
.width-20 { width: 20%; }
.width-30 { width: 30%; }
.width-40 { width: 40%; }
.width-50 { width: 50%; }
.width-60 { width: 60%; }
.width-70 { width: 70%; }
.width-80 { width: 80%; }
.width-90 { width: 90%; }
.width-100 { width: 100%; }

.relationship-list {
  display: grid;
  gap: 7px;
}

.relationship-row {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.relationship-row:hover {
  border-color: #b7cbc2;
  background: #f8fbf9;
}

.relationship-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.sample-warning {
  padding: 4px 7px;
  color: #98501f;
  font-size: 8px;
  font-weight: 800;
  border-radius: 999px;
  background: #fff0e6;
  text-transform: uppercase;
}

.profile-history {
  margin-top: 18px;
}

.participant-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.registration-panel {
  display: grid;
  gap: 20px;
}

.registration-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.registration-toolbar {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.invite-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #cfe4da;
  border-radius: 15px;
  background: var(--green-soft);
}

.invite-panel.inactive {
  color: var(--muted);
  border-color: var(--line);
  background: #f5f7f6;
}

.invite-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--green-dark);
  border-radius: 12px;
  background: #fff;
}

.invite-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.invite-copy span {
  color: var(--muted);
  font-size: 11px;
}

.invite-copy code {
  overflow: hidden;
  color: var(--green-dark);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-landing {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
}

.invite-landing-card {
  width: min(680px, 100%);
}

.invite-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(180px, auto);
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

.invite-login .field {
  gap: 6px;
}

.invite-login .btn {
  min-height: 44px;
}

.invite-divider {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.invite-divider::before,
.invite-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.invite-register {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #cfe4da;
  border-radius: 16px;
  background: var(--green-soft);
}

.invite-register h2,
.invite-register p {
  margin: 0;
}

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

.invite-consent {
  margin: 0;
}

.invite-consent.optional {
  background: #fffdf9;
}

.inline-link {
  display: inline;
}

.invite-register-submit {
  width: 100%;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(241, 109, 55, 0.1), transparent 38%),
    var(--bg);
}

.auth-shell {
  display: grid;
  width: min(980px, 100%);
  gap: 18px;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 30px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.auth-grid.single {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.role-button {
  min-height: 54px;
  color: var(--muted);
  font-weight: 900;
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
}

.role-button.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 25px rgba(31, 122, 90, 0.18);
}

.secondary-auth-card {
  background: #f9fbfa;
}

.auth-wide {
  grid-column: 1 / -1;
}

.auth-brand {
  margin-bottom: 10px;
}

.auth-fields {
  display: grid;
  gap: 12px;
}

.auth-submit {
  width: 100%;
}

.sidebar-logout {
  margin-top: 10px;
  color: inherit;
}

.tournament-start-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid #cfe4da;
  border-radius: 16px;
  background: linear-gradient(145deg, #f7fcf9, var(--green-soft));
}

.registration-pair-list {
  display: grid;
  gap: 10px;
}

.registration-pair-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.application-row {
  display: grid;
  grid-template-columns: 40px 1fr 170px 135px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.application-row small,
.cabinet-tournament-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.application-select {
  height: 38px;
  padding: 0 9px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.payment-button {
  min-height: 36px;
  padding: 0 9px;
  color: #8e4d25;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #f0d4c2;
  border-radius: 9px;
  background: #fff7f2;
}

.payment-button.paid {
  color: var(--green-dark);
  border-color: #c6dfd4;
  background: var(--green-soft);
}

.payment-button.onsite {
  color: #6e6233;
  border-color: #e6ddb0;
  background: #fffbe7;
}

.payment-button.not-required {
  color: var(--muted);
  background: #f1f4f2;
}

.cabinet-shell {
  max-width: 980px;
  margin: 0 auto;
}

.cabinet-header {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0%, rgba(204, 236, 114, 0.25), transparent 17rem),
    #fff;
  box-shadow: var(--shadow);
}

.cabinet-player-select {
  position: absolute;
  top: 18px;
  right: 18px;
  height: 36px;
  max-width: 210px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.cabinet-nav {
  display: flex;
  gap: 6px;
  margin: 16px 0;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.cabinet-hero {
  padding: 24px;
  color: #fff;
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(204, 236, 114, 0.15), transparent 55%),
    #173b2f;
  box-shadow: var(--shadow);
}

.cabinet-hero .eyebrow {
  color: var(--lime);
}

.cabinet-hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.cabinet-hero-meta div {
  padding: 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
}

.cabinet-hero-meta strong,
.cabinet-hero-meta span {
  display: block;
}

.cabinet-hero-meta span {
  margin-top: 3px;
  color: #b9cbc4;
  font-size: 9px;
}

.cabinet-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
}

.cabinet-section {
  margin-top: 16px;
}

.cabinet-subheading {
  margin-top: 22px;
}

.cabinet-rank {
  color: var(--green);
  font-size: 28px;
  font-weight: 800;
}

.leaderboard-list {
  display: grid;
  margin-top: 15px;
}

.leaderboard-line {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
}

.leaderboard-line.you {
  margin: 3px 0;
  border: 0;
  border-radius: 10px;
  background: var(--green-soft);
}

.cabinet-tournament-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.cabinet-tournament-offer {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cabinet-tournament-offer .cabinet-tournament-row {
  border: 0;
  border-radius: 0;
}

.player-tournament-details {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.cabinet-tournament-offer .player-tournament-details {
  margin: 0;
  padding: 0 12px 12px;
}

.tournament-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tournament-facts span {
  display: grid;
  gap: 3px;
  color: var(--ink);
  padding: 10px;
  border-radius: 10px;
  background: #f5f7f6;
}

.tournament-facts small {
  color: var(--muted);
  font-size: 9px;
}

.tournament-facts strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.cabinet-hero .tournament-facts span {
  background: rgba(255, 255, 255, 0.96);
}

.cabinet-hero .tournament-facts small {
  color: #66766f;
}

.cabinet-hero .tournament-facts strong {
  color: var(--ink);
}

.player-tournament-details > .tournament-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.settings-list {
  display: grid;
  margin: 18px 0;
}

.setting-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.setting-line span {
  color: var(--muted);
  font-size: 11px;
}

.consent-shell {
  display: grid;
  min-height: calc(100vh - 110px);
  place-items: center;
}

.consent-card {
  width: min(680px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.consent-avatar {
  margin-bottom: 18px;
}

.consent-block {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafcfb;
}

.consent-block.required {
  border-color: #bed9ce;
  background: #f4faf7;
}

.consent-block p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.consent-label {
  display: inline-flex;
  width: max-content;
  margin-bottom: 8px;
  padding: 4px 7px;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--green);
  text-transform: uppercase;
}

.consent-label.optional {
  color: #8b4d26;
  background: #ffe7d9;
}

.consent-check,
.consent-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.consent-check input,
.consent-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--green);
}

.consent-check span,
.consent-option span {
  font-size: 12px;
  line-height: 1.45;
}

.consent-option strong,
.consent-option small {
  display: block;
}

.consent-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.consent-submit {
  width: 100%;
  margin-top: 20px;
}

.consent-footnote {
  margin: 11px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.privacy-modal {
  width: min(720px, 100%);
}

.privacy-document {
  display: grid;
  gap: 6px;
  max-height: 52vh;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfb;
}

.privacy-document h3 {
  margin: 9px 0 0;
}

.privacy-document p {
  margin-bottom: 4px;
  color: #4f5e57;
  font-size: 12px;
  line-height: 1.6;
}

.privacy-actions {
  justify-content: flex-start;
  margin: 18px 0;
}

.player-profile-link {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
}

.player-profile-link:hover {
  text-decoration: underline;
}

.skip-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.skip-list.compact {
  grid-template-columns: 1fr 1fr;
}

.skip-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.skip-toggle.selected {
  color: #99491e;
  border-color: #f2c4a7;
  background: #fff4ec;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(13, 29, 23, 0.56);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(600px, 100%);
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(10, 28, 21, 0.25);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.rating-preview {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.review-item {
  margin: 0;
}

.history-card {
  padding: 18px;
}

.results-table {
  margin-top: 22px;
}

.rating-preview-row {
  display: grid;
  grid-template-columns: 1fr 64px 70px 64px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f5f8f6;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  color: #fff;
  font-size: 13px;
  border-radius: 12px;
  background: #173b2f;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 78px 1fr;
  }

  .sidebar {
    padding: 22px 12px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand > div:last-child,
  .nav-button span:last-child,
  .sidebar-note {
    display: none;
  }

  .nav-button {
    justify-content: center;
    padding: 10px;
  }

  .nav-button::after {
    position: absolute;
    z-index: 30;
    left: calc(100% + 12px);
    top: 50%;
    padding: 8px 11px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    content: attr(data-tooltip);
    border-radius: 9px;
    background: #173b2f;
    box-shadow: 0 10px 30px rgba(23, 53, 42, 0.22);
    opacity: 0;
    transform: translate(-4px, -50%);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .nav-button:hover::after,
  .nav-button:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }

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

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .registration-summary,
  .cabinet-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .application-row {
    grid-template-columns: 40px 1fr 150px;
  }

  .application-row .payment-button {
    grid-column: 2 / -1;
    justify-self: start;
  }

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

@media (max-width: 700px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    height: 64px;
    padding: 8px;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(23, 53, 42, 0.25);
  }

  .brand,
  .sidebar-note {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .nav-button {
    gap: 6px;
  }

  .nav-button span:last-child {
    display: inline;
    font-size: 9px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .nav-icon svg {
    width: 19px;
    height: 19px;
  }

  .nav-button::after {
    display: none;
  }

  .main {
    padding: 24px 16px 100px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar .btn {
    min-width: 44px;
    padding: 0 12px;
  }

  .topbar .btn span {
    display: none;
  }

  .stats-grid,
  .tournament-list,
  .choice-grid,
  .form-grid,
  .profile-grid,
  .skip-list {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    grid-template-columns: 58px 1fr;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .profile-rating {
    grid-column: 1 / -1;
  }

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

  .profile-identity h1 {
    font-size: 26px;
  }

  .cabinet-player-select {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 16px;
  }

  .cabinet-hero-meta {
    grid-template-columns: 1fr;
  }

  .tournament-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .application-row {
    grid-template-columns: 36px 1fr;
  }

  .registration-pair-row {
    grid-template-columns: 1fr;
  }

  .invite-panel {
    grid-template-columns: auto 1fr;
  }

  .invite-panel .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .invite-login {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
  }

  .invite-login .btn {
    width: 100%;
    min-height: 54px;
    white-space: normal;
  }

  .invite-login .field {
    min-width: 0;
  }

  .invite-landing {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .invite-landing-card {
    width: 100%;
    padding: 22px 18px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
    box-shadow: none;
  }

  .invite-landing-card h1 {
    font-size: 30px;
    line-height: 1.05;
  }

  .invite-landing-card .subtitle {
    font-size: 16px;
  }

  .invite-landing-card .tournament-rule-note {
    padding: 18px;
  }

  .invite-landing-card .notice {
    padding: 16px;
  }

  .invite-register {
    padding: 16px;
  }

  .invite-register-grid {
    grid-template-columns: 1fr;
  }

  .auth-page {
    padding: 16px;
    place-items: start stretch;
  }

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

  .auth-card {
    padding: 22px 18px;
  }

  .auth-card h1 {
    font-size: 30px;
    line-height: 1.05;
  }

  .application-select,
  .application-row .payment-button {
    grid-column: 2;
    width: 100%;
  }

  .registration-toolbar {
    align-items: flex-start;
  }

  .consent-card {
    padding: 20px;
  }

  .consent-shell {
    min-height: auto;
  }

  .steps {
    grid-template-columns: repeat(4, auto);
  }

  .step span {
    display: none;
  }

  .player-toolbar {
    grid-template-columns: 1fr 90px;
  }

  .player-toolbar .btn {
    grid-column: 1 / -1;
  }

  .wizard-card,
  .card {
    padding: 20px;
  }

  .rating-preview-row {
    grid-template-columns: 1fr 54px 58px 54px;
    font-size: 11px;
  }

  .tennis-score-head,
  .tennis-score-row {
    grid-template-columns: minmax(110px, 1fr) repeat(3, 54px);
  }

  .tennis-set-input {
    width: 54px;
    height: 44px;
  }

  .match-finish-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .padel-court {
    min-height: 164px;
  }

  .court-side {
    padding: 14px 8px;
  }

  .court-player {
    padding: 7px 6px;
    font-size: 11px;
  }
}

@media (min-width: 1500px) {
  .main {
    max-width: 1760px;
  }

  .match-grid {
    grid-template-columns: repeat(4, minmax(260px, 1fr));
  }
}
