:root {
  --bg: #07090d;
  --bg-elevated: #0f131a;
  --bg-card: #141a24;
  --text: #eef2f7;
  --text-muted: #8b97a8;
  --green: #b8ff2e;
  --green-dim: #7ed321;
  --orange: #ff9f1a;
  --pink: #ff4d9d;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --radius-sm: 14px;
  --font: "Manrope", system-ui, sans-serif;
  --font-display: "Unbounded", "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--green {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -80px;
  background: rgba(184, 255, 46, 0.12);
}

.bg-glow--orange {
  width: 480px;
  height: 480px;
  right: -100px;
  top: 30%;
  background: rgba(255, 159, 26, 0.1);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.header,
main,
.footer {
  position: relative;
  z-index: 1;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 0;
  flex-wrap: wrap;
}

.header__auth {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header__auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.header__auth-user:hover {
  opacity: 0.85;
}

.header__auth-user[hidden] {
  display: none;
}

.header__auth-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #ff7eb3);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  overflow: hidden;
}

.header__auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header__auth-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), #5ce677);
  color: #0a0f14;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(184, 255, 46, 0.25);
}

.logo__text {
  display: flex;
  flex-direction: column;
}

.logo__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo__subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav__link {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.hero__eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid rgba(184, 255, 46, 0.25);
  border-radius: 999px;
  background: rgba(184, 255, 46, 0.08);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero__title span {
  display: block;
}

.hero__title-accent {
  background: linear-gradient(90deg, var(--green), #fff 55%, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc {
  max-width: 460px;
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--green), var(--green-dim));
  color: #0a0f14;
  box-shadow: 0 12px 32px rgba(184, 255, 46, 0.22);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(184, 255, 46, 0.3);
}

.btn--ghost {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(184, 255, 46, 0.25);
}

.btn--sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.auth-open {
  overflow: hidden;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
}

.auth-modal__dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px 24px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #121820, #0c1016);
  box-shadow: var(--shadow);
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.auth-modal__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.auth-modal__subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tab--active {
  background: rgba(184, 255, 46, 0.14);
  color: var(--green);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field__input:focus {
  outline: none;
  border-color: rgba(184, 255, 46, 0.45);
  box-shadow: 0 0 0 3px rgba(184, 255, 46, 0.12);
}

.auth-form__submit {
  width: 100%;
  margin-top: 4px;
  border: 0;
  cursor: pointer;
}

.auth-message {
  margin: 0;
  font-size: 0.85rem;
}

.auth-message--error {
  color: #ff7b8a;
}

.auth-message--success {
  color: var(--green);
}

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100% - 40px, 360px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 22, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
}

.toast--success {
  border-color: rgba(184, 255, 46, 0.35);
}

.toast--error {
  border-color: rgba(255, 123, 138, 0.35);
}

.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.toast--success .toast__icon {
  background: rgba(184, 255, 46, 0.15);
  color: var(--green);
}

.toast--error .toast__icon {
  background: rgba(255, 123, 138, 0.15);
  color: #ff7b8a;
}

.toast--out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

.hero__gallery {
  position: relative;
  min-height: 520px;
}

.hero-card {
  position: absolute;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 255, 46, 0.15), transparent 50%),
    linear-gradient(160deg, #1a2230, #0d1118);
}

.hero-card__caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.hero-card--main {
  width: min(72%, 420px);
  top: 50%;
  left: 50%;
  z-index: 3;
}

.hero-card--top {
  width: min(48%, 260px);
  top: 4%;
  right: 0;
  z-index: 2;
}

.hero-card--bottom {
  width: min(48%, 260px);
  bottom: 2%;
  left: 2%;
  z-index: 1;
}

.hero-card:hover {
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  z-index: 4;
}

