/* Rating site — Cyber Gorilla */
:root {
  --gold: #dcce36;
  --card: rgba(18, 0, 45, 0.88);
  --font: "Montserrat", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #05010a;
  color: #fff;
  font-family: var(--font);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/back.jpg") center / cover no-repeat;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.25rem 1.5rem;
  max-width: 100%;
}

.top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.brand img {
  height: 64px;
  width: auto;
  display: block;
}

.top-main {
  flex: 1;
  min-width: 12rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.top-main h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
}

.sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
}

.to-bracket {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(220, 206, 54, 0.45);
  color: var(--gold);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.to-bracket:hover {
  background: rgba(220, 206, 54, 0.12);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.tab {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1.05rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.tab:hover {
  border-color: rgba(220, 206, 54, 0.45);
  color: #fff;
}

.tab.is-active {
  border-color: var(--gold);
  background: rgba(220, 206, 54, 0.18);
  color: var(--gold);
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: min(320px, 100%);
}

.search-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.search input {
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  outline: none;
}

.search input:focus {
  border-color: rgba(220, 206, 54, 0.55);
}

.pos-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pos-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pos-btn {
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pos-btn:hover {
  border-color: rgba(220, 206, 54, 0.45);
  color: #fff;
}

.pos-btn.is-on {
  border-color: rgba(220, 206, 54, 0.7);
  background: rgba(220, 206, 54, 0.18);
  color: var(--gold);
}

.hint {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  align-self: flex-end;
}

.table-shell {
  border: 1px solid rgba(220, 206, 54, 0.28);
  border-radius: 12px;
  background: var(--card);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 206, 54, 0.55) rgba(18, 0, 45, 0.85);
}

.rating-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.78rem;
}

.rating-table th,
.rating-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  white-space: nowrap;
}

.rating-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a0f2a;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.rating-table th:hover,
.rating-table th.is-sorted {
  color: var(--gold);
}

.rating-table th .sort-mark {
  margin-left: 0.2rem;
  opacity: 0.85;
}

.rating-table th.sticky-player,
.rating-table td.sticky-player {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  min-width: 9rem;
  background: #161022;
}

.rating-table th.sticky-player {
  z-index: 4;
  background: #1a0f2a;
  cursor: pointer;
}

.rating-table th.sticky-pos,
.rating-table td.sticky-pos {
  position: sticky;
  left: 9rem;
  z-index: 3;
  text-align: center;
  min-width: 5.2rem;
  background: #161022;
}

.rating-table th.sticky-pos {
  z-index: 4;
  background: #1a0f2a;
}

.rating-table th.sticky-team,
.rating-table td.sticky-team {
  position: sticky;
  left: 14.2rem;
  z-index: 3;
  text-align: left;
  min-width: 8rem;
  background: #161022;
}

.rating-table th.sticky-team {
  z-index: 4;
  background: #1a0f2a;
}

.rating-table tbody tr:hover td {
  background: rgba(220, 206, 54, 0.08);
}

.rating-table tbody tr:hover td.sticky-player,
.rating-table tbody tr:hover td.sticky-pos,
.rating-table tbody tr:hover td.sticky-team,
.rating-table tbody tr:hover td.sticky-rating {
  background: #1f1630;
}

.rating-table th.sticky-rating,
.rating-table td.sticky-rating {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 4.8rem;
  background: #1c142c;
  box-shadow: -6px 0 12px rgba(0, 0, 0, 0.35);
  font-weight: 800;
  color: var(--gold);
}

.rating-table th.sticky-rating {
  z-index: 5;
  top: 0;
  background: #241833;
  color: var(--gold);
}

.player-name {
  font-weight: 700;
}

.pos-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}

.team-name {
  color: rgba(255, 255, 255, 0.7);
}

.impact-cell {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.empty {
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
}

.formula {
  margin-top: 1.25rem;
  padding: 1.1rem 1.2rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(220, 206, 54, 0.22);
  background: rgba(18, 0, 45, 0.72);
  backdrop-filter: blur(8px);
  max-width: 920px;
}

.formula h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.formula-lead {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.formula-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.formula-steps li {
  margin-bottom: 0.35rem;
}

.formula-steps code {
  font-size: 0.84em;
  color: #ffe14a;
}

.formula-weights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.formula-weights h3 {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}

.formula-weights p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

.formula-note {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

.formula-note a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.formula-note a:hover {
  color: #ffe14a;
}

.col-tip {
  position: fixed;
  z-index: 80;
  max-width: min(280px, calc(100vw - 16px));
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(12, 6, 24, 0.97);
  border: 1px solid rgba(220, 206, 54, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  pointer-events: none;
}

.col-tip[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page {
    padding: 0.85rem;
  }

  .brand img {
    height: 48px;
  }
}
