:root {
  color-scheme: dark;
  --background: #030303;
  --surface: #151a25;
  --surface-soft: #0d1017;
  --line: #343a47;
  --text: #f7f7f8;
  --muted: #c5c9d1;
  --accent: #cf002d;
  --accent-hover: #f10a40;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font:
    17px/1.62 Arial,
    Helvetica,
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

header {
  background: var(--surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

header > div,
footer > div {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

header > div {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

header > div > a {
  display: inline-flex;
  align-items: center;
  min-width: 50px;
}

nav {
  display: flex;
  gap: 14px;
}

nav a,
.banner a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  box-shadow: 0 8px 22px rgba(207, 0, 45, 0.18);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}
.banner p {
  padding: 20px;
  background-color: #03030368;
}

nav a:hover,
nav a:focus-visible,
.banner a:hover,
.banner a:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

main {
  overflow: clip;
}

main > section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

main > section:not(.banner) + section:not(.banner) {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

section.banner {
  width: min(1180px, calc(100% - 40px));
  min-height: 410px;
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #333846;
  border-radius: var(--radius);
  background-image:
    linear-gradient(
      90deg,
      rgba(4, 6, 13, 0.95) 0%,
      rgba(4, 6, 13, 0.82) 34%,
      rgba(4, 6, 13, 0.12) 68%
    ),
    url("/images/banner.webp");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.banner > div {
  width: min(620px, 100%);
  min-height: 410px;
  padding: 70px 42px 38px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.banner p:first-child {
  margin: 0 0 8px;
  color: #ffbac8;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 0.55em;
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.55rem);
  max-width: 760px;
}
h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
}
h3 {
  margin-top: 1.5em;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
}

p {
  margin: 0 0 1.05em;
  color: var(--text);
}

.banner p:nth-of-type(2) {
  max-width: 600px;
  color: #eceef3;
}
.banner small {
  max-width: 520px;
  margin-top: 16px;
  color: #d1d4db;
}
.banner a {
  margin-top: 6px;
}

section > aside {
  padding: 5px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

section > aside {
  margin-top: 28px;
  background: linear-gradient(
    135deg,
    rgba(207, 0, 45, 0.14),
    rgba(21, 26, 37, 0.98)
  );
}

section > aside h3 {
  margin-top: 0;
}

ul,
ol {
  margin: 1em 0;
  padding-left: 1.35em;
}

li {
  margin: 0.55em 0;
}

section:not(.games) li::marker {
  color: #ef315a;
  font-weight: 800;
}

section.games {
  width: min(1180px, calc(100% - 40px));
}

.games > p {
  max-width: 1040px;
}

.games ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.games li {
  margin: 0;
  min-width: 0;
}

.games a {
  display: block;
  height: 100%;
  border: 1px solid #3d414a;
  border-radius: 10px;
  background: #090a0d;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.games a:hover,
.games a:focus-visible {
  transform: translateY(-5px);
  border-color: #c8cbd2;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

figure {
  margin: 0;
}

.games figure {
  height: 100%;
}

.games img {
  width: 100%;
  aspect-ratio: 140 / 96;
  object-fit: cover;
  image-rendering: auto;
}

figcaption {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 9px 8px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

section > figure {
  width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--surface-soft);
}

caption {
  padding: 15px 18px;
  color: #fff;
  font-weight: 800;
  text-align: left;
  caption-side: top;
  background: var(--surface);
}

thead,
tbody {
  width: 100%;
  table-layout: fixed;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  color: #fff;
  background: #242a38;
}
tbody th {
  color: #ffb2c1;
}
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}
tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

footer {
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface);
}

footer > div {
  padding: 36px 0 42px;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px 20px;
  align-items: start;
}

footer img {
  grid-row: 1 / span 2;
}
footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  box-shadow: var(--shadow);
}

.back-to-top[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .games ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  section.banner {
    background-position: 58% center;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  header > div,
  footer > div,
  main > section,
  section.banner,
  section.games {
    width: min(100% - 24px, 1180px);
  }
  header > div {
    min-height: 68px;
    gap: 12px;
  }
  nav {
    gap: 8px;
  }
  nav a {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 0.88rem;
  }
  section.banner {
    min-height: 450px;
    background-position: 64% center;
  }
  .banner > div {
    min-height: 450px;
    padding: 58px 22px 30px;
  }
  .games ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  main > section {
    padding: 38px 0;
    max-width: 1040px;
  }
  article,
  section > aside {
    padding: 23px;
  }
  footer > div {
    grid-template-columns: 1fr;
  }
  footer img {
    grid-row: auto;
  }
}

@media (max-width: 380px) {
  header > div {
    align-items: flex-start;
    padding: 12px 0;
  }
  nav {
    flex-direction: column;
    width: 122px;
  }
  nav a {
    width: 100%;
  }
  .games ul {
    grid-template-columns: 1fr;
  }
}

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