:root {
  color-scheme: dark;
}

@font-face {
  font-family: "Causten";
  src: url("/fonts/Causten-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Causten";
  src: url("/fonts/Causten-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Saira Condensed";
  src: url("/fonts/SairaCondensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.competitions-page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 30px 20px 56px;
  color: var(--text-light);
  font-family: "Causten", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.competitions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-direction: column;
}

.competitions-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}

.competitions-header p {
  margin: 0;
  color: #9ca3af;
  font-size: 14px;
  max-width: 640px;
}

.competitions-header__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

@media (min-width: 768px) {
  .competitions-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .competitions-header h1 {
    font-size: 40px;
  }

  .competitions-header p {
    font-size: 16px;
  }

  .competitions-header__actions {
    justify-content: flex-end;
    width: auto;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  min-height: 42px;
  padding: 0 14px;
  font-family: "Saira Condensed", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: var(--transition);
}

.btn--primary {
  color: #fff;
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  box-shadow: var(--shadow-accent-button);
}

.btn--primary:hover {
  background: var(--primary-accent-hover);
  border-color: var(--primary-accent-hover);
}

.btn--ghost {
  color: #dbe5e7;
  border-color: rgba(var(--secondary-teal-rgb), 1);
  background: rgba(var(--secondary-teal-rgb), 0.26);
}

.btn--ghost:hover {
  border-color: rgba(var(--primary-accent-rgb), 0.65);
}

.competitions-toolbar {
  border-bottom: 1px solid rgba(var(--secondary-teal-rgb), 0.75);
  margin-bottom: 16px;
}

.game-tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.game-tab {
  color: var(--text-muted);
  text-decoration: none;
  font-family: "Saira Condensed", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 2px solid transparent;
  padding: 0 0 12px;
  white-space: nowrap;
  transition: var(--transition);
}

.game-tab:hover,
.game-tab.is-active {
  color: var(--primary-accent);
  border-bottom-color: var(--primary-accent);
}

.competitions-toolbar__row {
  margin: 14px 0 16px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.game-select-form,
.competition-search {
  min-width: 240px;
  flex: 1;
}

.game-select-form label,
.competition-search label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #d5dee0;
}

.select-wrap,
.search-wrap {
  position: relative;
}

.select-wrap select,
.search-wrap input {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(var(--secondary-teal-rgb), 0.95);
  background: rgba(var(--primary-black-rgb), 0.58);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.select-wrap select {
  appearance: none;
  padding: 0 36px 0 12px;
  cursor: pointer;
}

.search-wrap input {
  padding: 0 12px 0 36px;
  padding-right: 36px;
}

.search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.select-wrap i,
.search-wrap i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.select-wrap i {
  right: 11px;
  font-size: 0.8rem;
}

.search-wrap i {
  left: 12px;
  font-size: 0.8rem;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a989f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.search-clear:hover {
  color: #dbe6ea;
  background: rgba(255, 255, 255, 0.08);
}

.select-wrap select:focus,
.search-wrap input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 1px rgba(var(--primary-accent-rgb), 0.52);
}

.competitions-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.quick-filter {
  border: 1px solid rgba(var(--secondary-teal-rgb), 0.95);
  background: rgba(var(--primary-black-rgb), 0.46);
  color: #adbbc1;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: var(--transition);
}

.quick-filter:hover {
  border-color: rgba(var(--primary-accent-rgb), 0.55);
  color: #e2eaed;
}

.quick-filter.is-active {
  border-color: rgba(var(--primary-accent-rgb), 0.7);
  background: rgba(var(--primary-accent-rgb), 0.14);
  color: #ff8ba0;
}

.competition-list-wrap {
  border: 1px solid rgba(var(--secondary-teal-rgb), 0.8);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(var(--secondary-teal-rgb), 0.16);
}

.competition-list-head {
  display: none;
}

.competition-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid rgba(var(--secondary-teal-rgb), 0.6);
  background: rgba(var(--primary-black-rgb), 0.28);
  transition: var(--transition);
}

.competition-row:hover {
  border-color: rgba(var(--primary-accent-rgb), 0.36);
  background: rgba(var(--primary-black-rgb), 0.38);
}

.competition-row:first-child {
  border-top: 0;
}

.competition-row__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.competition-row__icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid rgba(var(--secondary-teal-rgb), 0.95);
  background: rgba(var(--primary-black-rgb), 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--primary-accent);
}

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

.competition-row__title-block h2 {
  margin: 0;
  font-family: "Causten", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f7f9fb;
}

.competition-title-link {
  color: inherit;
  text-decoration: none;
}

.competition-title-link:hover {
  color: var(--primary-accent);
}

.competition-row__title-block p {
  margin: 2px 0 0;
  color: #a7b3b8;
  font-size: 0.82rem;
}

.competition-row__status,
.competition-row__scale {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scale-count {
  font-family: var(--font-secondary);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: #f3f7f9;
}

.scale-count-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c1ccd1;
}

.scale-count-wrap i {
  font-size: 0.92rem;
}

.pill {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid transparent;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pill--success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); color: #4ade80; }
.pill--info { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.pill--warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.32); color: #fbbf24; }
.pill--danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.32); color: #f87171; }
.pill--registration { background: rgba(var(--primary-accent-rgb), 0.12); border-color: rgba(var(--primary-accent-rgb), 0.32); color: #ff738b; }
.pill--registered { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.pill--pending { background: rgba(234, 179, 8, 0.12); border-color: rgba(234, 179, 8, 0.3); color: #facc15; }
.pill--payment { background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.35); color: #fb923c; }
.pill--muted { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); color: #94a3b8; }

.tier-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tier-pill {
  border-radius: 6px;
  border: 1px solid rgba(var(--secondary-teal-rgb), 0.9);
  background: rgba(var(--secondary-teal-rgb), 0.42);
  color: #d4dde0;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 6px;
}

.tier-pill--empty {
  color: #9da9ae;
}

.competition-row__context {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.context-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.context-item--success { color: #34d399; }
.context-item--warning { color: #fbbf24; }
.context-item--payment { color: #fb923c; }
.context-item--neutral { color: #c4d0d5; }
.context-item--muted { color: #85949c; }

.context-subtle {
  color: #8f9da5;
  font-size: 0.74rem;
}

.competition-row__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn--inline,
.btn--inline-primary,
.btn--inline-muted {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  border-radius: 7px;
}

.btn--inline {
  color: #e4ecef;
  background: rgba(var(--primary-black-rgb), 0.66);
  border-color: rgba(var(--secondary-teal-rgb), 0.95);
  cursor: pointer;
}

.btn--inline:hover {
  border-color: rgba(var(--primary-accent-rgb), 0.7);
}

.btn--inline-primary {
  color: #fff;
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  cursor: pointer;
}

.btn--inline-primary:hover {
  background: var(--primary-accent-hover);
  border-color: var(--primary-accent-hover);
}

.btn--inline-muted {
  color: #93a0a7;
  background: rgba(var(--primary-black-rgb), 0.32);
  border-color: rgba(var(--secondary-teal-rgb), 0.88);
  cursor: default;
}

.competitions-empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--text-muted);
}

.competitions-footer {
  margin-top: 14px;
  color: #98a5ab;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.competitions-footer strong {
  color: #d9e0e4;
}

.competitions-footer__reset {
  min-height: 32px;
  font-size: 0.64rem;
}

@media (min-width: 980px) {
  .competition-list-head {
    display: grid;
    grid-template-columns: 4fr 2fr 2fr 2fr 2fr;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--secondary-teal-rgb), 0.65);
    background: rgba(var(--primary-black-rgb), 0.5);
    color: #85939a;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
  }

  .competition-list-head > div:last-child {
    text-align: right;
  }

  .competition-row {
    grid-template-columns: 4fr 2fr 2fr 2fr 2fr;
    align-items: center;
  }

  .competition-row__actions {
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .competitions-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .competitions-header {
    flex-direction: column;
  }

  .competitions-header__actions {
    width: 100%;
    justify-content: stretch;
  }

  .competitions-header__actions .btn {
    flex: 1;
  }
}
