.match-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 14px;
}

.match-hero,
.match-panel,
.match-results,
.match-state {
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(620px 220px at 8% -30%, rgba(52, 211, 153, 0.12), transparent 65%),
    radial-gradient(620px 200px at 98% -40%, rgba(59, 130, 246, 0.14), transparent 66%),
    var(--bg2);
  box-shadow: 0 18px 34px rgba(3, 10, 25, 0.25);
}

.match-hero {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.match-hero__kicker {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(8, 13, 20, 0.58);
}

.match-hero h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.match-hero p {
  max-width: 70ch;
  color: var(--text-muted);
  line-height: 1.55;
}

.match-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.match-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.match-panel__head h2 {
  font-size: clamp(18px, 2vw, 24px);
}

.match-panel__hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-form {
  display: grid;
  gap: 12px;
}

.match-type {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.match-type__btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(8, 13, 20, 0.62);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-type__btn.is-active {
  border-color: var(--accent);
  background: rgba(102, 163, 255, 0.18);
}

.match-search {
  position: relative;
  display: grid;
  gap: 6px;
}

.match-search > span {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: "JetBrains Mono", monospace;
}

.match-search input {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 11px;
  font-size: 14px;
}

.match-search input:focus-visible {
  outline: 2px solid rgba(102, 163, 255, 0.6);
  outline-offset: 1px;
}

.match-search small {
  color: var(--text-dim);
  font-size: 11px;
}

.match-suggestions {
  position: absolute;
  top: calc(100% - 24px);
  left: 0;
  right: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(6, 11, 18, 0.98);
  z-index: 12;
  overflow: hidden;
}

.match-suggestions.is-hidden {
  display: none;
}

.match-suggestion {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: var(--text);
  width: 100%;
  padding: 9px;
  text-align: left;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  cursor: pointer;
}

.match-suggestion:last-child {
  border-bottom: 0;
}

.match-suggestion:hover,
.match-suggestion:focus-visible {
  background: rgba(102, 163, 255, 0.12);
}

.match-suggestion img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

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

.match-suggestion span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-dim);
}

.match-selection {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 20, 0.58);
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.match-selection.is-hidden {
  display: none;
}

.match-selection img {
  width: 54px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.match-selection strong {
  font-size: 13px;
  display: block;
}

.match-selection span {
  font-size: 11px;
  color: var(--text-dim);
}

.match-selection button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 6px 9px;
  font-size: 11px;
  cursor: pointer;
}

.match-submit {
  width: fit-content;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(102, 163, 255, 0.15);
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.match-submit:not(:disabled):hover {
  background: rgba(102, 163, 255, 0.22);
}

.match-state {
  display: none;
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.match-state.is-visible {
  display: block;
}

.match-results {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.match-results.is-hidden {
  display: none;
}

.match-results__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.match-results__head h2 {
  font-size: clamp(18px, 2vw, 26px);
}

.match-results__head p {
  color: var(--text-dim);
  font-size: 12px;
}

.match-source {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 13, 20, 0.62);
  padding: 10px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
}

.match-source img {
  width: 70px;
  height: 98px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.match-source strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.match-source span {
  color: var(--text-dim);
  font-size: 12px;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.match-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--bg);
  display: grid;
}

.match-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

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

.match-card__body {
  padding: 8px;
  display: grid;
  gap: 4px;
}

.match-card__title {
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.match-card__meta {
  font-size: 10px;
  color: var(--text-dim);
}

.match-card__pill {
  width: fit-content;
  border: 1px solid rgba(102, 163, 255, 0.45);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(102, 163, 255, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}

.match-card__reason {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.match-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.match-skeleton-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 286px;
  border-color: rgba(182, 213, 244, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 26, 42, 0.92), rgba(11, 20, 34, 0.94)),
    linear-gradient(108deg, rgba(120, 149, 180, 0.3) 22%, rgba(180, 214, 246, 0.58) 47%, rgba(120, 149, 180, 0.3) 72%);
  background-size: 100% 100%, 260% 100%;
  animation: matchSkeletonLayered 1.25s linear infinite;
}

.match-card--skeleton {
  pointer-events: none;
  position: relative;
  overflow: hidden;
  min-height: 290px;
  border-color: rgba(182, 213, 244, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 26, 42, 0.92), rgba(11, 20, 34, 0.94)),
    linear-gradient(108deg, rgba(120, 149, 180, 0.3) 22%, rgba(180, 214, 246, 0.58) 47%, rgba(120, 149, 180, 0.3) 72%);
  background-size: 100% 100%, 260% 100%;
  animation: matchSkeletonLayered 1.25s linear infinite;
  box-shadow: inset 0 0 0 1px rgba(190, 219, 246, 0.1), 0 14px 24px rgba(0, 0, 0, 0.24);
}

.match-skeleton-card::after,
.match-card--skeleton::after,
.match-suggestion--skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(235, 247, 255, 0.24) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: matchSkeletonSweep 1.35s ease-out infinite;
}

.match-card__skeleton-cover,
.match-card__skeleton-line,
.match-card__skeleton-pill {
  background: linear-gradient(105deg, rgba(114, 141, 172, 0.38) 18%, rgba(187, 220, 247, 0.62) 43%, rgba(114, 141, 172, 0.38) 67%);
  background-size: 240% 100%;
  animation: matchSkeleton 1.25s linear infinite;
}

.match-card__skeleton-cover {
  height: 208px;
  border-bottom: 1px solid rgba(190, 219, 246, 0.1);
}

.match-card__skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
}

