/* Per-brand theme and skin overrides.
 *
 * palette.css holds the shared structure and the default (TierMC) colour scheme.
 * This file restates colours for any brand whose page declares itself with
 * <html data-brand="…">, and can also restyle the chrome for one brand. Both
 * sites load identical stylesheets, so nothing here may leak into the default
 * brand: every rule is scoped to html[data-brand="eratiers"].
 *
 * EraTiers' look follows the reference tierlist site: near-black page, faint
 * pixel skyline along the bottom, radial blue glow, flat sticky top bar, a
 * lowercase wordmark with an italic accent, and panel cards with a soft checker
 * texture. Region and tier colours are intentionally NOT overridden - they are
 * semantic and must read the same on both sites.
 */

html[data-brand="eratiers"] {
  /* --- surfaces: black, not blue-grey --- */
  --background: #05070c;
  --foreground: #eef3fb;

  --card: #0a0e15;
  --card-foreground: #eef3fb;

  --popover: #0a0e15;
  --popover-foreground: #eef3fb;

  --secondary: #101827;
  --secondary-foreground: #dbe7ff;

  --muted: #080c14;
  --muted-foreground: #8a97ab;

  --accent: #0f1a2c;
  --accent-foreground: #eef3fb;

  --border: rgba(255, 255, 255, 0.07);
  --input: rgba(255, 255, 255, 0.09);
  --ring: #3b82f6;

  /* --- brand: a brighter blue than the default network's --- */
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --destructive: #ff5d6c;

  --layout-sections-color: #05070c;
  --layout-item-outline: rgba(255, 255, 255, 0.07);

  /* --- text tiers used by the rows --- */
  --text-disabled: #4c576c;
  --color-slate-300: #eef3fb;
  --color-slate-400: #8a97ab;
  --color-slate-600: #4c576c;
  --color-slate-700: #17202f;

  /* --- gamemode tier board: same hues, cooler so they sit on black --- */
  --hightier: #102442;
  --hightier-hover: #1b3a66;
  --lowtier: #070e1b;
  --lowtier-hover: #122239;
  --hightier-icon-foreground: #2a4a78;
  --hightier-icon-foreground-hover: #4a72ab;
  --lowtier-icon-foreground: #16263f;
  --lowtier-icon-foreground-hover: #24405f;

  --placement-other: #0b1526;

  /* The display face used for the wordmark and the hero headline. */
  --font-display: 'Segoe UI', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ------------------------------------------------------------------ backdrop
 * The page wrapper paints its own background (bg-background), which would cover
 * anything set on <body> - so the glow, checker haze and pixel skyline live here.
 * All three are fixed, so the scene stays put while the board scrolls. */
html[data-brand="eratiers"] .bg-background {
  background-color: var(--background);
  background-image:
    radial-gradient(1100px 560px at 50% -12%, rgba(59, 130, 246, 0.20), transparent 72%),
    radial-gradient(800px 420px at 100% 108%, rgba(29, 78, 216, 0.14), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='96' viewBox='0 0 192 96'%3E%3Cg fill='%23dbeafe' fill-opacity='0.05'%3E%3Crect x='0' y='72' width='24' height='24'/%3E%3Crect x='24' y='48' width='24' height='48'/%3E%3Crect x='48' y='60' width='24' height='36'/%3E%3Crect x='72' y='24' width='24' height='72'/%3E%3Crect x='96' y='48' width='24' height='48'/%3E%3Crect x='120' y='12' width='24' height='84'/%3E%3Crect x='144' y='60' width='24' height='36'/%3E%3Crect x='168' y='36' width='24' height='60'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-position: center top, center bottom, center bottom;
  background-attachment: fixed, fixed, fixed;
}

/* ------------------------------------------------------------------- top bar
 * Flat, full-bleed sticky bar instead of the rounded card the default network
 * uses - the reference site's own header shape. */
html[data-brand="eratiers"] .site-topbar {
  position: sticky;
  top: 0;
  max-width: none;
  border-width: 0 0 1px;
  border-radius: 0;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(5, 7, 12, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
html[data-brand="eratiers"] .site-topbar nav {
  max-width: 1352px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Nav links become quiet pills that fill on hover, like the reference's. */
html[data-brand="eratiers"] .site-nav a {
  border-radius: 0.5rem;
  transition: background-color 150ms ease, color 150ms ease;
}
html[data-brand="eratiers"] .site-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* The wordmark: lowercase, tight, with an italic coloured half. */
html[data-brand="eratiers"] .brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  color: #ffffff;
  white-space: nowrap;
}
html[data-brand="eratiers"] .brand-wordmark .wm-accent {
  font-style: italic;
  color: #60a5fa;
  margin-left: 0.05em;
}

html[data-brand="eratiers"] .site-search {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0.6rem;
}
html[data-brand="eratiers"] .site-search:focus-within {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Room for the join button beside the search box. */
html[data-brand="eratiers"] .site-tools {
  max-width: 27rem;
}
html[data-brand="eratiers"] .site-join {
  display: inline-flex;
  align-items: center;
  height: 2.45rem;
  margin-right: 0.5rem;
  padding: 0 0.95rem;
  border-radius: 0.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(59, 130, 246, 0.9);
  transition: background-color 150ms ease, transform 120ms ease;
}
html[data-brand="eratiers"] .site-join:hover {
  background: #2f74e8;
}
html[data-brand="eratiers"] .site-join:active {
  transform: scale(0.98);
}

/* --------------------------------------------------------------------- hero
 * Rendered by home.js only when the brand config defines `hero`; empty on the
 * default site, so it collapses out of the layout entirely. */
#era-hero:empty {
  display: none;
}
#era-hero {
  width: 100%;
  max-width: 1352px;
  margin: 0 auto;
  padding: 2.75rem 2rem 0.5rem;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.10);
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #ffffff;
}
.hero-title em {
  font-style: italic;
  color: #60a5fa;
}
.hero-sub {
  max-width: 34rem;
  margin-top: 0.9rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.6rem;
  padding: 0 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  font-size: 0.88rem;
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.hero-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
.hero-btn:active {
  transform: scale(0.98);
}
.hero-btn.primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 10px 26px -10px rgba(59, 130, 246, 0.9);
}
.hero-btn.primary:hover {
  background: #2f74e8;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.35rem;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}
.hero-stats strong {
  color: var(--foreground);
  font-weight: 700;
}
.hero-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------- board panel
 * The rankings card becomes a dark panel with a faint checker texture and a
 * blue wash at the top, matching the reference's cards. */
html[data-brand="eratiers"] main > div {
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background-color: var(--card);
  background-image:
    linear-gradient(180deg, rgba(59, 130, 246, 0.06), transparent 260px),
    repeating-conic-gradient(from 45deg,
      rgba(255, 255, 255, 0.014) 0deg,
      rgba(255, 255, 255, 0.014) 25%,
      transparent 0deg,
      transparent 50%);
  background-size: 100% 100%, 46px 46px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.95);
}

/* With a hero above it, the board does not need the default's full top gap
 * (which exists to clear the absolutely positioned mode tabs). */
html[data-brand="eratiers"] body:has(#era-hero:not(:empty)) main > div {
  margin-top: 3.25rem;
}

/* Mode tabs: compact segmented pills. */
html[data-brand="eratiers"] #mode-tabs {
  gap: 0.35rem;
  padding-bottom: 0.6rem;
}
html[data-brand="eratiers"] .mode-tab {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  background: #0a111c;
}
html[data-brand="eratiers"] .mode-tab:hover {
  border-color: rgba(96, 165, 250, 0.45);
}
html[data-brand="eratiers"] .mode-tab.on {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.55), 0 8px 24px -8px rgba(59, 130, 246, 0.8);
}

