:root {
  --bg: #090a14;
  --panel: #111321;
  --panel-2: #17192a;
  --text: #f8f8fb;
  --muted: #a9aabd;
  --line: rgba(255,255,255,0.10);
  --cyan: #45d9ff;
  --purple: #826cff;
  --pink: #f649a6;
  --yellow: #ffc953;
  --danger: #ff7474;
  --success: #62e5a1;
  --radius: 18px;
  --shadow: 0 18px 60px rgba(0,0,0,0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 85% 10%, rgba(246,73,166,0.12), transparent 30%),
    radial-gradient(circle at 10% 30%, rgba(69,217,255,0.09), transparent 28%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255,255,255,0.45) 1px, transparent 1px);
  background-size: 62px 62px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.narrow { width: min(760px, calc(100% - 32px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8,9,18,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  box-shadow: 0 10px 30px rgba(130,108,255,0.35);
}

.brand strong { display: block; letter-spacing: 0.03em; }
.brand small { display: block; color: var(--cyan); font-weight: 800; letter-spacing: 0.12em; }

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

nav a:hover,
nav a.active {
  color: white;
  background: rgba(255,255,255,0.08);
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: white;
  border-radius: 10px;
  padding: 8px 11px;
}

.page-section {
  display: none;
  min-height: calc(100vh - 82px);
  padding: 76px 0;
}

.page-section.active { display: block; }

.hero { padding-top: 88px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.6fr);
  gap: 60px;
  align-items: center;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1 {
  margin: 18px 0 22px;
  max-width: 900px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

h1 span {
  display: block;
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  background-clip: text;
  -webkit-background-clip: text;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.045em;
}

.hero h2 {
  color: var(--yellow);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

.intro {
  max-width: 720px;
  color: #d7d7e3;
  font-size: 1.15rem;
  line-height: 1.7;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  border: 0;
  cursor: pointer;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 850;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.button.primary {
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  color: #090a14;
}

.button.secondary {
  color: white;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
}

.button.small { padding: 9px 12px; }

.hero-card,
.panel,
.table-card,
.player-card,
.result-card,
.rules-list article {
  background: linear-gradient(145deg, rgba(24,26,45,0.95), rgba(13,14,26,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card { padding: 28px; }

.card-label {
  color: var(--yellow);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-weight: 900;
}

.leader-card h3 {
  margin: 10px 0 4px;
  font-size: 2.3rem;
}

.leader-card .rating {
  color: var(--cyan);
  font-weight: 900;
  font-size: 1.4rem;
}

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

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.notice {
  border: 1px solid rgba(69,217,255,0.25);
  background: rgba(69,217,255,0.06);
  color: #d9f8ff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.notice.warning {
  border-color: rgba(255,201,83,0.30);
  background: rgba(255,201,83,0.08);
  color: #ffe8ad;
}

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }

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

th, td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: none; }

.rank-number {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  font-weight: 900;
}

.rating-cell { color: var(--cyan); font-weight: 900; }

.panel { padding: 26px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #e4e4ed;
  font-weight: 750;
}

input, select, textarea {
  width: 100%;
  color: white;
  background: #0d0f1c;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(130,108,255,0.15);
}

.full-width { grid-column: 1 / -1; }

.submit-summary {
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 11px;
  color: var(--muted);
}

.form-message { min-height: 1.5em; color: var(--muted); }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

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

.result-card,
.player-card { padding: 22px; }

.result-score {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 16px 0;
  font-size: 1.1rem;
}

.result-score strong { font-size: 1.5rem; }
.result-meta, .muted { color: var(--muted); }

.rating-change.positive { color: var(--success); }
.rating-change.negative { color: var(--danger); }

.player-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  color: #090a14;
  font-size: 1.4rem;
  font-weight: 950;
}

.player-card h3 { margin-bottom: 6px; }
.player-card .nickname { color: var(--yellow); font-weight: 850; }

.rules-list {
  display: grid;
  gap: 16px;
}

.rules-list article { padding: 22px; }
.rules-list h3 { margin-top: 0; }
.rules-list p { color: #d3d3df; line-height: 1.65; }

.inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.inline-form input { flex: 1; }

.hidden { display: none !important; }

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0;
  text-align: center;
}

@media (max-width: 900px) {
  .hero-grid,
  .results-grid,
  .players-grid {
    grid-template-columns: 1fr;
  }

  .hero-card { max-width: 520px; }

  .menu-button { display: block; }

  nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #0d0f1c;
    box-shadow: var(--shadow);
  }

  nav.open { display: flex; }
}

@media (max-width: 640px) {
  .page-section { padding: 50px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .inline-form { flex-direction: column; align-items: stretch; }
  h1 { font-size: clamp(3.4rem, 17vw, 5.2rem); }
}


.player-intro {
  margin-top: -8px;
  margin-bottom: 28px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-header h3 {
  margin: 0 0 5px;
  font-size: 1.55rem;
}

.profile-bio {
  color: #d7d7e3;
  line-height: 1.65;
  min-height: 78px;
}

.profile-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  border-radius: 11px;
}

.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 1.15rem;
}

.edit-result-button {
  margin-top: 10px;
}


.scoring-banner strong {
  color: var(--cyan);
}

.career-motto {
  margin: 4px 0 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--yellow);
  background: rgba(255, 201, 83, 0.06);
  border-radius: 0 10px 10px 0;
}

.career-motto span {
  display: block;
  margin-bottom: 6px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.career-motto blockquote {
  margin: 0;
  color: #f0f0f5;
  font-style: italic;
  line-height: 1.5;
}
