@font-face {
  font-family: "Montserrat";
  src: url('../fonts/montserrat_regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url('../fonts/montserrat_medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url('../fonts/montserrat_bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Akrobat";
  src: url('../fonts/akrobat_semibold.otf') format('opentype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Akrobat";
  src: url('../fonts/akrobat_extrabold.otf') format('opentype');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --rp-bg: #080c12;
  --rp-surface: rgba(13, 18, 27, 0.82);
  --rp-surface-strong: rgba(10, 14, 22, 0.94);
  --rp-surface-soft: rgba(24, 31, 43, 0.68);
  --rp-border: rgba(255, 255, 255, 0.09);
  --rp-border-accent: rgba(58, 181, 202, 0.32);
  --rp-primary: #3ab5ca;
  --rp-primary-bright: #62d1df;
  --rp-secondary: #7770bd;
  --rp-warm: #efe2ca;
  --rp-text: #f3f6f9;
  --rp-muted: #a9b4c3;
  --rp-radius: 18px;
  --rp-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  --rp-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 3%, rgba(58, 181, 202, 0.14), transparent 31%),
    radial-gradient(circle at 88% 17%, rgba(119, 112, 189, 0.13), transparent 29%),
    linear-gradient(145deg, #111823 0%, var(--rp-bg) 52%, #070a10 100%);
  background-attachment: fixed;
  color: var(--rp-text);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 75%);
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a {
  color: var(--rp-primary-bright);
}

header {
  position: sticky;
  top: 14px;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: var(--rp-width);
  min-height: 76px;
  margin: 14px auto 0;
  padding: 9px 18px;
  border: 1px solid var(--rp-border);
  border-radius: 18px;
  background: rgba(8, 12, 19, 0.78);
  box-shadow: 0 14px 38px rgba(0,0,0,.24);
}

header > a {
  display: flex;
  align-items: center;
}

header img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.35));
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #dce3eb;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  border-color: var(--rp-border);
  background: rgba(58, 181, 202, .1);
  color: #fff;
}

.hero {
  position: relative;
  max-width: var(--rp-width);
  min-height: 520px;
  margin: 24px auto 0;
  padding: clamp(72px, 10vw, 130px) clamp(24px, 7vw, 84px);
  overflow: hidden;
  border: 1px solid var(--rp-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 78% 32%, rgba(58,181,202,.18), transparent 28%),
    linear-gradient(135deg, rgba(19,27,39,.94), rgba(9,13,20,.84));
  box-shadow: var(--rp-shadow);
  text-align: left;
}

.hero::after {
  position: absolute;
  right: -3%;
  bottom: -32%;
  width: min(42vw, 480px);
  aspect-ratio: 1;
  content: "";
  background: url('../images/logorrp_transparent.png') center/contain no-repeat;
  opacity: .12;
  filter: saturate(.9);
  pointer-events: none;
}

