:root {
  color-scheme: light;
  --bg: #f4f2ea;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --ink: #15201d;
  --muted: #66736d;
  --line: #d9dfdb;
  --green: #0b5f4a;
  --green-2: #0f7c62;
  --red: #b9473b;
  --amber: #c88a22;
  --blue: #3268a8;
  --shadow: 0 18px 45px rgba(23, 35, 31, 0.12);
}

/* Premium light redesign layer */
:root {
  --bg: #f7faf7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-2: #f3fbf6;
  --ink: #102018;
  --muted: #6b7280;
  --line: rgba(16, 32, 24, 0.08);
  --green: #22b96d;
  --green-2: #28c76f;
  --lime: #b8f05a;
  --mint: #7ee8c6;
  --blue: #5cc8ff;
  --red: #ff6b6b;
  --amber: #ffb84d;
  --shadow: 0 18px 48px rgba(16, 32, 24, 0.08);
  --shadow-soft: 0 8px 24px rgba(16, 32, 24, 0.055);
  --primary-gradient: linear-gradient(135deg, #28c76f 0%, #b8f05a 100%);
  --field-gradient: linear-gradient(135deg, #effff4 0%, #dfffea 100%);
}

body {
  background: linear-gradient(180deg, #f8fafc 0%, #f7faf7 44%, #eefcf4 100%);
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.sidebar {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: 12px 0 34px rgba(16, 32, 24, 0.04);
  backdrop-filter: blur(18px);
}

.brand {
  padding: 10px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.brand img {
  border-radius: 18px;
}

.brand span {
  color: var(--muted);
}

.nav {
  gap: 7px;
}

.nav__item {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav__item.is-active,
.nav__item:hover {
  border-color: rgba(40, 199, 111, 0.18);
  background: linear-gradient(135deg, rgba(40, 199, 111, 0.13), rgba(126, 232, 198, 0.16));
  color: var(--ink);
  transform: translateY(-1px);
}

.workspace {
  padding: 30px clamp(18px, 3vw, 42px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -30px calc(clamp(18px, 3vw, 42px) * -1) 24px;
  padding: 20px clamp(18px, 3vw, 42px) 16px;
  background: rgba(247, 250, 247, 0.82);
  backdrop-filter: blur(18px);
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero,
.tournament-card {
  border: 1px solid rgba(40, 199, 111, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 255, 244, 0.9)),
    var(--field-gradient);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 38px);
}

.hero::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -42px;
  width: 220px;
  height: 220px;
  border: 2px solid rgba(40, 199, 111, 0.12);
  border-radius: 50%;
}

.hero p {
  font-size: 16px;
  line-height: 1.6;
}

.hero__score {
  position: relative;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.hero__score strong {
  font-size: 28px;
}

.panel,
.metric-card,
.published-poll,
.list-item,
.match-item,
.standing-row,
.team-card,
.tournament-list-item,
.vote-result-column {
  border-color: var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: clamp(16px, 2.4vw, 24px);
}

.metric-card strong {
  color: var(--ink);
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.primary-button,
.choice-button,
.timer-actions button {
  border-radius: 18px;
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 10px 22px rgba(40, 199, 111, 0.22);
}

.secondary-button {
  border-color: var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.primary-button:hover,
.choice-button:hover,
.secondary-button:hover,
.small-button:hover,
.team-cloud:hover {
  transform: translateY(-1px);
  filter: none;
}

.choice-button:nth-child(2),
.vote-choice.vote-maybe {
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.95), rgba(255, 229, 150, 0.95));
  color: #3a2810;
}

.choice-button:nth-child(3),
.vote-choice.vote-no {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.96), rgba(255, 163, 163, 0.96));
}

.vote-choice {
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) var(--vote-pct), rgba(16, 32, 24, 0.08) var(--vote-pct)),
    var(--primary-gradient);
}

input,
select,
textarea,
fieldset {
  border-color: var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(40, 199, 111, 0.2);
  border-color: rgba(40, 199, 111, 0.42);
}

.squad-tab,
.player-pick,
.small-button,
.player-chip,
.request-actions button,
.team-cloud {
  border-color: var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.squad-tab.is-active,
.player-chip.is-active,
.team-cloud.is-active,
.team-card.is-active,
.tournament-list-item.is-active,
.match-item.is-expanded,
.match-item.is-active,
.event-card.is-expanded {
  border-color: rgba(40, 199, 111, 0.32);
  background: linear-gradient(135deg, rgba(239, 255, 244, 0.92), rgba(223, 255, 234, 0.9));
}

.avatar {
  border-color: rgba(40, 199, 111, 0.28);
  background: var(--field-gradient);
  color: #0b5f4a;
}

.match-summary__chevron {
  border-color: rgba(40, 199, 111, 0.18);
  color: var(--green);
  box-shadow: var(--shadow-soft);
}

.timer-card,
.match-control.is-completed {
  background: #102018;
}

.match-control.is-pressed {
  border-color: var(--green);
  background: var(--primary-gradient);
  box-shadow: 0 0 0 3px rgba(40, 199, 111, 0.18);
}

.match-control.is-paused {
  border-color: rgba(255, 184, 77, 0.7);
  background: linear-gradient(135deg, #ffb84d, #ffe596);
}

.swipe-finish {
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(40, 199, 111, 0.24) var(--swipe-progress), rgba(255, 255, 255, 0.95) var(--swipe-progress));
}

.stats-table-wrap {
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stats-table th,
.stats-table td {
  border-bottom-color: var(--line);
}

.auth-card {
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 980px) {
  .sidebar {
    inset: auto 10px 10px;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav__item {
    flex: 0 0 auto;
    min-width: 84px;
    min-height: 46px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    white-space: nowrap;
  }

  .workspace {
    padding-bottom: 96px;
  }

  .topbar {
    position: static;
    margin: 0 0 20px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding-inline: 12px;
  }

  .hero,
  .panel,
  .tournament-card {
    border-radius: 24px;
  }

  .metric-grid {
    gap: 10px;
  }

  .list-item,
  .match-item,
  .tournament-list-item {
    border-radius: 18px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.25);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 30px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #10221d;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 32px;
}

.brand img {
  width: 44px;
  height: 44px;
}

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

.brand span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

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

.nav__item {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
}

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

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-head,
.training-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.primary-button,
.choice-button,
.timer-actions button {
  border-radius: 8px;
}

.view {
  display: none;
}

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: stretch;
  padding: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #e8f1ed 100%);
  box-shadow: var(--shadow);
}

.hero p {
  max-width: 760px;
  color: var(--muted);
}

.hero__score {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.hero__score span,
.hero__score small,
.panel__head span {
  color: var(--muted);
}

.hero__score strong {
  font-size: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.vote-panel {
  margin-top: 18px;
}

.vote-event-info,
.vote-results {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.vote-event-info span,
.vote-result-column span,
.mini-label {
  color: var(--muted);
}

.vote-date {
  margin-bottom: 10px;
  color: var(--green);
  font-weight: 800;
}

.vote-result-column {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(23, 35, 31, 0.07);
}

.metric-card {
  padding: 18px;
}

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

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.content-grid,
.team-layout,
.event-layout,
.training-grid,
.profile-layout,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-grid > .panel:first-child,
.admin-grid > .panel:last-child {
  grid-column: 1 / -1;
}

.admin-list,
.news-list {
  display: grid;
  gap: 10px;
}

.admin-news-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-news-item {
  align-items: center;
}

.news-card {
  overflow: hidden;
}

.news-card__image {
  width: calc(100% + 40px);
  max-height: 280px;
  object-fit: cover;
  margin: -20px -20px 18px;
}

.news-card .panel__head small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.promo-copy-button {
  justify-self: flex-start;
  width: auto;
  min-height: 40px;
  margin-top: 14px;
  border: 1px dashed rgba(40, 199, 111, 0.42);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(239, 255, 244, 0.94);
  color: var(--green);
  font-weight: 900;
  letter-spacing: 0.02em;
}

textarea {
  width: 100%;
  resize: vertical;
}

.panel {
  padding: 20px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.vote-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.choice-button,
.primary-button,
.secondary-button,
.timer-actions button {
  border: 0;
  color: #fff;
  font-weight: 700;
}

.choice-button {
  min-height: 48px;
  background: var(--green);
}

.choice-button:nth-child(2) {
  background: var(--amber);
}

.choice-button:nth-child(3) {
  background: var(--red);
}

.vote-choice {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24) var(--vote-pct), rgba(0, 0, 0, 0.1) var(--vote-pct)), var(--green);
}

.vote-choice.vote-maybe {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24) var(--vote-pct), rgba(0, 0, 0, 0.1) var(--vote-pct)), var(--amber);
}

.vote-choice.vote-no {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24) var(--vote-pct), rgba(0, 0, 0, 0.1) var(--vote-pct)), var(--red);
}

.vote-choice.is-selected {
  outline: 2px solid #10221d;
  outline-offset: 2px;
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  background: var(--green);
}

.secondary-button {
  width: 100%;
  min-height: 42px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10221d;
}

.primary-button:hover,
.choice-button:hover {
  filter: brightness(1.06);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-role-form {
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
}

.admin-role-form.is-disabled {
  opacity: 0.62;
}

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

.form-grid.compact {
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.range-field {
  --range-thumb-size: 20px;
  --range-track-height: 7px;
  --range-track-color: rgba(16, 32, 24, 0.72);
  --range-progress: 0%;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.range-field span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.range-field strong {
  color: var(--green);
}

.range-field input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: var(--range-thumb-size);
  border: 0;
  border-radius: 999px;
  padding: 0;
  margin: 0;
  background:
    linear-gradient(
      to right,
      var(--green) 0,
      var(--green) var(--range-progress),
      var(--range-track-color) var(--range-progress),
      var(--range-track-color) 100%
    )
    center / 100% var(--range-track-height) no-repeat;
  box-shadow: none;
  cursor: pointer;
}

.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: var(--range-track-height);
  border-radius: 999px;
  background: transparent;
}

.range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 50%;
  margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
  background: var(--green);
  box-shadow: 0 4px 12px rgba(16, 32, 24, 0.2);
}

.range-field input[type="range"]::-moz-range-track {
  height: var(--range-track-height);
  border-radius: 999px;
  background: transparent;
}

.range-field input[type="range"]::-moz-range-progress {
  height: var(--range-track-height);
  border-radius: 999px;
  background: transparent;
}

.range-field input[type="range"]::-moz-range-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(16, 32, 24, 0.2);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding-inline: calc(var(--range-thumb-size) / 2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.range-scale span {
  display: block;
  min-width: var(--range-thumb-size);
  margin-inline: calc(var(--range-thumb-size) / -2);
  text-align: center;
}

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

fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.member-list,
.team-list,
.request-list,
.event-list,
.match-list,
.goal-log,
.strength-list,
.top-list,
.standings {
  display: grid;
  gap: 10px;
}

.list-item,
.match-item,
.standing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.role-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(40, 199, 111, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(239, 255, 244, 0.84);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-identity > div {
  min-width: 0;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(11, 95, 74, 0.22);
  border-radius: 50%;
  background: #dff1e9;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--large {
  width: 76px;
  height: 76px;
  font-size: 22px;
}

.avatar-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-button {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 50%;
  padding: 3px;
  background: transparent;
  cursor: pointer;
}

.avatar-button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.avatar-input {
  display: none;
}

.match-item {
  display: grid;
  align-items: stretch;
  gap: 10px;
}

.match-item.is-expanded,
.match-item.is-active {
  border-color: var(--green);
  background: #dff1e9;
}

.match-summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(46px, auto);
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

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

.match-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.match-summary__chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  justify-self: center;
  transform: rotate(-45deg);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.match-item.is-expanded .match-summary__chevron,
.event-card.is-expanded .match-summary__chevron {
  transform: rotate(45deg);
}

.match-details {
  display: grid;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#team-members .list-item {
  align-items: center;
  min-height: 72px;
}

.list-item small,
.match-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.team-card {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.tournament-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.event-card {
  align-items: flex-start;
}

.event-card__main {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.event-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.event-summary strong,
.event-summary small {
  display: block;
}

.event-card.is-expanded {
  border-color: var(--green);
  background: #dff1e9;
}

.event-result-card {
  display: grid;
  gap: 16px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.event-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.tournament-list-item.is-active {
  border-color: var(--green);
  background: #dff1e9;
}

.tournament-list-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tournament-list-item strong,
.tournament-list-item small {
  display: block;
}

.team-card.is-active {
  border-color: var(--green);
  background: #dff1e9;
}

.team-card strong,
.team-card small {
  display: block;
}

.team-card small {
  margin-top: 4px;
  color: var(--muted);
}

.invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.invite-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(11, 95, 74, 0.28);
  border-radius: 8px;
  background: #dff1e9;
}

.invite-banner h3 {
  margin-bottom: 6px;
}

.invite-banner p {
  margin-bottom: 0;
  color: var(--muted);
}

.request-actions {
  display: flex;
  gap: 8px;
}

.request-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tournament-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #e8f1ed 100%);
  box-shadow: var(--shadow);
}

.tournament-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 180px;
}

#start-warning {
  margin: 0;
  max-width: 280px;
  color: var(--red);
  font-weight: 700;
}

.squad-builder {
  margin-bottom: 18px;
}

.squad-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.squad-tab,
.player-pick,
.small-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.squad-tab {
  min-height: 44px;
}

.squad-tab.is-active {
  border-color: var(--green);
  background: #dff1e9;
}

.squad-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.player-pick {
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
}

.player-pick strong,
.player-pick small {
  display: block;
}

.player-pick small {
  margin-top: 3px;
  color: var(--muted);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
}

.danger-button {
  border-color: rgba(185, 71, 59, 0.32);
  color: var(--red);
}

.role-select {
  width: 190px;
  min-height: 36px;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

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

.published-polls {
  display: grid;
  gap: 14px;
}

.published-poll {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.training-header {
  align-items: stretch;
}

.training-grid > .training-header {
  grid-column: 1 / -1;
}

.timer-card {
  min-width: 280px;
  padding: 18px;
  border-radius: 8px;
  background: #10221d;
  color: #fff;
}

.timer-card span,
.timer-card strong {
  display: block;
}

.timer-card span {
  color: rgba(255, 255, 255, 0.68);
}

.timer-card strong {
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
  font-size: 42px;
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.timer-actions button {
  min-height: 36px;
  background: var(--green-2);
  font-size: 13px;
}

.match-actions,
.time-inline,
.team-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-actions {
  width: 100%;
}

.swipe-finish {
  --swipe-progress: 0%;
  flex-basis: 100%;
  max-width: 360px;
  min-height: 38px;
  overflow: hidden;
  border-color: rgba(16, 34, 29, 0.24);
  background: linear-gradient(90deg, rgba(11, 95, 74, 0.28) var(--swipe-progress), #eef3ef var(--swipe-progress));
  color: var(--ink);
  touch-action: pan-y;
  user-select: none;
}

.swipe-finish:not(.is-disabled)::after {
  content: "свайп вправо";
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.swipe-finish.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.match-control.is-pressed {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(11, 95, 74, 0.18);
}

.match-control.is-paused {
  border-color: var(--amber);
  background: var(--amber);
  color: #10221d;
  box-shadow: 0 0 0 2px rgba(210, 142, 46, 0.22);
}

.match-control.is-completed {
  border-color: #10221d;
  background: #10221d;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(16, 34, 29, 0.18);
}

.time-inline {
  align-items: center;
}

.time-inline input {
  width: 82px;
  min-height: 38px;
}

.goal-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.match-goal-box {
  display: grid;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.player-button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.player-chip.is-active {
  border-color: var(--green);
  background: #dff1e9;
}

.stats-team-switcher,
.training-event-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}

.stats-head {
  display: grid;
  justify-content: stretch;
  align-items: start;
  gap: 14px;
}

.team-cloud {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.team-cloud.is-active {
  border-color: var(--green);
  background: #dff1e9;
  color: var(--green);
}

.goal-edit-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.score {
  justify-self: end;
  font-size: 22px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.stats-table-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.stats-head__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.stats-toggle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.stats-toggle-control > span {
  color: var(--ink);
  font-weight: 800;
}

.stats-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 66px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.stats-switch__knob {
  position: absolute;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 5px 14px rgba(16, 32, 24, 0.16);
  transition: transform 0.18s ease, background 0.18s ease;
}

.stats-switch.is-on {
  border-color: rgba(40, 199, 111, 0.42);
  background: var(--primary-gradient);
  color: #fff;
}

.stats-switch.is-on .stats-switch__knob {
  background: #fff;
  transform: translateX(28px);
}

.stats-table.is-compact {
  min-width: 420px;
}

.stats-table.is-compact th:not(:first-child):not(:nth-child(2)):not(:last-child),
.stats-table.is-compact td:not(:first-child):not(:nth-child(2)):not(:last-child) {
  display: none;
}

.stats-table th,
.stats-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.stats-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.achievement-list {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 5px;
  align-items: center;
  width: max-content;
  max-width: 170px;
}

.achievement-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(16, 32, 24, 0.15));
}

.award-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: center;
  gap: 16px;
}

.award-card b {
  display: block;
  margin-top: 12px;
}

.award-card__icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  justify-self: end;
  filter: drop-shadow(0 8px 14px rgba(16, 32, 24, 0.16));
}

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

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

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    height: auto;
    padding: 8px;
    box-shadow: 0 -10px 26px rgba(23, 35, 31, 0.14);
  }

  .brand {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .nav__item {
    min-height: 46px;
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
  }

  .workspace {
    padding: 18px 14px 84px;
  }

  .hero,
  .content-grid,
  .event-result-grid,
  .team-layout,
  .event-layout,
  .training-grid,
  .profile-layout,
  .admin-grid,
  .tournament-card,
  .squad-builder-grid {
    grid-template-columns: 1fr;
  }

  .invite-box,
  .invite-banner,
  .inline-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 23px;
  }

  .topbar,
  .section-head,
  .training-header {
    display: grid;
  }

  .timer-card {
    width: 100%;
  }

  .metric-grid,
  .vote-row,
  .timer-actions,
  .squad-tabs {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .nav__item {
    font-size: 11px;
  }

  .list-item,
  .match-item,
  .standing-row,
  .tournament-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .award-card {
    grid-template-columns: minmax(0, 1fr) 58px;
    align-items: center;
  }

  .award-card__icon {
    width: 58px;
    height: 58px;
  }

  #team-members .list-item {
    align-items: stretch;
  }

  .member-actions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .member-actions .role-select,
  .member-actions .small-button {
    width: 100%;
  }

  .admin-role-form {
    grid-template-columns: 1fr;
  }

  .goal-edit-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }
}

/* Final premium overrides */
body {
  background:
    radial-gradient(circle at 16% 8%, rgba(184, 240, 90, 0.28), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(126, 232, 198, 0.22), transparent 30%),
    linear-gradient(135deg, #f7faf7 0%, #eef8ef 52%, #f8fff9 100%);
  color: var(--ink);
}

.app-shell {
  background: transparent;
}

.workspace {
  background: transparent;
}

.sidebar {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 34px rgba(16, 32, 24, 0.04);
  backdrop-filter: blur(18px);
}

.nav__item {
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800;
}

.nav__item.is-active,
.nav__item:hover {
  background: linear-gradient(135deg, rgba(40, 199, 111, 0.13), rgba(126, 232, 198, 0.16));
  color: var(--ink);
}

.hero,
.tournament-card {
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 255, 244, 0.9)),
    var(--field-gradient);
}

.hero__score,
.panel,
.metric-card,
.published-poll,
.list-item,
.match-item,
.standing-row,
.team-card,
.tournament-list-item,
.vote-result-column,
.stats-table-wrap {
  border-color: var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.primary-button,
.choice-button,
.timer-actions button {
  border-radius: 18px;
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 10px 22px rgba(40, 199, 111, 0.22);
}

.secondary-button {
  border-color: var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.squad-tab,
.player-pick,
.small-button,
.player-chip,
.request-actions button,
.team-cloud,
input,
select,
textarea,
fieldset {
  border-color: var(--line);
  border-radius: 16px;
}

.squad-tab.is-active,
.player-chip.is-active,
.team-cloud.is-active,
.team-card.is-active,
.tournament-list-item.is-active,
.match-item.is-expanded,
.match-item.is-active,
.event-card.is-expanded {
  border-color: rgba(40, 199, 111, 0.32);
  background: linear-gradient(135deg, rgba(239, 255, 244, 0.92), rgba(223, 255, 234, 0.9));
}

.vote-choice {
  border-radius: 18px;
}

.auth-card {
  border-radius: 28px;
}

.pull-refresh {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(16, 32, 24, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(16, 32, 24, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -72px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
}

.pull-refresh.is-visible {
  opacity: 1;
}

.pull-refresh__spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(34, 185, 109, 0.24);
  border-top-color: var(--green);
  border-radius: 50%;
}

.pull-refresh.is-refreshing .pull-refresh__spinner {
  animation: pull-refresh-spin 0.75s linear infinite;
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav__item::before {
  display: none;
}

.nav__item[data-view="dashboard"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10.8 12 4l9 6.8V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="teams"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="events"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2ZM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="training"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v4a5 5 0 0 1-10 0V4ZM17 6h3v2a4 4 0 0 1-4 4M7 6H4v2a4 4 0 0 0 4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="stats"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3v18h18M7 16v-5M12 16V7M17 16v-8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="news"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h13a3 3 0 0 1 3 3v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5ZM8 9h6M8 13h8M8 17h5M20 8h-3v11a2 2 0 0 0 2 2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="profile"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0M12 13a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav__item[data-view="admin"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7ZM19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1 1.55V21a2 2 0 1 1-4 0v-.09a1.7 1.7 0 0 0-1-1.55 1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.55-1H3a2 2 0 1 1 0-4h.09a1.7 1.7 0 0 0 1.55-1 1.7 1.7 0 0 0-.34-1.87l-.06-.06A2 2 0 1 1 7.07 4.24l.06.06A1.7 1.7 0 0 0 9 4.64a1.7 1.7 0 0 0 1-1.55V3a2 2 0 1 1 4 0v.09a1.7 1.7 0 0 0 1 1.55 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.36 9c.12.45.51 1 1.55 1H21a2 2 0 1 1 0 4h-.09a1.7 1.7 0 0 0-1.51 1Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (max-width: 980px) {
  .sidebar {
    right: auto;
    bottom: calc(34px + env(safe-area-inset-bottom));
    left: 50%;
    width: min(calc(100% - 28px), 500px);
    border: 1px solid rgba(16, 32, 24, 0.1);
    border-radius: 999px;
    padding: 7px;
    background: rgba(9, 17, 14, 0.88);
    box-shadow: 0 18px 44px rgba(16, 32, 24, 0.24);
    transform: translateX(-50%);
  }

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

  .nav__item {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    font-size: 0;
    line-height: 1.15;
  }

  .nav__item::before {
    display: block;
    width: 21px;
    height: 21px;
    background: currentColor;
    content: "";
    mask: var(--nav-icon) center / contain no-repeat;
    -webkit-mask: var(--nav-icon) center / contain no-repeat;
  }

  .nav__item.is-active,
  .nav__item:hover {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(40, 199, 111, 0.28);
  }

  .workspace {
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .nav {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
  }

  .nav__item {
    min-height: 39px;
  }

  .nav__item::before {
    width: 19px;
    height: 19px;
  }
}
