/* ==========================================================================
   KittenPvP Club — kittenpvpofficial.club
   Tokens first, then layout, then components.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #faf9fb;
  --surface: #ffffff;
  --text: #191820;
  --text-muted: #6b6a76;
  --border: #e6e3ea;
  --code-bg: #f2f0f4;

  /* Brand: red → pink */
  --accent: #e11d48;
  --accent-2: #f0459a;
  --accent-strong: #be123c;
  --accent-soft: rgba(225, 29, 72, 0.08);
  --gradient-accent: linear-gradient(100deg, #e11d48 0%, #f0459a 58%, #ff86c8 100%);
  --glow-red: rgba(225, 29, 72, 0.15);
  --glow-pink: rgba(240, 69, 154, 0.15);

  --shadow: 0 1px 3px rgba(22, 10, 32, 0.06), 0 4px 14px rgba(22, 10, 32, 0.05);
  --shadow-hover: 0 2px 6px rgba(22, 10, 32, 0.08), 0 10px 28px rgba(22, 10, 32, 0.1);
  --topbar-bg: rgba(250, 249, 251, 0.72);
  --online: #1f9d6b;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #100f14;
  --surface: #191820;
  --text: #f1eff5;
  --text-muted: #b1adbd;
  --border: #2b2833;
  --code-bg: #232129;

  --accent: #ff4d6d;
  --accent-2: #ff7ac0;
  --accent-strong: #ff2d62;
  --accent-soft: rgba(255, 77, 109, 0.12);
  --gradient-accent: linear-gradient(100deg, #ff4d6d 0%, #ff6aa8 58%, #ff9ad4 100%);
  --glow-red: rgba(255, 60, 95, 0.22);
  --glow-pink: rgba(255, 110, 180, 0.2);

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.42);
  --topbar-bg: rgba(16, 15, 20, 0.72);
  --online: #35c48a;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3 {
  line-height: 1.22;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 0.75rem;
}

code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--code-bg);
  font-family: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* ---------- red/pink backdrop ---------- */

.glow {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: -1;
  height: 460px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 52% 78% at 16% -14%, var(--glow-red), transparent 70%),
    radial-gradient(ellipse 52% 78% at 84% -8%, var(--glow-pink), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 100%);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  transition: border-color 0.2s ease, background-color 0.25s ease;
}