/* Rows: flatter cards on the panel, blue on hover. */
html[data-brand="eratiers"] #rows > div {
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.028);
}
html[data-brand="eratiers"] #rows > div:hover {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.10);
}

/* The Information button stays a quiet secondary control. */
html[data-brand="eratiers"] #info-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--foreground);
}

/* The wordmark's text is the site name; on black it reads better at full white. */
html[data-brand="eratiers"] .brand-text {
  color: #ffffff;
}

/* ------------------------------------------------------------------- footer */
html[data-brand="eratiers"] footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #05070c;
  padding: 3rem 2rem;
}
html[data-brand="eratiers"] footer > div:first-child {
  font-size: 1rem;
  color: var(--muted-foreground);
}

/* A short legal line under the copyright, for brands that define one. */
.site-footer-note {
  margin-top: 0.55rem;
  text-align: center;
  font-size: 0.75rem;
  color: #5f6b7e;
}
.site-footer-note:empty {
  display: none;
}

/* Small screens: the hero and bar need less air. */
@media (max-width: 640px) {
  #era-hero {
    padding: 2rem 1.25rem 0.25rem;
  }
  html[data-brand="eratiers"] .site-topbar nav {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  html[data-brand="eratiers"] .brand-wordmark {
    font-size: 1.45rem;
  }
}

/* On a phone the header has room for the wordmark and the search only; the join
 * control would push it past the viewport. */
@media (max-width: 768px) {
  html[data-brand="eratiers"] .site-join {
    display: none;
  }
}
