:root {
  --bg: #f4f6f1;
  --panel: #ffffff;
  --ink: #162016;
  --muted: #647062;
  --line: #d9dfd4;
  --green: #187747;
  --green-soft: #e4f3eb;
  --gold: #d7b66d;
  --gold-soft: #fff4d1;
  --red: #ad2d22;
  --brand-red: #c8102e;
  --felt: #07120b;
  --felt-2: #141914;
  --shadow: 0 18px 40px rgba(22, 32, 22, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
}

button:hover {
  border-color: var(--green);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  align-items: end;
  padding: 34px clamp(16px, 5vw, 56px);
  background:
    linear-gradient(122deg, rgba(5, 6, 5, 0.98), rgba(17, 24, 18, 0.98) 58%, rgba(34, 8, 12, 0.88)),
    linear-gradient(90deg, rgba(200, 16, 46, 0.16), transparent 28%, rgba(215, 182, 109, 0.12)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 64px);
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: clamp(16px, 5vw, 56px);
  right: clamp(16px, 5vw, 56px);
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.92), rgba(215, 182, 109, 0.72), transparent);
  opacity: 0.72;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
}

.hero-copy {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.brand-lockup {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid rgba(215, 182, 109, 0.24);
  border-left-color: rgba(200, 16, 46, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  padding: 5px 13px 5px 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-lockup img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.brand-lockup span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(42px, 6.4vw, 82px);
  max-width: 1060px;
  white-space: nowrap;
}

.hero-text {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.35;
}

h2 {
  font-size: 21px;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.status span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(215, 182, 109, 0.16);
  background: rgba(255, 255, 255, 0.11);
  white-space: nowrap;
  font-size: 13px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  gap: 10px;
  min-width: min(340px, 100%);
}

.hero-stats div {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(215, 182, 109, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(10, 14, 10, 0.18);
  padding: 16px;
  backdrop-filter: blur(8px);
}

.hero-stats div::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 8px solid rgba(200, 16, 46, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(215, 182, 109, 0.2),
    0 0 0 1px rgba(215, 182, 109, 0.06);
  pointer-events: none;
}

.hero-stats strong {
  color: #ffffff;
  font-size: 38px;
  line-height: 1;
}

.hero-stats span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-transform: uppercase;
}

.hero-logo-mark {
  position: absolute;
  right: clamp(18px, 5vw, 64px);
  bottom: 28px;
  width: min(220px, 18vw);
  max-height: 170px;
  object-fit: contain;
  object-position: right center;
  opacity: 0.08;
  filter: grayscale(1) brightness(1.8);
  pointer-events: none;
}

.hero-mark {
  position: absolute;
  right: clamp(10px, 3vw, 46px);
  top: 24px;
  display: flex;
  gap: 8px;
  opacity: 0.1;
  transform: rotate(-5deg);
}

.hero-mark span {
  width: 54px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 182, 109, 0.3);
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.055);
}

main {
  padding: 24px clamp(16px, 4vw, 48px) 40px;
}

.toolbar,
.admin,
.summary,
.podium-section,
.table-wrap {
  max-width: 1180px;
  margin: 0 auto 14px;
}

.podium-section {
  display: grid;
  gap: 14px;
  margin-top: -58px;
  position: relative;
  z-index: 2;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 0 4px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.podium {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.16fr) minmax(0, 0.92fr);
  gap: 12px;
  align-items: end;
}

.podium-card {
  width: 100%;
  min-height: 196px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 8px;
  border: 1px solid rgba(22, 32, 22, 0.1);
  border-top: 3px solid rgba(200, 16, 46, 0.74);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f7faf4);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.podium-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 16, 46, 0.42);
  border-top-color: var(--brand-red);
  box-shadow: 0 22px 46px rgba(22, 32, 22, 0.14);
}

.podium-rank-1 {
  min-height: 238px;
  border-color: rgba(215, 182, 109, 0.42);
  border-top-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 246, 218, 0.96), #ffffff 62%),
    linear-gradient(135deg, rgba(198, 147, 47, 0.18), transparent);
}

.podium-rank {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--felt);
  color: white;
  font-weight: 700;
}

.podium-rank-1 .podium-rank {
  background: var(--gold);
  color: #1a1306;
}

.podium-name {
  color: var(--ink);
  font-size: clamp(20px, 2.4vw, 29px);
  font-weight: 700;
  line-height: 1.1;
  white-space: normal;
}

.podium-card strong {
  color: var(--brand-red);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 0.95;
}

.podium-rank-1 strong {
  color: #9a6f16;
}