.games {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-head {
  margin-bottom: 28px;
}

.section-head__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-head__desc {
  margin: 0;
  color: var(--text-muted);
}

.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.game-card:not(.game-card--placeholder):not(.game-card--soon) {
  cursor: pointer;
}

.game-card:not(.game-card--placeholder):not(.game-card--soon):hover {
  transform: translateY(-4px);
  border-color: rgba(184, 255, 46, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.game-card--soon {
  opacity: 0.92;
}

.game-card--placeholder {
  opacity: 0.35;
  pointer-events: none;
}

.game-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, #1b2433, #10151d);
}

.game-card__thumb--sudoku {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 159, 26, 0.18), transparent 45%),
    linear-gradient(145deg, #1a2434, #0f141c);
}

.game-card__thumb--empty {
  background: linear-gradient(145deg, #151b24, #0d1118);
}

.game-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 159, 26, 0.18);
  border: 1px solid rgba(255, 159, 26, 0.35);
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sudoku-preview {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sudoku-preview span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: var(--green);
}

.game-card__thumb--killer {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 80%, rgba(184, 255, 46, 0.15), transparent 45%),
    linear-gradient(145deg, #1a2434, #0f141c);
}

.killer-preview {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 38px);
  gap: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.killer-preview span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  border: 1px dashed rgba(184, 255, 46, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.killer-preview span:nth-child(1),
.killer-preview span:nth-child(2),
.killer-preview span:nth-child(3) {
  border-top: 2px dashed rgba(255, 159, 26, 0.55);
}

.killer-preview span:nth-child(1),
.killer-preview span:nth-child(4),
.killer-preview span:nth-child(7) {
  border-left: 2px dashed rgba(255, 159, 26, 0.55);
}

.killer-preview span:nth-child(1)::after {
  content: "17";
  position: absolute;
  top: 13px;
  left: 13px;
  font-size: 0.55rem;
  color: var(--orange);
  font-weight: 700;
}

.killer-preview span:nth-child(2),
.killer-preview span:nth-child(3),
.killer-preview span:nth-child(5),
.killer-preview span:nth-child(6),
.killer-preview span:nth-child(8) {
  color: transparent;
}

.game-card__body {
  padding: 18px 18px 20px;
}

.game-card__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.game-card__meta {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.game-card__desc {
  margin: 0;
  color: #a8b2c1;
  font-size: 0.92rem;
}

.news__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.news-card:hover {
  border-color: rgba(184, 255, 46, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.news-card__date {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(184, 255, 46, 0.1);
  border: 1px solid rgba(184, 255, 46, 0.2);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.news-card__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.news-card__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.players__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.player-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 77, 157, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
}

.player-card--add {
  opacity: 0.55;
  border-style: dashed;
}

.player-card--add:hover {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.2);
}

.player-card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 77, 157, 0.15), transparent 45%),
    linear-gradient(145deg, #1a2434, #0f141c);
  overflow: hidden;
}

.player-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-card__photo--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #151b24, #0d1118);
}

.player-card__avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--green);
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 255, 46, 0.2), transparent 55%),
    linear-gradient(160deg, #1a2230, #0d1118);
}

.player-card__avatar--pink {
  color: var(--pink);
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 77, 157, 0.2), transparent 55%),
    linear-gradient(160deg, #1f1a28, #0d1118);
}

.player-card__add-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  line-height: 1;
}

.player-card__body {
  padding: 18px 20px 22px;
}

.player-card__name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.player-card__tag {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 600;
}

.player-card--add .player-card__tag {
  color: var(--text-muted);
}

.player-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0 0 6px;
}

.footer__tagline {
  color: #6f7b8d;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 36px;
  }

  .hero__gallery {
    min-height: 420px;
    max-width: 520px;
    margin: 0 auto;
  }

  .hero-card--main {
    width: 68%;
  }

  .hero-card--top {
    width: 42%;
    right: 2%;
  }

  .hero-card--bottom {
    width: 42%;
    left: 4%;
  }
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header__auth {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .hero__gallery {
    min-height: 360px;
  }

  .hero-card--main {
    width: 74%;
  }

  .hero-card--top,
  .hero-card--bottom {
    width: 46%;
  }

  .games__grid {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-wrap: wrap;
  }

  .news-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .players__grid {
    grid-template-columns: 1fr;
  }
}
