:root {
  --library-bg: #1c1e2b;
  --library-orange: #fa8a1b;
  --library-orange-light: #faa81b;
  --library-orange-dark: #f68138;
  --library-card-text: #4e5058;
  --library-card-border: #fd5f09;
  --library-card-shadow: inset 0 -4px 4px #eecd99;
  --library-card-shadow-cta: inset 0 4px 4px rgba(255, 203, 116, 0.4), inset 0 -4px 6px var(--library-orange-dark);
}

body {
  min-height: 100vh;
  background: var(--library-bg);
  color: #ffffff;
}

.play-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.play-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.game-topbar {
  background: linear-gradient(89.63deg, var(--library-orange) 6.42%, var(--library-orange-light) 87.23%);
  border-bottom: 1px solid #ff3c00;
}

.game-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1254px;
  margin: 0 auto;
  padding: 10px 0;
  min-height: 64px;
}

.game-topbar__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "Titillium Web", system-ui, sans-serif;
  color: #ffffff;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.game-topbar__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.game-topbar__tagline {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.game-topbar__tagline::before {
  content: "";
  width: 1px;
  height: 40px;
  background: #ffffff;
  display: inline-block;
}

.game-topbar__actions {
  display: flex;
  align-items: center;
  gap: 40px;
  font-family: "Titillium Web", system-ui, sans-serif;
}

.game-topbar__balance {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  text-align: left;
}

.game-topbar__balance-label {
  font-size: 16px;
  line-height: 16px;
  font-weight: 600;
  color: #ffe3b4;
}

.game-topbar__balance-value {
  font-size: 24px;
  line-height: 24px;
  font-weight: 700;
  color: #ffffff;
}

.game-topbar__button {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: #ffe6cd;
  color: var(--library-orange);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  box-shadow: inset 0 -4px 6px rgba(250, 168, 27, 0.4);
  cursor: pointer;
}

.game-topbar__button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.game-library {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--library-bg);
  --card-width: 402px;
  --card-height: 348px;
  --card-padding: 24px;
}

.game-library::before {
  content: "";
  position: absolute;
  inset: -32px -48px;
  transform: scale(1.04);
  background: url("/static/img/gallery_background.png") center/cover no-repeat;
  filter: blur(6px);
  z-index: 0;
}

.game-library::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 30, 43, 0) 0%, #1c1e2b 78.7%);
  transform: rotate(180deg);
  z-index: 0;
  opacity: 0;
}

.game-library__edge {
  display: none;
  position: absolute;
  top: 0;
  bottom: 33%;
  width: 1080px;
  background: linear-gradient(180deg, rgba(28, 30, 43, 0) 0%, #1c1e2b 93.61%);
  z-index: 1;
}

.game-library__edge--left {
  left: 0;
  transform: rotate(90deg);
  transform-origin: top left;
}

.game-library__edge--right {
  right: -360px;
  transform: matrix(0, 1, 1, 0, 0, 0);
}

.game-library__content {
  position: relative;
  z-index: 2;
  max-width: 1254px;
  margin: 0 auto;
  padding: 96px 0 120px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.game-library__heading h1 {
  margin: 0;
  font-family: "David Libre", "Times New Roman", serif;
  font-size: 56px;
  line-height: 48px;
  font-weight: 700;
  color: #ffffff;
}

.game-library__heading p {
  margin: 8px 0 0;
  font-family: "Titillium Web", system-ui, sans-serif;
  font-size: 24px;
  line-height: 32px;
  font-weight: 400;
  color: #ffffff;
}

.game-library__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--card-width));
  gap: 24px;
  justify-content: start;
}

.game-card {
  width: var(--card-width);
  height: var(--card-height);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 12px;
  background: linear-gradient(124.89deg, #ffffff 6.4%, #ffe6cd 113.34%);
  border-bottom: 1px solid var(--library-card-border);
  box-shadow: var(--library-card-shadow);
  overflow: hidden;
}

.game-card__media {
  height: 200px;
  width: 100%;
  background: #ffdfaa;
  position: relative;
}

.game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-card__body {
  padding: 0 var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.game-card__title {
  margin: 0;
  font-family: "David Libre", "Times New Roman", serif;
  font-size: 24px;
  line-height: 24px;
  font-weight: 700;
  color: var(--library-orange);
}

.game-card__desc {
  margin: 0;
  font-family: "Titillium Web", system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--library-card-text);
}

.game-card__footer {
  padding: 0 var(--card-padding) var(--card-padding);
}

.game-card__cta {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--library-orange);
  color: #ffffff;
  font-family: "Titillium Web", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  box-shadow: var(--library-card-shadow-cta);
  cursor: pointer;
}

.game-card__cta:focus-visible {
  outline: 2px solid rgba(250, 138, 27, 0.5);
  outline-offset: 2px;
}

.play-game {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px clamp(16px, 6vw, 120px) 64px;
}

.iframe-wrapper {
  width: 100%;
  height: calc(100vh - 120px);
  background: #0c0e16;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 1280px) {
  .game-library {
    --card-width: 297px;
    --card-height: 364px;
    --card-padding: 16px;
  }

  .game-topbar__inner {
    max-width: 1236px;
    padding: 10px 16px;
  }

  .game-topbar__logo {
    width: 64px;
    height: 64px;
  }

  .game-library__edge {
    bottom: 0%;
    width: 800px;
  }

  .game-library__edge--right {
    right: -80px;
  }

  .game-library__content {
    max-width: 1236px;
    padding: 88px 16px 96px;
  }

  .game-library__heading h1 {
    font-size: 48px;
    line-height: 40px;
  }

  .game-library__heading p {
    font-size: 16px;
    line-height: 24px;
  }

  .game-card {
    width: var(--card-width);
    height: var(--card-height);
  }

  .game-card__desc {
    min-height: 48px;
  }

  .game-library__grid {
  justify-content: start;
  }
}

@media (max-width: 744px) {
  .game-library {
    --card-width: 348px;
    --card-height: 364px;
    --card-padding: 16px;
  }

  .game-topbar__inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }

  .game-topbar__tagline {
    display: none;
  }

  .game-topbar__actions {
    gap: 12px;
  }

  .game-topbar__balance-label {
    font-size: 12px;
    line-height: 12px;
  }

  .game-topbar__balance-value {
    font-size: 16px;
    line-height: 16px;
  }

  .game-topbar__button {
    width: 80px;
    padding: 0;
  }

  .game-library__content {
    padding: 88px 16px 96px;
  }

  .game-library__heading h1 {
    font-size: 40px;
    line-height: 32px;
  }

  .game-library__heading p {
    font-size: 16px;
    line-height: 16px;
  }

  .game-card {
    width: var(--card-width);
    height: var(--card-height);
  }

  .game-library__grid {
  justify-content: center;
  }

}

@media (max-width: 375px) {
  .game-library {
    --card-width: 343px;
    --card-height: 364px;
    --card-padding: 12px;
  }

  .game-topbar__logo {
    width: 56px;
    height: 56px;
  }

  .game-library__content {
    padding: 88px 16px 96px;
  }

  .game-library__heading h1 {
    font-size: 40px;
    line-height: 32px;
  }

  .game-library__heading p {
    font-size: 16px;
    line-height: 16px;
  }

  .game-card {
    width: var(--card-width);
    height: var(--card-height);
  }  
  .game-library__grid {
  justify-content: center;
  }
}