.podium-meta {
  color: var(--muted);
  font-size: 14px;
  white-space: normal;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.search {
  display: grid;
  gap: 6px;
  width: min(460px, 100%);
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0 12px;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(200, 16, 46, 0.15);
  border-color: var(--brand-red);
}

.toolbar-actions,
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin.hidden {
  display: none;
}

.admin p {
  margin: 8px 0 0;
  color: var(--muted);
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.import-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary div {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.summary strong {
  font-size: 28px;
}

.summary span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111811;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

td:first-child,
th:first-child,
td:nth-child(4),
td:nth-child(5),
th:nth-child(4),
th:nth-child(5) {
  text-align: right;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #fffaf0;
}

.qualified {
  background: linear-gradient(90deg, rgba(255, 244, 209, 0.72), rgba(255, 255, 255, 0.96));
}

.bubble {
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.08), rgba(255, 255, 255, 0.96));
}

.rank-pill {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(22, 32, 22, 0.08);
  background: #f2eee4;
  color: var(--ink);
  font-weight: 700;
}

.rank-pill.rank-top {
  border-color: rgba(215, 182, 109, 0.52);
  background: linear-gradient(135deg, #141914, #2a1719);
  color: var(--gold);
}

.rank-top {
  color: var(--brand-red);
  font-weight: 700;
}

.player-main {
  font-weight: 700;
}

.status-qualified {
  background: #141914;
  color: var(--gold);
}

.status-bubble {
  background: var(--gold-soft);
  color: #7a540b;
}

.status-waiting {
  background: #eef0ea;
  color: var(--muted);
}

.cutline-row td {
  padding: 9px 14px;
  background: #101710;
  color: rgba(255, 255, 255, 0.74);
  text-align: center !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.cutline-row span {
  color: #d7b66d;
  margin-right: 8px;
  text-transform: uppercase;
}

.negative {
  color: var(--red);
}

dialog {
  width: min(820px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.36);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#closeDialog {
  width: 38px;
  padding: 0;
  font-size: 24px;
}

#playerDetails {
  padding: 18px;
}

.player-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(24, 119, 71, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(228, 243, 235, 0.9), rgba(255, 255, 255, 0.98)),
    #fff;
  padding: 16px;
  margin-bottom: 14px;
}

.player-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.player-card-head > div {
  display: grid;
  justify-items: end;
}

.player-card-head strong {
  color: var(--green);
  font-size: 42px;
  line-height: 1;
}

.player-card-head span {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.detail-grid strong {
  display: block;
  margin-bottom: 3px;
}

.empty {
  color: var(--muted);
}

.detail-table {
  max-width: none;
  margin-top: 14px;
  box-shadow: none;
}

@media (max-width: 760px) {
  .hero {
    min-height: auto;
    align-items: start;
    padding: 30px 16px 22px;
  }

  .hero::before {
    inset: 10px;
    border-radius: 12px;
  }

  .hero-inner,
  .toolbar {
    display: grid;
    align-items: start;
  }

  .hero-inner {
    gap: 18px;
  }

  .hero-copy {
    gap: 10px;
  }

  .brand-lockup {
    min-height: 34px;
    padding: 4px 11px 4px 6px;
  }

  .brand-lockup img {
    width: 24px;
    height: 24px;
  }

  .brand-lockup span {
    font-size: 12px;
  }

  .hero-text {
    max-width: 100%;
    font-size: 17px;
  }

  .podium-section {
    display: none;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .hero-stats div {
    min-height: 86px;
    padding: 12px;
  }

  .hero-stats div::after {
    width: 64px;
    height: 64px;
    right: -18px;
    bottom: -22px;
    border-width: 6px;
  }

  .hero-stats strong {
    font-size: 30px;
  }

  .hero-mark {
    display: none;
  }

  .hero-logo-mark {
    display: none;
  }

  h1 {
    white-space: normal;
    font-size: clamp(38px, 10.6vw, 54px);
    line-height: 1;
  }

  .status,
  .toolbar-actions {
    justify-content: start;
  }

  .status span,
  .badge {
    min-height: 26px;
    font-size: 12px;
  }

  main {
    padding: 18px 12px 34px;
  }

  .toolbar {
    gap: 10px;
  }

  .table-wrap {
    border-radius: 7px;
  }

  th,
  td {
    padding: 11px 10px;
  }

  th {
    font-size: 12px;
  }

  .rank-pill {
    min-width: 30px;
    min-height: 28px;
  }

  .player-main {
    font-size: 15px;
  }

  .cutline-row td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .import-grid,
  .summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .player-card-head {
    align-items: start;
  }

  .player-card-head strong {
    font-size: 34px;
  }
}

@media (max-width: 420px) {
  .hero {
    padding: 26px 14px 20px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(34px, 12vw, 46px);
  }

  .podium-meta {
    font-size: 13px;
  }

}
