:root {
  --bg: #803d37;
  --bg-deep: #6e342f;
  --ink: #f6edd4;
  --ink-soft: #ead9a8;
  --muted: #d4c49a;
  --gold: #e0c56e;
  --gold-hot: #f0d98a;
  --line: rgba(224, 197, 110, 0.28);
  --plate: #803d37;
  --shadow: 0 18px 40px rgba(40, 14, 12, 0.28);
  --radius: 16px;
  --font: "Figtree", system-ui, sans-serif;
  --display: "Cinzel", Georgia, serif;
  --step-0: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --step-1: clamp(1rem, 0.92rem + 0.4vw, 1.15rem);
  --step-2: clamp(1.2rem, 1rem + 0.8vw, 1.55rem);
  --step-3: clamp(1.7rem, 1.1rem + 2.2vw, 3rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover:not(.btn) {
  color: var(--gold-hot);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--gold);
  color: #4a221f;
  font-weight: 700;
  border-radius: 10px;
}

.skip-link:focus {
  top: 1rem;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.backdrop {
  position: absolute;
  inset: -3%;
  background: #803d37 url("../assets/bg.jpg") center / cover no-repeat;
  filter: blur(14px);
  transform: scale(1.08);
}

.embers {
  position: absolute;
  inset: 0;
}

.ember {
  position: absolute;
  bottom: 8%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-hot);
  box-shadow: 0 0 10px 2px rgba(224, 197, 110, 0.55);
  animation: rise var(--dur, 9s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes rise {
  0% {
    transform: translate3d(0, 40px, 0) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 0.8;
  }
  100% {
    transform: translate3d(var(--drift, 20px), -70vh, 0) scale(0.2);
    opacity: 0;
  }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

main {
  position: relative;
  z-index: 1;
}

.stage {
  width: min(100%, 36rem);
  margin: 0 auto;
  min-width: 0;
  max-width: 100%;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

.hero-copy {
  width: min(100%, 36rem);
  min-width: 0;
  max-width: 100%;
}

.hero-logo {
  width: min(240px, 58vw);
  height: auto;
  border-radius: 12px;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.08;
}

h1 {
  margin: 0.15rem 0 0;
  font-size: var(--step-3);
  color: var(--gold);
  overflow-wrap: break-word;
  text-shadow: none;
}

.lead {
  margin: 0.45rem 0 0;
  color: var(--ink);
  font-size: var(--step-1);
  text-shadow: none;
}

.board {
  background: var(--plate);
  border-radius: 20px;
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-panels {
  width: 100%;
  min-width: 0;
  margin-top: 1rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
}

.sign,
.online-board,
.community-card {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  text-align: center;
}

.sign,
.online-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0.95rem 0.9rem 1rem;
  border-radius: var(--radius);
}

.sign-kicker {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.sign-ip {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.35rem 0 0.8rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(1.05rem, 0.7rem + 1.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold);
  overflow-wrap: anywhere;
}

.sign-ip:hover {
  color: var(--gold-hot);
}

.btn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  min-width: 0;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  font-size: 0.95rem;
  color: #4a221f;
  background: linear-gradient(180deg, var(--gold-hot), var(--gold));
  box-shadow: 0 8px 20px rgba(80, 32, 28, 0.22);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-ghost {
  color: var(--gold-hot);
  background: transparent;
  box-shadow: none;
  border-color: var(--line);
}

.btn:hover {
  z-index: 1;
  color: #4a221f;
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(80, 32, 28, 0.34),
    0 0 0 2px rgba(240, 217, 138, 0.7);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(1.04);
}

.btn:focus-visible,
.sign-ip:focus-visible,
.ru-host:focus-visible,
.community-card:focus-visible {
  outline: 2px solid var(--gold-hot);
  outline-offset: 3px;
}

.online-board {
  gap: 0.15rem;
}

.online-board-value {
  margin: 0.2rem 0 0.05rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--gold);
}

.online-max {
  color: var(--muted);
  font-size: 0.45em;
}

.online-board-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.ru-note {
  margin: 0.85rem 0 0;
  padding: 0.8rem 0.9rem;
  color: var(--ink);
  text-align: center;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ru-host {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0.35rem 0 0.7rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--gold);
  font: inherit;
  font-family: var(--display);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ru-host:hover {
  color: var(--gold-hot);
}

.ru-note .btn-row {
  margin-top: 0.15rem;
}

.btn-ghost:hover {
  color: var(--gold-hot);
  border-color: var(--gold-hot);
  filter: none;
  box-shadow: 0 0 0 2px rgba(224, 197, 110, 0.4);
}

.community {
  margin-top: 0.85rem;
  margin-bottom: 1.5rem;
}

.community h2 {
  margin: 0 0 0.7rem;
  font-size: var(--step-2);
  text-align: center;
  color: var(--gold);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: min(100%, 560px);
  margin: 0 auto;
}

.community-card {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0.7rem 0.55rem;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.community-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
}

.community-card:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 197, 110, 0.55);
  color: var(--gold-hot);
  background: rgba(0, 0, 0, 0.28);
}

.community-icon {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 1.2rem;
  overflow: visible;
  color: var(--gold);
}

.community-icon svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  max-width: none;
}

.community-name {
  line-height: 1;
}

.site-footer {
  padding: 0.9rem 0 calc(0.9rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  z-index: 12;
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--gold);
  color: #4a221f;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

@media (min-width: 800px) and (max-width: 1099px) {
  main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1.25rem;
  }

  .stage {
    width: min(100%, 54rem);
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    width: 100%;
  }

  .hero-logo {
    width: 100%;
    max-width: 16rem;
    margin: 0;
  }

  .hero-copy,
  .hero-panels {
    min-width: 0;
    width: 100%;
  }

  h1,
  .lead {
    text-align: center;
  }

  .hero-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1100px) {
  html {
    font-size: 110%;
  }

  html,
  body {
    min-height: 100dvh;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.5rem 1.25rem;
  }

  .stage {
    width: min(100%, 70rem);
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    align-items: center;
    gap: 1.8rem;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
  }

  .hero-logo {
    width: 100%;
    max-width: 22rem;
    margin: 0;
  }

  .hero-copy,
  .hero-panels {
    width: 100%;
    min-width: 0;
  }

  h1 {
    margin: 0;
    font-size: clamp(2.2rem, 3vw, 3.4rem);
    text-align: center;
  }

  .lead {
    font-size: 1.15rem;
    text-align: center;
  }

  .hero-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  }

  .sign-ip {
    font-size: clamp(1.15rem, 1.4vw, 1.55rem);
  }

  .online-board-value {
    font-size: clamp(2.1rem, 2.4vw, 2.8rem);
  }

  .btn:hover {
    transform: translateY(-2px) scale(1.04);
  }

  .community {
    width: 100%;
    margin: 1.25rem 0 1.5rem;
    padding: 0;
  }

  .community h2 {
    text-align: center;
  }

  .community-grid {
    width: min(100%, 560px);
    margin: 0 auto;
  }

  .site-footer {
    padding: 0.85rem 0 0;
  }
}

@media (min-width: 1280px) {
  .hero {
    grid-template-columns: 24rem minmax(0, 1fr);
    gap: 2.2rem;
  }

  .hero-logo {
    max-width: 24rem;
  }

  .sign-ip {
    font-size: 1.55rem;
  }

  .online-board-value {
    font-size: 3rem;
  }
}

@media (max-width: 799px) {
  .board {
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 1099px) {
  .btn {
    width: 100%;
  }

  .community-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-card {
    padding: 0.85rem 0.4rem;
    font-size: 0.82rem;
  }

  .community-inner {
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (max-width: 520px) {
  .community-grid {
    grid-template-columns: 1fr;
  }

  .community-card {
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }

  .community-inner {
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ember,
  .community-card,
  .btn {
    animation: none;
    transition: none;
    transform: none;
  }
}