.match-card__skeleton-line.w-95 {
  width: 95%;
}

.match-card__skeleton-line.w-90 {
  width: 90%;
}

.match-card__skeleton-line.w-70 {
  width: 70%;
}

.match-card__skeleton-line.w-60 {
  width: 60%;
}

.match-card__skeleton-pill {
  display: block;
  width: 48%;
  height: 24px;
  border-radius: 999px;
}

.match-suggestion--skeleton {
  pointer-events: none;
  position: relative;
  overflow: hidden;
  border-color: rgba(182, 213, 244, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 26, 42, 0.92), rgba(11, 20, 34, 0.94)),
    linear-gradient(108deg, rgba(120, 149, 180, 0.3) 22%, rgba(180, 214, 246, 0.58) 47%, rgba(120, 149, 180, 0.3) 72%);
  background-size: 100% 100%, 260% 100%;
  animation: matchSkeletonLayered 1.25s linear infinite;
}

.match-suggestion__skeleton-cover {
  width: 42px;
  height: 62px;
  border-radius: 8px;
  background: linear-gradient(105deg, rgba(114, 141, 172, 0.38) 18%, rgba(187, 220, 247, 0.62) 43%, rgba(114, 141, 172, 0.38) 67%);
  background-size: 240% 100%;
  animation: matchSkeleton 1.25s linear infinite;
}

.match-suggestion__skeleton-body {
  display: grid;
  gap: 6px;
}

.match-suggestion__skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(105deg, rgba(114, 141, 172, 0.38) 18%, rgba(187, 220, 247, 0.62) 43%, rgba(114, 141, 172, 0.38) 67%);
  background-size: 240% 100%;
  animation: matchSkeleton 1.25s linear infinite;
}

.match-suggestion__skeleton-line.w-80 {
  width: 80%;
}

.match-suggestion__skeleton-line.w-55 {
  width: 55%;
}

.match-pagination {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  min-height: 17px;
}

.match-sentinel {
  height: 4px;
}

.back-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: 0.18s ease;
  color: #fff;
  background: linear-gradient(135deg, #66a3ff, #3b82f6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.back-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top-btn:hover {
  transform: translateY(-3px);
}

@keyframes matchSkeleton {
  0% {
    background-position: 220% 0;
  }
  100% {
    background-position: -220% 0;
  }
}

@keyframes matchSkeletonLayered {
  0% {
    background-position: 0 0, 220% 0;
  }

  100% {
    background-position: 0 0, -20% 0;
  }
}

@keyframes matchSkeletonSweep {
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-skeleton-card,
  .match-card--skeleton,
  .match-card__skeleton-cover,
  .match-card__skeleton-line,
  .match-card__skeleton-pill,
  .match-suggestion__skeleton-cover,
  .match-suggestion__skeleton-line {
    animation: none;
  }

  .match-skeleton-card::after,
  .match-card--skeleton::after,
  .match-suggestion--skeleton::after {
    animation: none;
  }
}

@media (max-width: 860px) {
  .match-page {
    padding: 14px 10px;
  }

  .match-results__head {
    align-items: flex-start;
  }

  .match-grid,
  .match-skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  }

  .match-card__skeleton-cover {
    height: 190px;
  }
}

@media (max-width: 620px) {
  .match-hero,
  .match-panel,
  .match-results,
  .match-state {
    border-radius: 14px;
  }

  .match-source {
    grid-template-columns: 1fr;
  }

  .match-source img {
    width: 92px;
    height: 128px;
  }

  .match-grid,
  .match-skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .match-card__skeleton-cover {
    height: 172px;
  }
}

@media (max-width: 420px) {
  .match-page {
    padding: 10px 8px;
    gap: 10px;
  }

  .match-hero,
  .match-panel,
  .match-results,
  .match-state {
    border-radius: 12px;
  }

  .match-panel {
    padding: 12px;
  }

  .match-panel__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-grid,
  .match-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-card__skeleton-cover {
    height: 160px;
  }
}

@media (min-width: 1600px) {
  .match-page {
    max-width: 1520px;
    gap: 18px;
  }

  .match-grid,
  .match-skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  }
}