.topbar.scrolled {
  border-bottom-color: var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.topnav-link {
  position: relative;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.topnav-link:hover {
  color: var(--accent);
}

.topnav-link[aria-current='page'] {
  color: var(--accent);
}

.topnav-link[aria-current='page']::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -0.35rem;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.2s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

:root[data-theme='dark'] .icon-moon,
:root:not([data-theme='dark']) .icon-sun {
  display: none;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.container.home {
  flex: 1;
  display: grid;
  align-content: center;
  row-gap: 1.4rem;
  max-width: 1150px;
  padding: 1rem 1.5rem 2.5rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* ---------- home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  width: 100%;
}

.hero-copy {
  text-align: center;
}

.hero-title {
  max-width: 34rem;
  margin: 0 auto;
  font-size: clamp(1.55rem, 2.7vw, 2.05rem);
  font-weight: 650;
  line-height: 1.35;
}

.hero-brand {
  display: inline-block;
  padding-right: 0.06em;
  font-size: 1.16em;
  font-weight: 800;
  letter-spacing: -0.035em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 30rem;
  margin: 0.7rem auto 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.hero-media {
  margin: 0;
}

.hero-media img {
  display: block;
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ---------- server IP ---------- */

.ip-wrap {
  position: relative;
  display: inline-block;
  margin-top: 1.6rem;
}

.ip-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ip-text:hover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: 0 8px 22px var(--glow-red);
}

.ip-line {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.ip-text code {
  padding: 0;
  background: none;
  font-size: clamp(1.15rem, 3.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.ip-text .copy-icon {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.ip-text:hover .copy-icon {
  color: var(--accent);
}

.ip-text .copy-icon svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ip-text .icon-check {
  color: var(--online);
  opacity: 0;
  transform: scale(0.4) rotate(-20deg);
}

.ip-text.copied .icon-copy {
  opacity: 0;
  transform: scale(0.4);
}

.ip-text.copied .icon-check {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.ip-text.copied:hover .copy-icon {
  color: var(--online);
}

.ip-note {
  margin-top: -0.15rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.player-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 1.4rem;
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.player-count[hidden] {
  display: none;
}

.player-dot {
  position: relative;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--online);
}

.player-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--online);
  animation: player-pulse 2s ease-out infinite;
}

@keyframes player-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* ---------- tier list chip ---------- */

.tiertest-chip {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tiertest-chip:hover {
  color: var(--text);
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient-accent) border-box;
  box-shadow: 0 10px 26px var(--glow-pink);
  transform: translateY(-1px);
}

.tiertest-chip svg {
  transition: transform 0.2s ease;
}

.tiertest-chip:hover svg {
  transform: translateX(3px);
}

/* ---------- rules / policy ---------- */

.rules {
  position: relative;
  overflow: hidden;
  margin-top: 1.5rem;
  padding: 2.25rem 2.5rem;
  counter-reset: rule;
}

.rules::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient-accent);
}

.rules h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
}

.rules .lead {
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.rules h2 {
  counter-increment: rule;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2rem 0 0.6rem;
  font-size: 1.12rem;
  font-weight: 700;
}

.rules h2::before {
  content: counter(rule);
  flex-shrink: 0;
  align-self: center;
  display: grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rules ul {
  margin: 0.4rem 0 0;
  padding-left: 1.6rem;
  color: var(--text-muted);
}

.rules li {
  margin: 0.35rem 0;
}

.rules a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.rules a:hover {
  color: var(--accent);
}

.rules .updated {
  margin: 2.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.policy h2::before {
  content: none;
}

.policy h2 {
  counter-increment: none;
  margin-top: 1.75rem;
}

/* ---------- footer ---------- */

.footer {
  margin-top: auto;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.footer a:hover {
  color: var(--accent);
}

/* ---------- tier testing ---------- */

.brand-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.topnav-link {
  white-space: nowrap;
}

.callout {
  margin: 1.1rem 0;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.95rem;
}

.callout code {
  background: var(--surface);
}

.callout strong {
  color: var(--text);
}

.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 1.6rem;
  padding: 0;
  list-style: none;
}

.kit-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.kit-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--glow-red);
}

.kit-thumb {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.7rem 0.5rem 0.2rem;
}

.kit-thumb img {
  display: block;
  width: 100%;
  max-width: 120px;
  height: auto;
}

.kit-byo {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kit-label {
  padding: 0.1rem 0.6rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.step-shot {
  margin: 1.05rem 0;
}

.step-shot img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.faq-section {
  margin-top: 2.25rem;
}

.faq-section > h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
}

.faq {
  display: grid;
  gap: 0.6rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.faq details[open] {
  border-color: var(--accent);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.05rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  border-color: var(--accent);
}

.faq details > p,
.faq details > ul {
  margin: 0 0 0.9rem;
  padding: 0 1.05rem;
  color: var(--text-muted);
}

.faq details > ul {
  padding-left: 2.1rem;
}

.faq details > p + ul {
  margin-top: -0.4rem;
}

.faq a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq strong {
  color: var(--text);
}

.faq details[id] {
  scroll-margin-top: 90px;
}

/* ---------- home call to action ---------- */

.cta-row {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.tiertest-chip--primary {
  border-color: transparent;
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 8px 22px var(--glow-red);
}

.tiertest-chip--primary:hover {
  border-color: transparent;
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 12px 28px var(--glow-pink);
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .container.home {
    align-content: start;
    padding-top: 0.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-media {
    order: -1;
  }

  .hero-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 0.55rem 1rem;
  }

  .brand-logo {
    height: 32px;
    width: auto;
  }

  .brand-name {
    font-size: 1rem;
  }

  .topnav {
    gap: 0.55rem;
  }

  .topnav-link {
    font-size: 0.8rem;
  }

  .callout {
    font-size: 0.9rem;
  }

  .kit-grid {
    gap: 0.6rem;
  }

  .kit-label {
    font-size: 0.82rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .container {
    padding: 0.5rem 1rem 3rem;
  }

  .rules {
    padding: 1.6rem 1.15rem;
  }

  .rules h2 {
    font-size: 1.02rem;
  }

  .ip-text code {
    font-size: 1.05rem;
  }
}

@media (max-width: 520px) {
  /* The logo already carries the wordmark, so drop the duplicate text and keep every nav link. */
  .brand-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .player-dot::after {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 520px) {
  /* auto-fill can only fit one 136px track here, so pin two columns instead. */
  .kit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kit-thumb img {
    max-width: 104px;
  }
}

@media (max-width: 359px) {
  /* Four links plus the toggle stop fitting; the store is the one that lives elsewhere. */
  .topnav-link[href*='store.'] {
    display: none;
  }
}

.tier-counts {
  width: min(100% - 2rem, 1120px);
  margin: 3rem auto 0;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tier-counts-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.tier-counts-head h2 {
  margin: 0.2rem 0 0.35rem;
}

.tier-counts-head p:not(.tier-counts-kicker) {
  color: var(--text-muted);
}

.tier-counts-kicker {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tier-counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
  gap: 0.9rem;
}

.tier-count-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--bg);
}

.tier-count-card h3 {
  margin: 0;
  font-size: 1rem;
}

.tier-count-total {
  margin: 0.25rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.tier-count-bands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.8rem;
}

.tier-count-band {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.tier-count-band strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  .tier-counts {
    padding: 1.1rem;
  }

  .tier-counts-head {
    align-items: start;
    flex-direction: column;
  }
}
