@font-face {
  font-family: "Druk Cyr";
  src: local("Druk Cyr Bold"), local("DrukCyr-Bold"), local("Druk Condensed Cyr Bold");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --display-font: "Druk Cyr", "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --bg: #0d0d0d;
  --panel: #181818;
  --panel-2: #202020;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --muted: #a9a9a9;
  --gold: #e7d692;
  --red: #f97272;
  --green: #63d987;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #080808;
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
}

.screen {
  min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(104px + env(safe-area-inset-bottom));
  position: relative;
  isolation: isolate;
  background: #0d0d0d;
}

.app-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  left: 50%;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(13, 13, 13, 0.86), #0d0d0d 58%),
    url("./design-assets/Content.svg") center top / 760px auto no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: -1;
}

.admin-screen {
  padding: 0 20px calc(104px + env(safe-area-inset-bottom));
}

.admin-screen::before {
  opacity: 0.04;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand {
  min-width: 0;
  text-align: center;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.title {
  margin: 4px 0 0;
  font-size: 27px;
  line-height: 0.95;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon-btn img {
  max-width: 24px;
  max-height: 24px;
}

.icon-btn.ghost {
  visibility: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
}

.stack {
  display: grid;
  gap: 12px;
}

.banner-card {
  height: 96px;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: #151515;
  border: 1px solid var(--line);
}

.banner-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tournament-card {
  min-height: 118px;
  padding: 17px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 14px;
  align-items: center;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(14, 14, 14, 0.84), rgba(14, 14, 14, 0.96)),
    url("./design-assets/Баннер турнира.svg") center / cover,
    #161616;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tournament-card h2 {
  margin: 5px 0 7px;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.tournament-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tournament-card > span {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #0d0d0d;
  background: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.card,
.hero-card,
.profile-card {
  border-radius: var(--radius);
  background: rgba(24, 24, 24, 0.96);
  border: 1px solid var(--line);
  overflow: hidden;
}

.match-card {
  min-height: 113px;
  background:
    linear-gradient(90deg, rgba(24, 24, 24, 0.98), rgba(30, 30, 30, 0.98)),
    url("./design-assets/Rectangle 4174.svg") center / cover;
}

.match-head {
  min-height: 50px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.team-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #101010;
  font-size: 12px;
  font-weight: 900;
  background: var(--gold);
}

.match-teams {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-teams span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--red);
  background: rgba(249, 114, 114, 0.1);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-body {
  padding: 13px 14px 14px;
  display: grid;
  gap: 10px;
}

.match-meta {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  align-items: end;
}

.label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.value {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.pick {
  justify-self: end;
  min-width: 138px;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #101010;
  background: #f4f4f4;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.pick.wide {
  width: 100%;
  justify-self: stretch;
  margin-bottom: 12px;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hero-card {
  padding: 18px;
  margin-bottom: 12px;
}

.detail-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
}

.detail-team {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.big-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 24px;
}

.versus {
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.section-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.text-block {
  color: #d8d8d8;
  font-size: 14px;
  line-height: 1.55;
}

.action {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  color: #101010;
  background: var(--text);
  font-weight: 900;
  text-transform: uppercase;
}

.secondary {
  color: var(--text);
  background: #2c2c2c;
}

.profile-card {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.profile-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}

.avatar,
.gate-logo {
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
  color: #101010;
  font-weight: 900;
}

.avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.profile-name {
  font-size: 18px;
  font-weight: 900;
}

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

.stat {
  min-height: 70px;
  padding: 12px 8px;
  border-radius: 14px;
  background: #222;
}

.stat strong {
  display: block;
  margin-bottom: 5px;
  font-size: 22px;
  line-height: 1;
}

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

.admin-header {
  height: auto;
  aspect-ratio: 390 / 96;
  margin: 0 calc(-1 * clamp(17px, 6vw, 24px)) clamp(17px, 6.5vw, 26px);
  position: relative;
  overflow: hidden;
  background: #131313;
}

.admin-screen {
  padding-inline: clamp(17px, 6vw, 24px);
  background: radial-gradient(ellipse at left bottom, #191a1b, transparent 60%), #101010;
}

.admin-header img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-header .admin-subtitle {
  position: absolute;
  left: 50%;
  top: 78%;
  width: 19.25%;
  height: auto;
  transform: translateX(-50%);
  object-fit: contain;
}

.admin-header .admin-subtitle-text {
  width: max-content;
  color: #bdbdbd;
  font: italic 700 clamp(9px, 2.75vw, 12px) var(--display-font);
  text-transform: uppercase;
}

.admin-screen:has(.admin-back) .admin-header {
  margin-bottom: 5px;
}

.admin-back,
.admin-add-tournament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #bdbdbd;
  font-size: clamp(12px, 4vw, 16px);
  font-weight: 800;
  text-transform: uppercase;
}

.admin-back {
  margin: 0 0 5px -10px;
  padding: 2px 3px;
  background: transparent;
}

.admin-back svg {
  width: 16px;
  height: 16px;
}

.admin-add-tournament {
  width: 100%;
  min-height: clamp(30px, 10.2vw, 41px);
  margin-bottom: 8px;
  border: 1px solid #ffffff29;
  border-radius: 999px;
  background: #242424;
}

.admin-add-tournament img {
  width: clamp(17px, 6vw, 24px);
}

.admin-tournament-list {
  display: grid;
  gap: clamp(12px, 5vw, 20px);
}

.admin-tournament-form {
  display: grid;
  gap: clamp(13px, 4.4vw, 18px);
}

.admin-tournament-title label,
.admin-tournament-upload > span:first-child,
.admin-tournament-teams > span {
  display: block;
  margin-bottom: 3px;
  color: #a3a3a3;
  font-size: clamp(10px, 3.4vw, 13px);
  font-weight: 700;
}

.admin-tournament-title > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff0a;
}

.admin-tournament-title input {
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(14px, 4.7vw, 18px);
}

.admin-tournament-title button {
  display: grid;
  width: clamp(38px, 13vw, 51px);
  place-items: center;
  background: #e7d69235;
  color: var(--gold);
}

.admin-tournament-title button::before {
  width: 13px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: translateY(-2px) rotate(-45deg);
  content: "";
}

.admin-tournament-title button:disabled {
  opacity: .55;
}

.admin-tournament-upload {
  position: relative;
  display: block;
  cursor: pointer;
}

.admin-tournament-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-tournament-upload:focus-within .admin-tournament-upload-image {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.admin-tournament-upload-image,
.tournament-banner-image {
  display: block;
  width: 100%;
  aspect-ratio: 3;
  border-radius: 14px;
}

.admin-tournament-upload-image {
  background: url("./design-assets/tournament-banner-upload.svg") center / cover no-repeat;
}

.admin-team-upload {
  justify-self: start;
}

.admin-team-upload .admin-tournament-upload-image {
  width: clamp(86px, 29vw, 113px);
  aspect-ratio: 1;
  overflow: hidden;
  background-image: url("./design-assets/Баннер турнира.svg");
}

.admin-team-upload .admin-tournament-upload-image img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #242424;
}

.admin-team-database {
  padding: 5px 0 clamp(45px, 16vw, 65px);
}

.admin-team-database .text-block {
  grid-column: 1 / -1;
}

.tournament-banner-image {
  object-fit: cover;
}

.admin-roster-open {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #ffffff2b;
  border-radius: 999px;
  background: #242424;
  color: #fff;
  font-size: clamp(9px, 3.25vw, 13px);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.admin-roster-selected {
  padding: 8px;
  border-radius: 14px;
  background: #ffffff0d;
}

.admin-roster-selected ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 4px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.admin-roster-selected li,
.admin-roster-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  gap: 3px;
  color: #aaa;
  font-size: clamp(9px, 3.2vw, 13px);
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.admin-roster-mark {
  display: grid;
  width: clamp(31px, 12vw, 50px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #ffffff26;
  border-radius: 50%;
  background: #383838;
  color: #fff;
  font-size: clamp(13px, 4.6vw, 19px);
}

.admin-roster-mark img {
  width: 75%;
}

.admin-roster-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.admin-roster-actions button,
.admin-roster-add {
  padding: 6px 8px;
  border-radius: 999px;
  background: #404040;
  color: #fff;
  font-size: clamp(9px, 3.1vw, 13px);
  font-weight: 800;
  text-transform: uppercase;
}

.admin-roster-actions button:first-child {
  background: #63494b;
  color: var(--red);
}

.admin-tournament-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.admin-tournament-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 5px;
}

.admin-tournament-heading .tournament-toggle {
  justify-self: start;
}

.admin-tournament-icon {
  display: grid;
  width: clamp(27px, 9.2vw, 36px);
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 1px solid #ffffff1f;
  border-radius: 50%;
  background: #222;
  color: #bdbdbd;
}

.admin-tournament-icon svg {
  width: 65%;
  height: 65%;
}

.admin-tournament-heading:has(.tournament-toggle[aria-expanded="true"]) + .admin-tournament-matches {
  grid-template-rows: 1fr;
  opacity: 1;
}

.admin-finish-match {
  align-self: center;
  justify-self: end;
  width: min(100%, 152px);
  padding: 2px 6px;
  border: 1px solid #ffffff29;
  border-radius: 999px;
  background: #fff;
  color: #181818;
  font: italic 900 clamp(9px, 3vw, 12px) Arial, sans-serif;
  text-transform: uppercase;
}

.admin-finish-match.is-picking {
  background: #303030;
  color: #fff;
}

.admin-finish-match span:last-child,
.admin-finish-match.is-picking span:first-child {
  display: none;
}

.admin-finish-match.is-picking span:last-child {
  display: inline;
}

.admin-match-tools {
  position: fixed;
  right: calc(max(0px, (100vw - 430px) / 2) + clamp(12px, 4vw, 18px));
  bottom: calc(clamp(68px, 23vw, 91px) + env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.admin-match-tools-toggle {
  display: grid;
  place-items: center;
  width: clamp(38px, 13vw, 54px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  background: linear-gradient(145deg, rgb(78 78 82 / 55%), rgb(19 19 22 / 72%));
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
  color: #ddd;
}

.admin-match-tools-toggle img {
  width: 48%;
}

.admin-match-tools-toggle svg {
  width: 52%;
  height: 52%;
}

.admin-access-list {
  display: grid;
  gap: 6px;
}

.admin-access-card {
  display: flex;
  align-items: center;
  gap: clamp(4px, 2vw, 9px);
  min-height: clamp(56px, 19vw, 76px);
  padding: 6px 3.5%;
  border-radius: 14px;
  background: #ffffff08;
  color: #bdbdbd;
}

.admin-access-avatar {
  flex: 0 0 auto;
  width: clamp(33px, 13vw, 52px);
  aspect-ratio: 1;
  margin-right: 3%;
  overflow: hidden;
  border-radius: 50%;
  background: #d4d7d7;
}

.admin-access-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-access-identity {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
  overflow-wrap: anywhere;
  font-size: clamp(10px, 3.5vw, 13px);
}

.admin-access-identity strong {
  color: var(--gold);
}

.admin-access-identity span {
  font-weight: 700;
  text-transform: uppercase;
}

.admin-access-card .admin-tournament-icon {
  flex: 0 0 auto;
  width: clamp(23px, 8.5vw, 34px);
}

.admin-access-sheet form {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.admin-access-sheet h2 span {
  max-width: 20em;
}

.admin-access-error {
  margin: 3px 0 0;
  color: var(--red);
  font: 700 clamp(13px, 4.5vw, 19px) var(--display-font);
  text-align: center;
  text-transform: uppercase;
}

.admin-access-roles {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.admin-access-roles button {
  min-width: 29%;
  padding: 8px 10px;
  border-radius: 13px;
  background: #292929;
  color: #aaa;
  font-size: clamp(11px, 3.8vw, 15px);
}

.admin-access-roles button[aria-pressed="true"] {
  background: #484848;
  color: #fff;
}

.admin-match-tools-toggle span,
.admin-match-tools.open .admin-match-tools-toggle img {
  display: none;
}

.admin-match-tools.open .admin-match-tools-toggle span {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.admin-match-tools-options {
  display: grid;
  justify-items: end;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.admin-match-tools.open .admin-match-tools-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.admin-match-tools-options button {
  min-height: clamp(29px, 10vw, 38px);
  padding: 4px 10px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  background: linear-gradient(145deg, rgb(78 78 82 / 43%), rgb(19 19 22 / 56%));
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%);
  color: #fff;
  font-size: clamp(9px, 3.1vw, 13px);
  font-weight: 700;
}

.admin-match-tools-options button[aria-pressed="true"] {
  border-color: var(--gold);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow-x: auto;
  background: #151515;
  border: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.admin-tabs button.active {
  color: #101010;
  background: var(--gold);
}

.admin-menu {
  display: grid;
  gap: clamp(6px, 2vw, 9px);
}

.admin-menu button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(7px, 3vw, 12px);
  min-height: clamp(45px, 15.4vw, 63px);
  padding: 0 5.5%;
  border: 1px solid #ffffff0b;
  border-radius: clamp(12px, 4.1vw, 17px);
  background: #1b1b1b;
  color: #bdbdbd;
  font-size: clamp(12px, 4vw, 16px);
  text-align: left;
}

.admin-menu button:hover {
  background: #242424;
}

.admin-menu button img {
  display: block;
  width: clamp(16px, 5vw, 20px);
}

.admin-menu button img:last-child {
  width: clamp(11px, 3.6vw, 14px);
}

.admin-grid {
  display: grid;
  gap: 10px;
}

.admin-list {
  margin-top: 12px;
}

.admin-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.admin-row:first-of-type {
  border-top: 0;
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row strong {
  font-size: 13px;
}

.admin-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.mini-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text);
  background: #2b2b2b;
  font-size: 12px;
  font-weight: 800;
}

.mini-btn.danger {
  color: #101010;
  background: var(--red);
}

.admin-inline {
  display: grid;
  gap: 10px;
}

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

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

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  background: #222;
  outline: none;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  color: #101010;
  background: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  z-index: 6;
}

.floating-action {
  position: fixed;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 40px));
  min-height: 48px;
  border-radius: 16px;
  color: #101010;
  background: var(--text);
  font-weight: 900;
  text-transform: uppercase;
  z-index: 5;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 430px);
  height: calc(80px + env(safe-area-inset-bottom));
  padding: 9px 22px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: #131313;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 4;
}

.nav-btn {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-btn.active {
  color: var(--text);
}

.nav-btn svg {
  width: 23px;
  height: 23px;
}

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

.gate-card {
  min-height: calc(100vh - 140px);
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid var(--line);
}

.gate-logo {
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  font-size: 28px;
}

@media (max-width: 360px) {
  .screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-header {
    margin-left: -16px;
    margin-right: -16px;
  }

  .match-meta {
    grid-template-columns: 62px 1fr;
  }

  .pick {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

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

  .tournament-card {
    grid-template-columns: 1fr;
  }
}

.tournaments-screen {
  padding: 0 0 calc(88px + env(safe-area-inset-bottom));
}

.tournaments-header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: end;
  min-height: calc(clamp(70px, 24.6vw, 96px) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 4% 4%;
  background: #131313;
}

.tournaments-header h1 {
  justify-self: center;
  margin: 0 0 4px;
}

.tournaments-header h1 img {
  display: block;
  width: clamp(60px, 20vw, 79px);
}

.tournaments-brand {
  width: clamp(30px, 10.5vw, 41px);
}

.tournaments-header button {
  justify-self: end;
  padding: 0;
  background: transparent;
}

.tournaments-header button img {
  display: block;
  width: clamp(38px, 13vw, 51px);
}

.statistics-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  padding: 0 0 calc(clamp(58px, 20.5vw, 80px) + env(safe-area-inset-bottom));
}

.statistics-header {
  min-height: calc(clamp(64px, 23.8vw, 96px) + env(safe-area-inset-top));
}

.statistics-header h1,
.statistics-placeholder {
  font-family: var(--display-font);
  text-transform: uppercase;
}

.statistics-header h1 {
  margin-bottom: 3px;
  color: #d9d9d9;
  font-size: clamp(21px, 7vw, 29px);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.statistics-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 12px 12px;
  background:
    radial-gradient(ellipse at 50% 46%, #422226 0%, transparent 32%),
    radial-gradient(ellipse at left bottom, #191a1b, transparent 60%),
    #101010;
  color: #ddd;
  text-align: center;
}

.statistics-placeholder h2 {
  margin: 0 0 5px;
  color: #de6265;
  font-size: clamp(50px, 18vw, 76px);
  font-weight: 700;
  line-height: .95;
  text-shadow: 0 0 24px #de626577;
}

.statistics-placeholder p {
  margin: 0;
  font-size: clamp(13px, 5vw, 20px);
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 0 10px #fff6;
}

.telegram-profile-screen {
  min-height: 100dvh;
  padding: 0 0 calc(80px + env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at left bottom, #191a1b, transparent 60%), #101010;
}

.telegram-profile-content {
  display: grid;
  gap: clamp(10px, 3.6vw, 16px);
  padding: 4% 5.5% 0;
}

.telegram-profile-account {
  display: flex;
  align-items: center;
  gap: clamp(12px, 5vw, 20px);
  padding: 3.5%;
  border-radius: 14px;
  background: #ffffff08;
  color: #bdbdbd;
  font-size: clamp(11px, 3.6vw, 14px);
  overflow-wrap: anywhere;
}

.telegram-profile-account strong,
.telegram-profile-account span {
  display: block;
}

.telegram-profile-account strong,
.telegram-profile-stats {
  text-transform: uppercase;
}

.telegram-profile-avatar {
  flex: 0 0 auto;
  width: clamp(42px, 13.5vw, 56px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #d4d7d7;
}

.telegram-profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.telegram-profile-stats h2 {
  margin: 0 0 4px;
  color: #bdbdbd;
  font-size: clamp(11px, 3.8vw, 16px);
  text-align: center;
}

.telegram-profile-stats dl {
  display: grid;
  gap: 4px;
  margin: 0;
  font-family: var(--display-font);
  font-weight: 700;
}

.telegram-profile-stats dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: clamp(40px, 13.3vw, 56px);
  padding: 6px 6%;
  border-radius: 13px;
  background: #212222;
  color: #bdbdbd;
}

.telegram-profile-stats dl > .correct {
  background: #202723;
}

.telegram-profile-stats dl > .incorrect {
  background: #272122;
}

.telegram-profile-stats dt {
  font-size: clamp(12px, 4.2vw, 18px);
}

.telegram-profile-stats dd {
  margin: 0;
  font-size: clamp(20px, 6.8vw, 29px);
  line-height: 1;
}

.telegram-profile-stats .correct dd {
  color: var(--green);
}

.telegram-profile-stats .incorrect dd {
  color: var(--red);
}

.telegram-profile-stats .best dd {
  max-width: 25vw;
  color: var(--gold);
  font-size: clamp(12px, 4.1vw, 17px);
  text-align: right;
  overflow-wrap: anywhere;
}

.tournaments-list {
  display: grid;
  gap: clamp(11px, 4vw, 19px);
  padding: 4% 6% 0;
}

.tournament-toggle {
  display: grid;
  grid-template-columns: auto 12px;
  align-items: center;
  gap: 2px 8px;
  padding: 0;
  background: transparent;
  color: #bdbdbd;
  text-align: left;
  text-transform: uppercase;
}

.tournament-toggle[aria-expanded="true"] {
  color: #fff;
}

.tournament-toggle span {
  grid-column: 1 / -1;
}

.tournament-toggle span,
.tournament-match-info small {
  color: #bdbdbd;
  font-size: clamp(9px, 2.8vw, 11px);
  text-transform: uppercase;
}

.tournament-toggle strong,
.tournament-match-head,
.tournament-match-info strong {
  font-family: var(--display-font);
  font-weight: 700;
  text-transform: uppercase;
}

.tournament-toggle strong {
  font-size: clamp(15px, 4.8vw, 21px);
  line-height: 1;
}

.tournament-toggle i {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 240ms ease;
}

.tournament-toggle[aria-expanded="true"] i {
  transform: translateY(2px) rotate(225deg);
}

.tournament-matches {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 280ms ease, opacity 220ms ease;
}

.tournament-toggle[aria-expanded="true"] + .tournament-matches {
  grid-template-rows: 1fr;
  opacity: 1;
}

.tournament-matches-inner {
  display: grid;
  gap: clamp(6px, 2vw, 9px);
  min-height: 0;
  overflow: hidden;
}

.tournament-matches-inner > :first-child {
  margin-top: 7px;
}

.tournament-match {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: clamp(11px, 4vw, 16px);
  background: #191919;
}

.tournament-match::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("./design-assets/tournament-texture.png") center / cover;
  opacity: .12;
  content: "";
}

.tournament-match-head {
  display: grid;
  width: 100%;
  min-height: clamp(36px, 12.5vw, 49px);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 0 3%;
  border-radius: inherit;
  background: linear-gradient(110deg, #272824, #24252d);
  color: #fff;
  font-size: clamp(12px, 3.8vw, 17px);
}

.tournament-match-head span,
.tournament-user-pick strong {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tournament-match-head span:last-child,
.tournament-user-pick strong {
  justify-content: flex-end;
}

.tournament-match-head img {
  width: clamp(23px, 9vw, 36px);
  height: auto;
}

.tournament-match-head b,
.tournament-match.finished .tournament-match-head span:first-child {
  color: var(--gold);
}

.tournament-match-head b {
  font-size: clamp(15px, 5vw, 22px);
}

.tournament-match.finished .tournament-match-head span:last-child,
.tournament-match.finished .tournament-user-pick strong {
  color: var(--red);
}

.tournament-match-info {
  display: grid;
  grid-template-columns: 22% 22% minmax(0, 1fr);
  align-items: end;
  gap: 4px;
  min-height: clamp(45px, 16vw, 64px);
  padding: 5px 4% 7px;
}

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

.tournament-match-info strong {
  font-size: clamp(17px, 5.4vw, 23px);
  line-height: 1.1;
}

.tournament-user-pick {
  justify-self: end;
  text-align: right;
}

.tournament-user-pick strong {
  display: flex;
}

.tournament-user-pick img {
  width: clamp(16px, 6.4vw, 25px);
}

.tournament-pick-button {
  display: grid;
  justify-self: end;
  align-self: center;
  width: min(100%, clamp(104px, 39vw, 152px));
  padding: 0;
  background: transparent;
}

.tournament-pick-button img {
  display: block;
  width: 100%;
  grid-area: 1 / 1;
}

.tournament-pick-button span {
  display: none;
  grid-area: 1 / 1;
  place-items: center;
  border: 1px solid #777;
  border-radius: 999px;
  background: #303030;
  color: #fff;
  font: italic 900 clamp(8px, 3vw, 12px) Arial, sans-serif;
  text-transform: uppercase;
}

.tournament-pick-button.is-picking img {
  visibility: hidden;
}

.tournament-pick-button.is-picking span {
  display: grid;
}

.detail-card .tournament-pick-button {
  margin: 12px auto 0;
}

html:has(.pick-sheet[open]) {
  overflow: hidden;
}

.pick-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 430px);
  max-width: none;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-top: 3px solid var(--gold);
  border-radius: clamp(23px, 10vw, 40px) clamp(23px, 10vw, 40px) 0 0;
  background: #1b1b1b;
  color: var(--text);
  overscroll-behavior: contain;
  translate: 0 var(--pick-sheet-offset, 0px);
  transition: translate 220ms cubic-bezier(.22, .8, .25, 1);
}

.pick-sheet[open] {
  animation: pick-sheet-slide 290ms cubic-bezier(.22, .8, .25, 1) backwards;
}

.pick-sheet.is-dragging {
  animation: none;
  transition: none;
}

.pick-sheet::backdrop {
  background: rgb(0 0 0 / 48%);
  animation: pick-sheet-fade 250ms ease both;
}

.pick-sheet form {
  display: grid;
  gap: clamp(5px, 1.8vw, 9px);
  padding: 0 6% calc(12px + env(safe-area-inset-bottom));
}

.pick-sheet h2 {
  display: grid;
  justify-items: center;
  margin: 0 0 1px;
  outline: none;
}

.pick-sheet-handle {
  display: grid;
  justify-items: center;
  align-items: start;
  min-height: 12px;
  padding-top: 3px;
  margin-inline: -6%;
  cursor: grab;
  touch-action: none;
}

.is-dragging .pick-sheet-handle {
  cursor: grabbing;
}

.pick-sheet-handle::before {
  width: clamp(38px, 14vw, 56px);
  height: 4px;
  border-radius: 4px;
  background: #5e5e5e;
  content: "";
}

.pick-sheet h2 img {
  display: block;
  width: min(74%, 250px);
}

.pick-sheet h2 span {
  font: 700 clamp(17px, 5.8vw, 25px)/1.05 var(--display-font);
  text-align: center;
  text-transform: uppercase;
}

.admin-roster-sheet {
  height: calc(100dvh - clamp(56px, 19vw, 82px) - env(safe-area-inset-top));
  border-top: 0;
  border-radius: 26px 26px 0 0;
}

.admin-roster-sheet form {
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  padding-inline: 4%;
  outline: none;
}

.admin-roster-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #ffffff14;
  border-radius: 999px;
  background: #292929;
  color: #aaa;
}

.admin-roster-search input {
  min-width: 0;
  padding: 7px 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
}

.admin-roster-search svg {
  width: 21px;
  margin-inline: 7px;
  pointer-events: none;
}

.admin-roster-results {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 2px;
}

.admin-roster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: center;
  gap: clamp(9px, 4vw, 16px) 7px;
}

.admin-roster-tile {
  position: relative;
  width: min(100%, clamp(54px, 18vw, 73px));
  min-height: clamp(54px, 18vw, 73px);
  padding: 4px;
  border: 1px solid #ffffff28;
  border-radius: 10px;
  background: #303030;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.admin-roster-tile .admin-roster-mark {
  width: clamp(27px, 10vw, 42px);
  border: 0;
  background: transparent;
}

.admin-roster-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-roster-tile:has(input:checked) {
  border-color: #e7e7e7;
  background: #636363;
  color: #fff;
}

.admin-roster-tile:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.admin-roster-add {
  margin-top: 10px;
}

.admin-roster-sheet .pick-sheet-apply {
  margin-inline: 3%;
}

.pick-sheet-tournament {
  text-align: right;
}

.pick-sheet-tournament strong {
  font-size: clamp(12px, 3.8vw, 18px);
}

.pick-sheet-options {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pick-sheet-team {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: clamp(34px, 12.5vw, 49px);
  padding-left: 3%;
  border-radius: clamp(11px, 4vw, 16px);
  background: #ffffff05;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.pick-sheet-team + .pick-sheet-team {
  background: #ffffff08;
}

.pick-sheet-team:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pick-sheet-team:has(input:checked) {
  background: #ffffff0d;
}

.pick-sheet-team input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pick-sheet-team img {
  width: clamp(24px, 9vw, 36px);
}

.pick-sheet-team strong {
  font: 700 clamp(12px, 3.8vw, 17px) var(--display-font);
  text-transform: uppercase;
}

.pick-sheet-select {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 35.6%;
  margin-left: auto;
  border-radius: inherit;
  background: #ffffff0f;
  color: #d9d9d9;
  transition: background-color 180ms ease, color 180ms ease;
}

.pick-sheet-select::before,
.pick-sheet-apply::before {
  width: 64%;
  aspect-ratio: 84 / 16;
  background: currentColor;
  mask: url("./design-assets/pick-sheet-select.svg") center / contain no-repeat;
  content: "";
}

.pick-sheet-team:has(input:checked) .pick-sheet-select {
  background: #4f4f4f;
  color: #fff;
}

.pick-sheet-select span,
.pick-sheet-team:has(input:checked) .pick-sheet-select::before {
  display: none;
}

.pick-sheet-team:has(input:checked) .pick-sheet-select span {
  display: block;
  font: italic 900 clamp(8px, 3vw, 12px) Arial, sans-serif;
  text-transform: uppercase;
}

.pick-sheet-apply {
  display: grid;
  place-items: center;
  min-height: clamp(34px, 12.5vw, 49px);
  border-radius: clamp(11px, 4vw, 16px);
  background: #fff;
  color: #202020;
  transition: background-color 180ms ease, color 180ms ease;
}

.pick-sheet-apply::before {
  width: 43.5%;
  aspect-ratio: 148 / 22;
  mask-image: url("./design-assets/pick-sheet-apply.svg");
}

.pick-sheet-apply:disabled {
  background: #404040;
  color: #777;
  cursor: default;
}

@keyframes pick-sheet-slide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pick-sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.figma-nav {
  height: calc(clamp(58px, 20.5vw, 80px) + env(safe-area-inset-bottom));
  padding: 0 0 env(safe-area-inset-bottom);
  gap: 0;
}

.figma-nav .nav-btn {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.figma-nav img {
  display: block;
  width: 100%;
  max-height: 48px;
  transition: filter 200ms ease;
}

.figma-nav .active img {
  filter: brightness(1.7);
}

.team-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tab-enter {
  animation: tab-enter 240ms ease both;
}

@keyframes tab-enter {
  from { opacity: .35; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tournament-matches,
  .tournament-toggle i,
  .figma-nav img,
  .pick-sheet,
  .pick-sheet-team,
  .pick-sheet-select,
  .pick-sheet-apply,
  .admin-match-tools-options,
  .admin-roster-tile {
    transition: none;
  }

  .tab-enter,
  .pick-sheet[open],
  .pick-sheet::backdrop {
    animation: none;
  }
}