.hero h1,
.news-section > h1,
.screenshots h2,
.servers-section h2,
.donate-section h2,
.contacts-section h2,
.memory-game-section h1 {
  position: relative;
  z-index: 1;
  margin-top: 0;
  color: var(--rp-text);
  font-family: "Akrobat", "Montserrat", sans-serif;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.hero h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(38px, 6vw, 70px);
  background: linear-gradient(110deg, #fff 24%, var(--rp-warm) 58%, var(--rp-primary-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  position: relative;
  z-index: 1;
  max-width: 670px;
  margin: 0 0 34px;
  color: var(--rp-muted);
  font-size: clamp(16px, 2vw, 20px);
}

.buttons {
  position: relative;
  z-index: 1;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.buttons a,
.link-button,
.donate-button,
#startBtn,
#codeModal button {
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid rgba(98,209,223,.32);
  border-radius: 12px;
  background: linear-gradient(135deg, #238fa5, #396da9);
  box-shadow: 0 12px 28px rgba(22,97,128,.22);
  color: #fff;
  font-family: "Akrobat", "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}

.buttons a:nth-child(2) {
  border-color: var(--rp-border);
  background: rgba(255,255,255,.055);
  box-shadow: none;
}

.buttons a:hover,
.link-button:hover,
.donate-button:hover,
#startBtn:hover,
#codeModal button:hover {
  transform: translateY(-2px);
  border-color: rgba(98,209,223,.58);
  filter: brightness(1.08);
}

.screenshots,
.servers-section,
.donate-section,
.contacts-section,
.news-section,
.memory-game-section,
.form-container {
  width: calc(100% - 32px);
  max-width: var(--rp-width);
  margin: 22px auto;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  background: var(--rp-surface);
  box-shadow: var(--rp-shadow);
}

.screenshots,
.servers-section,
.donate-section,
.contacts-section {
  background: var(--rp-surface);
}

.screenshots h2,
.servers-section h2,
.donate-section h2,
.news-section > h1 {
  margin-bottom: 28px;
  font-size: clamp(26px, 4vw, 38px);
}

.gallery {
  max-width: none;
  gap: 16px;
}

.gallery img,
.news-image {
  display: block;
  border: 1px solid var(--rp-border);
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(0,0,0,.25);
}

.gallery img:hover {
  transform: translateY(-4px) scale(1.01);
}

.server-card,
.news-card,
.social-item,
.contacts-card,
.donate-form,
.game-container {
  border: 1px solid var(--rp-border);
  border-radius: 16px;
  background: var(--rp-surface-soft);
  box-shadow: none;
}

.server-card {
  width: min(100%, 340px);
  padding: 28px;
  --server-color: var(--rp-primary);
  text-align: left;
  overflow: hidden;
  position: relative;
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.server-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--server-color);
  box-shadow: 0 0 22px var(--server-color);
}

.server-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.server-card h3 {
  margin: 0;
  font-size: 22px;
}

.server-card__online {
  display: block;
  margin: 18px 0 10px;
  color: var(--rp-text);
  font-family: "Akrobat", "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.server-card__status {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: #707987;
  box-shadow: 0 0 0 4px rgba(112,121,135,.08);
  cursor: help;
}

.server-card__status.is-online {
  border-color: rgba(151,255,190,.38);
  background: #42d77d;
  box-shadow: 0 0 0 4px rgba(66,215,125,.1), 0 0 14px rgba(66,215,125,.45);
}

.server-card__status::after {
  position: absolute;
  right: -8px;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: max-content;
  max-width: 180px;
  padding: 7px 9px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  content: attr(data-tooltip);
  background: var(--rp-surface-strong);
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
  color: var(--rp-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.server-card__status:hover::after,
.server-card__status:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.server-card__status:focus-visible {
  outline: 2px solid var(--rp-primary-bright);
  outline-offset: 4px;
}

.server-card--offline {
  --server-color: #657080 !important;
  opacity: .76;
}

.server-card--loading {
  min-height: 154px;
  display: grid;
  place-items: center;
}

.server-card__state {
  margin: 0;
  color: var(--rp-muted);
  text-align: center;
}

.server-card.rostov,
.server-card.red {
  background: linear-gradient(145deg, rgba(24,35,49,.88), rgba(14,19,29,.92));
}

.server-card .progress {
  height: 10px;
  background: rgba(255,255,255,.08);
}

.server-card .bar {
  background: linear-gradient(90deg, var(--server-color), var(--rp-secondary));
  box-shadow: 0 0 14px color-mix(in srgb, var(--server-color) 50%, transparent);
  transition: width .4s ease;
}

.donate-form {
  max-width: 600px;
  padding: clamp(22px, 5vw, 38px);
}

.form-group input,
.form-group select,
#codeModal input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--rp-border);
  border-radius: 11px;
  background: rgba(5,9,15,.66);
  color: var(--rp-text);
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.form-group input:focus,
.form-group select:focus,
#codeModal input:focus {
  outline: 0;
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px rgba(58,181,202,.12);
}

.news-section {
  max-width: var(--rp-width);
  text-align: left;
}

.news-section > h1,
.news-section > h2 {
  color: var(--rp-text);
}

.news-section p,
.news-section li,
.disclaimer {
  color: var(--rp-muted);
}

.social-links,
.news-list {
  gap: 18px;
}

.social-item {
  flex: 1 1 260px;
  padding: 24px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-card {
  width: auto;
  margin: 0;
  padding: 16px;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--rp-border-accent);
}

.divider {
  background: linear-gradient(90deg, transparent, rgba(98,209,223,.46), transparent);
}

.modal {
  z-index: 1000;
  padding: 24px;
  background: rgba(3,6,10,.82);
}

.modal-content,
#codeModal .modal-content {
  border: 1px solid var(--rp-border);
  border-radius: 18px;
  background: var(--rp-surface-strong);
  box-shadow: var(--rp-shadow);
}

.form-container {
  overflow: hidden;
  text-align: center;
}

.form-container iframe {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border: 0;
  border-radius: 14px;
}

footer {
  width: calc(100% - 32px);
  max-width: var(--rp-width);
  margin: 22px auto 18px;
  padding: 18px 22px;
  border: 1px solid var(--rp-border);
  border-radius: 16px;
  background: rgba(8,12,19,.78);
  color: var(--rp-muted);
  box-shadow: 0 14px 38px rgba(0,0,0,.2);
}

footer img {
  max-width: 100%;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  header,
  .screenshots,
  .servers-section,
  .donate-section,
  .contacts-section,
  .news-section,
  .memory-game-section,
  .form-container,
  footer,
  .modal-content {
    -webkit-backdrop-filter: blur(14px) saturate(115%);
    backdrop-filter: blur(14px) saturate(115%);
  }
}

@media (max-width: 820px) {
  header {
    position: relative;
    top: 0;
    flex-direction: column;
    gap: 8px;
  }

  nav {
    justify-content: center;
  }

  nav a {
    padding: 8px 10px;
    font-size: 12px;
  }

  .hero {
    min-height: auto;
  }

  .hero::after {
    right: -10%;
    opacity: .07;
  }

  .gallery,
  .news-list {
    grid-template-columns: 1fr 1fr;
  }

  .social-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  body {
    background-attachment: scroll;
  }

  header,
  .hero,
  .screenshots,
  .servers-section,
  .donate-section,
  .contacts-section,
  .news-section,
  .memory-game-section,
  .form-container,
  footer {
    width: calc(100% - 18px);
    border-radius: 14px;
  }

  .gallery,
  .news-list {
    grid-template-columns: 1fr;
  }

  .buttons {
    flex-direction: column;
  }

  .buttons a {
    width: 100%;
    text-align: center;
  }

  footer > div {
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
