:root {
  --bg-top: #f3a93f;
  --bg-bottom: #5f3a1f;
  --ink: #20140c;
  --paper: #f9e6c8;
  --card: rgba(248, 224, 184, 0.94);
  --line: rgba(65, 37, 17, 0.24);
  --accent: #d4661f;
  --accent-2: #7e4320;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, var(--bg-top) 0%, #c2722f 42%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

body.page-home {
  --hero-title-bg: url("../img/hero/home-h1-bg.png");
}

body.page-rules {
  --hero-title-bg: url("../img/hero/rules-h1-bg.png");
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: 0.6;
}

.bg-shape-a {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, #fbd58c 0%, rgba(251, 213, 140, 0) 70%);
}

.bg-shape-b {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -80px;
  background: radial-gradient(circle, #7a3a19 0%, rgba(122, 58, 25, 0) 70%);
}

.page {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 18px 60px;
}

.hero {
  text-align: center;
  padding: 26px 14px 22px;
  animation: rise 700ms ease-out;
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  margin: 0;
  font-weight: 800;
  color: #fbe3ba;
}

h1 {
  margin: 12px 0 8px;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
  color: #fef3e2;
  text-shadow: 0 3px 0 rgba(64, 35, 17, 0.25);
}

.hero-title-shell {
  position: relative;
  margin: 12px auto 18px;
  width: min(860px, calc(100% - 8px));
  min-height: 96px;
  padding: 14px 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(82, 40, 19, 0.56) 0%, rgba(49, 25, 12, 0.44) 100%);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.hero-title-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-title-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
}

.hero-title-shell::after {
  content: none;
}

.hero-title-shell h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.95),
    0 4px 0 rgba(0, 0, 0, 0.8),
    0 7px 14px rgba(0, 0, 0, 0.75),
    0 12px 26px rgba(0, 0, 0, 0.65);
}

.subtitle {
  margin: 0 auto;
  max-width: 700px;
  color: #fbe8cb;
  font-size: clamp(1rem, 2vw, 1.18rem);
  position: relative;
  z-index: 2;
}

.meta-row {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.season-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(88, 45, 19, 0.22);
  border: 1px solid rgba(255, 230, 191, 0.36);
  border-radius: 999px;
  padding: 8px 12px;
}

.season-form label {
  color: #ffe8c2;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.season-form select {
  border: 0;
  outline: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  color: #4e2a13;
  background: #ffe8c2;
}

.source {
  margin: 0;
  font-size: 0.88rem;
  color: #ffe5bd;
  opacity: 0.9;
}

.panel {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(45, 24, 12, 0.28);
  animation: rise 950ms ease-out;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.panel-head a {
  font-weight: 700;
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

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

.panel-head a:hover {
  border-bottom-color: var(--accent-2);
}

.table-wrap {
  overflow-x: auto;
  padding: 8px 12px 14px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 8px 14px 16px;
}

.community-card {
  border: 1px solid rgba(104, 53, 24, 0.25);
  background: linear-gradient(160deg, #f7ddb3 0%, #efc588 100%);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.community-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(61, 31, 13, 0.22);
}

.card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.rank-pill {
  background: #6a3519;
  color: #ffe5bc;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.card-top h3 {
  margin: 0;
  font-size: 1.2rem;
}

.points {
  font-weight: 800;
  color: #693515;
}

.card-stats {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-stats p {
  margin: 0;
  background: rgba(255, 244, 223, 0.65);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.85rem;
}

.toggle-btn {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff5e6;
  font-weight: 800;
  padding: 9px 10px;
  cursor: pointer;
}

.players-panel {
  margin-top: 18px;
}

.hint {
  margin: 0;
  font-size: 0.9rem;
  color: #5f341b;
}

.players-block {
  display: none;
  border-top: 1px solid rgba(65, 37, 17, 0.18);
  padding-top: 8px;
}

.players-block.active {
  display: block;
}

.players-title {
  padding: 10px 16px 0;
}

.players-title h3 {
  margin: 0;
}

.rules-panel {
  margin-top: 8px;
}

.rules-body {
  padding: 10px 14px 16px;
  display: grid;
  gap: 12px;
}

.rule-card {
  border: 1px solid rgba(71, 37, 17, 0.2);
  border-radius: 12px;
  background: rgba(252, 238, 214, 0.6);
  padding: 12px;
}

.rule-card h3 {
  margin: 0 0 8px;
}

.formula {
  margin: 0;
  font-weight: 800;
  color: #5d2f14;
  word-break: break-word;
}

.rule-card ul {
  margin: 0;
  padding-left: 20px;
}

.rule-card li {
  margin-bottom: 7px;
}

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

thead th {
  text-align: left;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #593017;
  padding: 14px 14px;
  border-bottom: 2px solid rgba(65, 37, 17, 0.25);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(65, 37, 17, 0.12);
  font-weight: 600;
}

tbody tr:hover {
  background: rgba(245, 197, 132, 0.32);
}

tbody tr:nth-child(1) td {
  background: linear-gradient(90deg, rgba(212, 102, 31, 0.22), rgba(212, 102, 31, 0));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .page {
    padding-top: 26px;
  }

  .hero-title-shell {
    min-height: 80px;
    padding: 12px;
    border-radius: 14px;
  }

  .panel-head {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .head-links {
    gap: 8px;
    flex-wrap: wrap;
  }

  table {
    min-width: 560px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}
