/* TBlog Games - Newgrounds-inspired catalogue. */

.game-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: #0a0908 url('/assets/game-bg.jpg') center top / cover fixed no-repeat;
  color: #f5f5f5;
  font-family: Arial, Helvetica, sans-serif;
}

.game-page::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.58) 17%, rgba(5, 5, 5, 0.5) 83%, rgba(5, 5, 5, 0.95) 100%);
}

.game-page .site-top,
.game-page .site-footer,
.game-stage {
  position: relative;
  z-index: 1;
}

.game-stage {
  width: min(960px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 44px;
}

.games-window {
  overflow: hidden;
  border: 1px solid #3b3834;
  border-radius: 8px;
  background: rgba(17, 16, 15, 0.97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
}

.games-titlebar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-top: 4px solid #f29a1f;
  border-bottom: 1px solid #3c3935;
  background: #242321;
}

.games-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: none;
}

.games-title-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ffb950;
  border-radius: 6px;
  background: #f29a1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.games-title-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #19130b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.forum-link {
  color: #f8aa39;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.forum-link::after {
  margin-left: 7px;
  content: "→";
}

.forum-link:hover,
.forum-link:focus-visible {
  color: #ffd18b;
  outline: none;
}

.game-spotlight {
  display: grid;
  height: 360px;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  gap: 12px;
  padding: 16px 16px 4px;
  background: #151412;
}

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

.spotlight-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #3c3935;
  border-radius: 6px;
  background: #242321;
  color: #fff;
  text-decoration: none;
}

.spotlight-card--main {
  grid-row: auto;
}

.spotlight-media,
.spotlight-media > img,
.spotlight-media > .game-card-no-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spotlight-media > img {
  object-fit: cover;
  transition: transform 240ms ease, filter 240ms ease;
}

.spotlight-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 9, 8, 0.98) 0%, rgba(10, 9, 8, 0.65) 38%, rgba(10, 9, 8, 0.06) 76%);
}

.spotlight-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 16px;
}

.spotlight-card--main .spotlight-copy {
  padding: 22px;
}

.spotlight-kicker {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  color: #ffb347;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.spotlight-rating {
  color: #ffd45e;
}

.spotlight-copy h2 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.spotlight-card--main .spotlight-copy h2 {
  max-width: 23ch;
  font-size: 34px;
}

.spotlight-copy p {
  margin: 7px 0 0;
  overflow: hidden;
  color: #d2d2d2;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotlight-card:hover,
.spotlight-card:focus-visible {
  border-color: #f29a1f;
  outline: none;
}

.spotlight-card:hover .spotlight-media > img,
.spotlight-card:focus-visible .spotlight-media > img {
  filter: brightness(1.08);
  transform: scale(1.025);
}

.spotlight-card--loading {
  min-height: 0;
  pointer-events: none;
}

.games-board {
  padding: 18px 16px 22px;
  background: #151412;
}

.games-tabs {
  display: flex;
  min-height: 42px;
  align-items: flex-end;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
  border-bottom: 1px solid #3b3834;
}

.games-tab {
  position: relative;
  min-height: 41px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: #aaa7a2;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.games-tab::after {
  position: absolute;
  right: 15px;
  bottom: -1px;
  left: 15px;
  height: 3px;
  content: "";
  background: transparent;
}

.games-tab:hover,
.games-tab:focus-visible {
  color: #fff;
  outline: none;
}

.games-tab.active {
  color: #fff;
}

.games-tab.active::after {
  background: #f29a1f;
}

.games-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.filter-field span {
  color: #8f8c87;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-field select {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 34px 0 11px;
  border: 1px solid #45413c;
  border-radius: 5px;
  background: #272522;
  color: #f0f0f0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.filter-field select:hover {
  border-color: #5b554e;
}

.filter-field select:focus-visible {
  border-color: #f29a1f;
  box-shadow: 0 0 0 2px rgba(242, 154, 31, 0.22);
}

.filter-field select option {
  background: #272522;
  color: #fff;
}

.games-status {
  min-height: 18px;
  margin: 0 0 10px;
  color: #88847f;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #3b3834;
  border-radius: 6px;
  background: #242321;
  color: #fff;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: #f29a1f;
  background: #2b2926;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
  outline: none;
}

.game-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.game-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease, filter 200ms ease;
}

