.avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  overflow: hidden;
}

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

.profile-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 26px;
}

.mini-table td[colspan] {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.ranking-tabs .active {
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  color: #fff;
  box-shadow: 0 10px 22px #711d7830;
}

.prediction-stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.prediction-stage-tabs .active {
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  color: #fff;
  box-shadow: 0 10px 22px #711d7830;
}

.prediction-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
}

.groups-grid.playoff-mode {
  display: block;
}

.playoff-bracket-scroll {
  overflow-x: auto;
  padding: 4px 2px 14px;
}

.playoff-bracket {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 20px;
  min-width: 1150px;
  align-items: stretch;
}

.playoff-column {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}

.playoff-column:not(:last-child)::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: -17px;
  z-index: 2;
  color: var(--violet);
  font-size: 25px;
  font-weight: 900;
  transform: translateY(-50%);
}

.playoff-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 10px;
}

.playoff-column > header strong {
  font-size: 14px;
}

.playoff-column > header span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f2e8f5;
  color: var(--violet);
  font-size: 10px;
  font-weight: 900;
}

.playoff-column-matches {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 9px;
}

.playoff-match {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, .06);
}

.playoff-match.complete {
  border-color: #afe5bf;
  background: #f5fcf7;
}

.playoff-match-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #eef2f7;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.playoff-team-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
}

.playoff-team-row + .playoff-team-row {
  border-top: 1px solid #f1f3f7;
}

.playoff-team-row input {
  width: 32px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.playoff-match .lock-label {
  display: block;
  margin: 0;
  padding: 5px 8px 7px;
}

.playoff-stage-empty {
  display: grid;
  min-height: 90px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.playoff-final {
  background: linear-gradient(180deg, rgba(217, 155, 19, .12), rgba(255, 255, 255, .82));
  border-color: rgba(217, 155, 19, .4);
}

@media (max-width: 720px) {
  .playoff-bracket-scroll {
    margin-right: -14px;
    padding-right: 14px;
  }
}

.result-save-button {
  min-width: 92px;
  width: auto;
  padding: 8px 12px;
  line-height: 1;
  white-space: nowrap;
  justify-self: end;
}

.stages-admin-grid,
.matches-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.stage-form,
.match-form {
  display: grid;
  gap: 10px;
}

.stage-form label,
.match-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stage-form input,
.match-form input,
.match-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  padding: 9px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
}

.checkbox-line input {
  width: auto;
}

.stage-admin-list,
.match-admin-list {
  display: grid;
  gap: 8px;
}

.stage-admin-card,
.match-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #f8fafc;
}

.stage-admin-card strong,
.stage-admin-card span,
.stage-admin-card small,
.match-admin-card strong,
.match-admin-card span,
.match-admin-card small {
  display: block;
}

.stage-admin-card span,
.match-admin-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stage-admin-card small,
.match-admin-card small {
  margin-top: 3px;
  color: #a15712;
  font-size: 10px;
  font-weight: 900;
}

.stage-admin-card.frozen {
  border-color: #bbebc9;
  background: #f1fbf4;
}

.stage-admin-card.frozen small {
  color: #15803d;
}

.stage-card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stage-card-actions button[disabled] {
  cursor: not-allowed;
  opacity: .65;
}

.results-group-card {
  overflow: visible;
}

.results-group-card .group-matches {
  gap: 0;
  padding-bottom: 8px;
}

.result-admin-row {
  grid-template-columns: 52px 22px minmax(0, 1fr) 34px 34px minmax(0, 1fr) 22px minmax(96px, auto);
  gap: 6px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
}

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

.result-admin-row input {
  align-self: center;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f2e8f5;
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.level-panel.level-master,
.level-badge.level-master {
  background: linear-gradient(135deg, #eef7ff, #f8fbff);
  border-color: #9bd3ff;
}

.level-panel.level-legend,
.level-badge.level-legend {
  background: linear-gradient(135deg, #fff7df, #fff);
  border-color: #f7c948;
}

.level-panel.level-world-champion,
.level-badge.level-world-champion {
  background: linear-gradient(135deg, #2b1039, #76237d 55%, #d99b13);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
}

.level-badge.level-master::before {
  content: "◆";
  margin-right: 6px;
}

.level-badge.level-legend::before {
  content: "★";
  margin-right: 6px;
}

.level-badge.level-world-champion::before {
  content: "♛";
  margin-right: 6px;
}

.level-panel.level-master .pill,
.level-panel.level-legend .pill {
  background: #fff;
}

.level-panel.level-world-champion h3,
.level-panel.level-world-champion p {
  color: #fff;
}

.level-panel.level-world-champion .pill {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.level-panel.level-world-champion .xp-bar {
  background: rgba(255, 255, 255, .22);
}

.level-panel.level-world-champion .xp-bar i {
  background: linear-gradient(90deg, #f7c948, #fff);
}

.faq-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(155, 42, 163, .16), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8f3fb);
}

.faq-hero h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.faq-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.faq-mark {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 16px 30px rgba(113, 29, 120, .22);
}

.faq-head {
  align-items: flex-end;
}

.faq-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.faq-search {
  width: min(100%, 360px);
}

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

.faq-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.faq-question {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
  font-weight: 900;
}

.faq-question i {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-style: normal;
  color: var(--violet);
  background: #f2e8f5;
}

.faq-answer-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}

.faq-item.open .faq-answer-wrap {
  max-height: 1600px;
}

.faq-answer {
  padding: 0 18px 16px;
  color: var(--muted);
  line-height: 1.58;
  font-size: 14px;
}

.faq-answer p {
  margin: 0 0 10px;
}

.faq-answer h4 {
  margin: 14px 0 6px;
  color: var(--violet);
}

.faq-answer ul,
.faq-answer ol {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.faq-empty {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.faq-empty strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .faq-hero,
  .faq-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .faq-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 32px;
  }

  .faq-search {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .stages-admin-grid,
  .matches-admin-grid,
  .stage-admin-card,
  .match-admin-card {
    grid-template-columns: 1fr;
  }

  .stage-card-actions {
    justify-content: stretch;
  }

  .stage-card-actions button {
    flex: 1;
  }

  .result-admin-row {
    grid-template-columns: 48px 22px minmax(0, 1fr) 34px 34px minmax(0, 1fr) 22px;
    row-gap: 8px;
    padding: 10px;
  }

  .result-admin-row .result-save-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}
