body.is-game-overlay-open {
  overflow: hidden;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(168, 85, 247, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(34, 211, 238, 0.16), transparent 28rem),
    rgba(1, 5, 15, 0.82);
  backdrop-filter: blur(18px);
}

.game-overlay-panel {
  position: relative;
  width: min(1120px, calc(100vw - 48px));
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 32px;
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.15), transparent 22rem),
    linear-gradient(180deg, rgba(12, 18, 35, 0.96), rgba(4, 8, 18, 0.96));
  box-shadow: var(--shadow), 0 0 70px rgba(34, 211, 238, 0.12);
}

.game-overlay-close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, #fb7185, #dc2626);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.24);
}
.game-overlay-close svg {
  width: 22px;
  height: 22px;
  display: block;
}

.game-overlay-header {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin: 4px 58px 26px 0;
}
.game-overlay-title-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 126px;
  padding-top: 0;
  transform: translateY(-8px);
}

.game-overlay-logo {
  width: 126px;
  height: 126px;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(2, 6, 23, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.overlay-logo,
.overlay-logo img {
  width: 100%;
  height: 100%;
}

.overlay-logo img {
  object-fit: cover;
}

.game-overlay-title-block h2 {
  display: inline-flex;
  align-items: flex-start;
  margin: 0;
  font-size: clamp(1rem, 3vw, 3rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
}

.game-detail-grid,
.overlay-code-list {
  display: grid;
  gap: 12px;
}

.overlay-code-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 32px 24px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.28);
  color: var(--muted-strong);
  font-size: 0.98rem;
  font-weight: 800;
  text-align: center;
}

.overlay-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
}
.overlay-code-toolbar h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.14em;
}
.code-sort-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.38);
}
.code-sort-toggle button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 950;
}
.code-sort-toggle button.is-active,
.code-sort-toggle button:hover {
  background: rgba(34, 211, 238, 0.16);
  color: var(--cyan);
}

.game-description {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.6;
}

.overlay-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.game-detail-grid {
  grid-template-columns: 1.2fr 1fr 0.5fr;
  margin-bottom: 18px;
}

.game-detail-grid article {
  min-height: 94px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.28);
}

.game-detail-grid article > span:first-child {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-detail-grid .platform-row {
  align-items: center;
  gap: 8px;
}

.game-detail-grid strong,
.game-detail-grid p {
  color: var(--text);
  font-weight: 950;
  margin: 0;
}
.official-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.official-link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--link-color) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--link-color) 18%, transparent);
  color: #ffffff;
  font-weight: 950;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.official-link-button:hover {
  border-color: color-mix(in srgb, var(--link-color) 88%, transparent);
  background: color-mix(in srgb, var(--link-color) 28%, transparent);
}
.official-link-button svg {
  width: 18px;
  height: 18px;
  color: var(--link-color);
}

@media (max-width: 760px) {
  .game-overlay {
    padding: 14px;
  }

  .game-overlay-header {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin: 8px 48px 22px 0;
  }

  .game-overlay-logo {
    width: 86px;
    height: 86px;
    border-radius: 22px;
  }
  .game-overlay-title-block {
    min-height: 86px;
    transform: translateY(-6px);
  }

  .game-detail-grid {
    grid-template-columns: 1fr;
  }
  .overlay-code-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .code-sort-toggle {
    width: 100%;
  }
  .code-sort-toggle button {
    flex: 1;
  }
}


@media (max-width: 520px) {
  .game-overlay {
    padding: 10px;
  }

  .game-overlay-panel {
    width: min(100%, calc(100vw - 20px));
    max-height: min(90vh, 820px);
    padding: 20px 18px 22px;
    border-radius: 28px;
  }

  .game-overlay-close {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
  }

  .game-overlay-close svg {
    width: 19px;
    height: 19px;
  }

  .game-overlay-header {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 0 44px 18px 0;
  }

  .game-overlay-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .game-overlay-title-block {
    display: contents;
    min-height: 0;
    padding-top: 0;
    transform: none;
  }

  .game-overlay-title-block h2 {
    grid-column: 2;
    align-self: center;
    font-size: clamp(1.35rem, 6.6vw, 1.75rem);
    line-height: 0.94;
    letter-spacing: -0.045em;
    overflow-wrap: break-word;
  }

  .game-description {
    grid-column: 1 / -1;
    max-width: none;
    margin: 4px 0 0;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .game-detail-grid article {
    min-height: auto;
    padding: 14px;
    border-radius: 18px;
  }

  .official-link-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.92rem;
  }
}

@media (max-width: 380px) {
  .game-overlay-panel {
    padding: 18px 16px 20px;
    border-radius: 26px;
  }

  .game-overlay-header {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    margin-right: 40px;
  }

  .game-overlay-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .game-overlay-title-block h2 {
    font-size: clamp(1.2rem, 6.2vw, 1.45rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
  }

  .game-description {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .game-detail-grid article {
    padding: 13px;
  }

  .official-link-button {
    width: 100%;
    justify-content: center;
  }
}