.game-card:hover .game-card-thumb img,
.game-card:focus-visible .game-card-thumb img {
  filter: brightness(1.08);
  transform: scale(1.03);
}

.game-card-no-thumb {
  display: grid;
  width: 100%;
  height: 100%;
  align-content: center;
  place-items: center;
  gap: 4px;
  background: #33302c;
  color: #bbb6af;
  text-align: center;
}

.game-card-no-thumb strong {
  max-width: 90%;
  overflow: hidden;
  color: #f3a333;
  font-size: 18px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-card-no-thumb span {
  color: #8e8982;
  font-size: 11px;
  font-weight: 700;
}

.game-card-genre,
.game-card-rating {
  position: absolute;
  bottom: 8px;
  z-index: 1;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(12, 11, 10, 0.86);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.game-card-genre {
  left: 8px;
  color: #ffb347;
  text-transform: uppercase;
}

.game-card-rating {
  right: 8px;
  color: #ffd45e;
}

.game-card-copy {
  display: flex;
  min-height: 114px;
  flex: 1;
  flex-direction: column;
  padding: 12px;
}

.game-card-title {
  display: -webkit-box;
  min-height: 40px;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-shadow: none;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-card-author {
  min-height: 18px;
  margin-top: 5px;
  overflow: hidden;
  color: #a9a5a0;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-meta {
  display: flex;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  overflow: visible;
  color: #817d77;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.game-card-action {
  color: #f4a331;
  font-weight: 800;
}

.game-empty {
  margin: 18px 0 0;
  padding: 28px;
  border: 1px dashed #4b4640;
  border-radius: 6px;
  background: #211f1c;
  color: #aaa6a0;
  text-align: center;
  font-size: 14px;
}

.game-load-more {
  display: flex;
  justify-content: center;
  padding: 24px 0 2px;
}

.game-load-more[hidden],
.game-empty[hidden] {
  display: none;
}

.game-load-btn {
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid #ffb34b;
  border-radius: 5px;
  background: #f29a1f;
  color: #1b1308;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.game-load-btn:hover,
.game-load-btn:focus-visible {
  border-color: #ffd08a;
  background: #ffb33f;
  outline: none;
}

.game-page .skeleton {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #252321 0%, #3a3733 50%, #252321 100%);
  background-size: 220% 100%;
  animation: gameSkeleton 1.2s linear infinite;
}

.skeleton-line {
  width: 78%;
  height: 18px;
  margin: 0 auto;
}

.skeleton-short {
  width: 42%;
  height: 13px;
  margin: 0 auto;
}

.game-card--loading {
  min-height: 264px;
  pointer-events: none;
}

@keyframes gameSkeleton {
  to { background-position: -220% 0; }
}

@media (max-width: 1050px) {
  .game-stage {
    width: min(960px, calc(100% - 20px));
  }
}

@media (max-width: 820px) {
  .game-stage {
    width: min(680px, calc(100% - 16px));
  }

  .game-spotlight {
    height: 320px;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .spotlight-card--main {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .games-controls,
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .game-page {
    background-attachment: scroll;
  }

  .game-stage {
    width: 100%;
    padding: 0 0 24px;
  }

  .games-window {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .games-titlebar {
    min-height: 58px;
    padding: 0 12px;
    border-radius: 0;
  }

  .games-title {
    font-size: 21px;
  }

  .forum-link {
    font-size: 12px;
  }

  .game-spotlight {
    height: 260px;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 8px;
    padding: 10px 8px 4px;
  }

  .spotlight-card--main {
    grid-column: auto;
  }

  .spotlight-card--main .spotlight-copy {
    padding: 16px;
  }

  .spotlight-card--main .spotlight-copy h2 {
    font-size: 26px;
  }

  .games-board {
    padding: 14px 8px 18px;
  }

  .games-tabs {
    gap: 0;
  }

  .games-tab {
    padding: 0 11px;
    font-size: 13px;
  }

  .games-controls,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card-copy {
    min-height: 104px;
  }
}
