.game-library {
  padding: 58px var(--gutter) 80px;
  max-width: 1700px;
  margin: auto;
}
.library-heading {
  margin-bottom: 50px;
}
.library-heading h1 {
  font-size: clamp(44px, 6vw, 82px);
  line-height: 1.06;
  letter-spacing: -0.05em;
  font-weight: 500;
  margin: 20px 0;
}
.library-heading h1 span {
  color: #a09e99;
}
.library-heading > p:last-child {
  color: #a09e99;
  line-height: 1.6;
  font-size: 16px;
}
.library-platform + .library-platform {
  margin-top: 46px;
}
.library-divider {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}
.library-divider h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.library-divider > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #a09e99;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.library-card {
  border: 1px solid #ffffff20;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(140deg, #17191c, #0b0c0e);
  transition:
    transform 0.3s,
    border-color 0.3s,
    box-shadow 0.3s;
}
.library-card:hover {
  transform: translateY(-5px);
  border-color: #ff937970;
  box-shadow: 0 15px 45px #0004;
}
.library-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.library-trigger {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.library-cover {
  height: 170px;
  position: relative;
  overflow: hidden;
}
.library-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}
.library-card:hover .library-cover > img {
  transform: scale(1.04);
}
.library-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0f1113, transparent 80%);
}
.library-cover > span {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  border: 1px solid #ffffff30;
  border-radius: 30px;
  padding: 6px 10px;
  background: #050607b3;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.library-card-body {
  padding: 0 24px 24px;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.library-icon,
.dialog-icon {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #121416;
  box-shadow:
    0 0 0 1px #ffffff35,
    0 8px 25px #0006;
  margin-top: -44px;
  margin-bottom: 20px;
  position: relative;
}
.library-genre {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.6;
}
.library-card h3 {
  font-size: 25px;
  font-weight: 550;
  letter-spacing: -0.035em;
  margin: 8px 0 12px;
}
.library-description {
  font-size: 13px;
  line-height: 1.75;
  color: #b3afa7;
  flex: 1;
  margin-bottom: 26px;
}
.library-card-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ffffff1c;
  padding-top: 17px;
  font-size: 12px;
}
.library-card-action svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}
.game-dialog {
  color: var(--ink);
  background: #0f1113;
  border: 1px solid #ffffff30;
  border-radius: 20px;
  padding: 0;
  width: min(760px, calc(100% - 40px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 35px 120px #0009;
}
.game-dialog::backdrop {
  background: #040506d9;
  backdrop-filter: blur(10px);
  animation: dialog-dim 0.36s ease both;
}
.game-dialog.is-closing::backdrop {
  animation: dialog-undim 0.22s ease both;
}
.dialog-hero {
  height: 245px;
  position: relative;
  overflow: hidden;
}
.dialog-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0f1113, transparent 75%);
}
.dialog-close {
  position: absolute;
  z-index: 2;
  right: 18px;
  top: 18px;
  border: 1px solid #ffffff50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #060708b3;
  color: white;
  font: 300 28px/1 Arial;
  cursor: pointer;
}
.dialog-close:hover {
  background: #191b1e;
}
.dialog-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.dialog-content {
  padding: 0 38px 36px;
  position: relative;
}
.dialog-icon {
  width: 96px;
  height: 96px;
  margin-top: -50px;
  margin-bottom: 20px;
}
.dialog-content h2 {
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 10px 0 14px;
}
.dialog-lead {
  font-size: 19px;
  line-height: 1.5;
  color: #e9e5dd;
}
.dialog-story {
  font-size: 14px;
  line-height: 1.8;
  color: #b3afa7;
  margin-top: 18px;
}
.dialog-features {
  padding: 20px 0;
  margin: 20px 0;
  border-block: 1px solid #ffffff1c;
  list-style: none;
  display: grid;
  gap: 10px;
}
.dialog-features li {
  font-size: 12px;
  color: #cbc7bf;
  display: flex;
  gap: 12px;
  line-height: 1.5;
}
.dialog-features li::before {
  content: '•';
  color: var(--accent);
}
.dialog-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.dialog-footer .button {
  font-size: 14px;
  border-radius: 5px;
}
.dialog-footer > span {
  font-size: 11px;
  color: var(--accent);
}
html.game-dialog-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}
@keyframes dialog-dim {
  from {
    background: #04050600;
    backdrop-filter: blur(0);
  }
  to {
    background: #040506d9;
    backdrop-filter: blur(10px);
  }
}
@keyframes dialog-undim {
  from {
    background: #040506d9;
  }
  to {
    background: #04050600;
    backdrop-filter: blur(0);
  }
}
@media (min-width: 1300px) {
  .library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .game-library {
    padding: 36px 22px 50px;
  }
  .library-heading h1 {
    font-size: 43px;
  }
  .library-heading > p:last-child {
    font-size: 14px;
  }
  .library-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .library-heading {
    margin-bottom: 32px;
  }
  .library-cover {
    height: 180px;
  }
  .game-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }
  .dialog-hero {
    height: 185px;
  }
  .dialog-content {
    padding: 0 24px 26px;
  }
  .dialog-icon {
    width: 80px;
    height: 80px;
    margin-top: -40px;
  }
  .dialog-lead {
    font-size: 17px;
  }
  .dialog-content h2 {
    font-size: 32px;
  }
  .dialog-footer .button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-dialog::backdrop {
    animation: none;
    backdrop-filter: none;
  }
}
.dialog-video-hero {
  height: auto;
  aspect-ratio: 16/9;
  background: #050607;
}
.dialog-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dialog-video-hero::after {
  display: none;
}
.dialog-video-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 9px 14px;
  border: 1px solid #ffffff40;
  border-radius: 24px;
  background: #060708c9;
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.dialog-video-toggle:hover {
  background: #191b1e;
}
.dialog-video-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.dialog-video-toggle[hidden] {
  display: none;
}
.dialog-video-error {
  position: absolute;
  inset: 45% 20px auto;
  text-align: center;
  font-size: 13px;
  background: #060708;
  color: #fff;
}
.dialog-video-error:empty {
  display: none;
}
.dialog-video-hero + .dialog-content {
  padding-top: 24px;
}
.dialog-video-hero + .dialog-content .dialog-icon {
  margin-top: 0;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .dialog-video-hero {
    height: auto;
    aspect-ratio: 16/9;
  }
  .dialog-video-toggle {
    bottom: 10px;
    right: 12px;
  }
  .dialog-video-hero .dialog-close {
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
  }
}
.dialog-content .dialog-footer {
  margin-top: 22px;
}

/* Shared with all three designs */
.games-main,
.game-dialog {
  color-scheme: dark;
  --bg: #07080a;
  --ink: #f4f0e9;
  --soft: #d6d2ca;
  --muted: #a09e99;
  --line: #ffffff21;
  --mark: initial;
  color: var(--ink);
}
.games-main {
  background: #07080a;
}
.game-library {
  padding-top: clamp(40px, 6vw, 90px);
}
.library-heading h1,
.library-divider h2,
.dialog-content h2 {
  font-family: var(--display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
}
.library-heading h1 {
  font-size: clamp(50px, 9.6vw, 170px);
  line-height: 0.92;
  animation: library-in 1s var(--ease) both;
}
.library-heading h1 span {
  color: var(--accent);
}
.library-divider h2 {
  font-size: clamp(28px, 3.2vw, 46px);
}
.dialog-content h2 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1;
}
@keyframes library-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}
