:root {
  --bg-a: #0a1224;
  --bg-b: #071d2f;
  --panel: rgba(8, 22, 40, 0.78);
  --panel-strong: #0e2948;
  --line: rgba(132, 183, 255, 0.2);
  --text: #e8f4ff;
  --muted: #9eb8d4;
  --accent: #ff7a1a;
  --accent-2: #00c2b8;
  --good: #15d189;
  --danger: #ff4d67;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 15%, #18416f 0%, transparent 40%),
    radial-gradient(circle at 80% 10%, #0f4f52 0%, transparent 35%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  background: #fd9628;
  top: -120px;
  right: -80px;
}

.bg-shape-b {
  width: 300px;
  height: 300px;
  background: #00beb5;
  bottom: -110px;
  left: -90px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1400px, 95vw);
  margin: 28px auto 32px;
  animation: fade-up 450ms ease-out;
}

.hero {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 23, 44, 0.78);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

h1 {
  margin: 6px 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.95;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.controls {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.controls label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input[type="number"] {
  width: 130px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(143, 190, 255, 0.35);
  background: rgba(6, 18, 34, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input[type="search"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(143, 190, 255, 0.35);
  background: rgba(6, 18, 34, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
}

.primary {
  background: linear-gradient(135deg, #ff7a1a, #ff4f49);
}

.ghost {
  background: #123155;
}

.names-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}

.name-field {
  display: block;
}

.name-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.name-field input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(143, 190, 255, 0.3);
  background: rgba(7, 20, 38, 0.82);
  color: var(--text);
  font: inherit;
}

.filters-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.filters-grid label {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.letter-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter-btn {
  min-width: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1b3e67;
  font-size: 0.78rem;
}

.letter-btn.is-active {
  background: linear-gradient(135deg, #00c2b8, #1598d1);
}

.letter-btn.is-muted {
  opacity: 0.45;
}

#metaInfo {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.flash-info {
  margin: 8px 0 0;
  color: #7ce6c8;
  font-size: 0.86rem;
  min-height: 1.2em;
}

.flash-info.is-error {
  color: #ff9aad;
}

.summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.summary-card strong {
  display: block;
  font-size: 1.1rem;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.table-shell {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 18, 35, 0.8);
  box-shadow: var(--shadow);
}

.table-scroll {
  max-height: 70vh;
  overflow: auto;
}

.challenge-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

.challenge-table th,
.challenge-table td {
  border-bottom: 1px solid rgba(138, 182, 240, 0.17);
  border-right: 1px solid rgba(138, 182, 240, 0.12);
  vertical-align: middle;
}

.challenge-table th {
  position: sticky;
  top: 0;
  background: #0f2c4d;
  z-index: 5;
  padding: 10px;
}

.challenge-table th:first-child,
.champion-col {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #0c2340;
}

.challenge-table th:first-child {
  z-index: 8;
}

.champion-col {
  min-width: 250px;
  width: 250px;
  padding: 8px 10px;
}

.champion-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.champion-wrap img {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  border: 1px solid rgba(161, 205, 255, 0.4);
}

.champion-row.is-logged .champion-wrap img {
  filter: grayscale(1) saturate(0.15);
  opacity: 0.72;
}

.champ-name {
  font-weight: 700;
}

.champ-title {
  font-size: 0.8rem;
  color: var(--muted);
}

.player-col {
  min-width: 190px;
  width: 190px;
  padding: 6px 8px;
}

.player-head {
  text-align: center;
}

.player-head small {
  display: block;
  color: #a9c7e8;
  font-size: 0.78rem;
  margin-top: 4px;
}

.cell-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rdy-btn {
  background: #12426f;
  flex: 1;
}

.rdy-btn.is-ready {
  background: linear-gradient(135deg, #14d78a, #0fa96e);
}

.not-btn {
  background: #5f2448;
}

.not-count {
  font-size: 0.82rem;
  color: #ffadc5;
  min-width: 50px;
}

.cell-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #14d78a, #0fa96e);
  font-weight: 700;
  font-size: 0.85rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .page {
    width: 96vw;
  }

  .champion-col {
    min-width: 205px;
    width: 205px;
  }

  .player-col {
    min-width: 168px;
    width: 168px;
  }

  .control-row button,
  .control-row input {
    flex: 1;
  }

  .letter-btn {
    min-width: 32px;
    padding: 7px 9px;
  }
}
