:root {
  --gwh-primary: #8b5cf6;
  --gwh-primary-dark: #6d28d9;
  --gwh-ink: #24183d;
  --gwh-muted: #766d87;
  --gwh-surface: #ffffff;
  --gwh-border: #e7e1f2;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f7f5fb; }

body {
  margin: 0;
  color: var(--gwh-ink);
  background: #f7f5fb;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

button, input { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 20px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gwh-game-popup[hidden] { display: none; }
.gwh-game-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 0;
  visibility: hidden;
  opacity: 0;
  background: rgba(9, 0, 24, .88);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, visibility 180ms ease;
}
.gwh-game-popup.is-open { visibility: visible; opacity: 1; }
.gwh-game-popup__dialog {
  --gwh-hub-chrome-offset: 100px;
  display: flex;
  flex-direction: column;
  width: min(1500px, 96vw);
  height: min(900px, 90vh);
  overflow: hidden;
  border: 2px solid #d26dff;
  border-radius: 20px;
  background: #100022;
  box-shadow: 0 0 48px rgba(210, 47, 255, .7), 0 24px 80px rgba(0, 0, 0, .55);
  transform: scale(.97);
  transition: transform 180ms ease;
}
.gwh-game-popup.is-open .gwh-game-popup__dialog { transform: none; }
.gwh-game-popup__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
  min-height: 58px;
  padding: 8px 14px 8px 22px;
  color: #fff;
  border-bottom: 2px solid #ff41d6;
  background: linear-gradient(90deg, #230044, #7116a7 48%, #d10b86);
  box-shadow: 0 0 24px rgba(255, 53, 219, .55);
}
.gwh-game-popup__bar h2 {
  overflow: hidden;
  margin: 0;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gwh-game-popup__close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  background: rgba(255,255,255,.1);
  cursor: pointer;
}
.gwh-game-popup__close:hover { background: #ef3a9c; }
.gwh-game-popup__frame {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #080013;
}
.gwh-game-popup__frame iframe {
  position: absolute;
  top: calc(-1 * var(--gwh-hub-chrome-offset));
  left: 0;
  display: block;
  width: 100%;
  height: calc(100% + var(--gwh-hub-chrome-offset));
  border: 0;
  background: #080013;
}
@media (max-width: 767px) {
  .gwh-game-popup { padding: 0; }
  .gwh-game-popup__dialog {
    --gwh-hub-chrome-offset: 88px;
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
  .gwh-game-popup__bar { min-height: 52px; padding: 6px 10px 6px 14px; }
}

.gwh-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(139, 92, 246, .2);
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 30px rgba(58, 36, 91, .06);
  backdrop-filter: blur(16px);
}

.gwh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 70px;
  margin: auto;
}

.gwh-brand {
  color: #7c3aed;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.06em;
  text-decoration: none;
  text-shadow: 0 2px 0 #fff, 0 0 16px rgba(139,92,246,.34);
}

.gwh-brand span { color: #f59e0b; }
.gwh-brand__crown { margin-right: 4px; color: #f59e0b; font-style: normal; }

.gwh-nav { display: flex; gap: 8px; }
.gwh-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: #554866;
  font-weight: 700;
  text-decoration: none;
}
.gwh-nav a:hover, .gwh-nav a.is-active { color: #fff; background: var(--gwh-primary); }

.gwh-main {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
  padding: 54px 0 70px;
}

.gwh-heading { max-width: 720px; margin-bottom: 30px; }
.gwh-eyebrow {
  margin: 0 0 8px;
  color: var(--gwh-primary-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
}
.gwh-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.55rem); letter-spacing: -.04em; }
.gwh-heading p:last-child { margin: 12px 0 0; color: var(--gwh-muted); font-size: 1.04rem; line-height: 1.7; }

.gwh-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--gwh-border);
  border-radius: 18px;
  background: var(--gwh-surface);
  box-shadow: 0 14px 34px rgba(67, 41, 100, .06);
}

.gwh-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(100%, 300px);
  padding: 0 14px;
  border: 1px solid var(--gwh-border);
  border-radius: 14px;
  color: var(--gwh-primary-dark);
  background: #faf9fd;
}
.gwh-search input { width: 100%; min-height: 44px; border: 0; outline: 0; background: transparent; }
.gwh-search:focus-within { border-color: var(--gwh-primary); box-shadow: 0 0 0 3px rgba(139,92,246,.13); }

.gwh-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.gwh-filters button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--gwh-border);
  border-radius: 999px;
  color: #5d526e;
  font-weight: 750;
  background: #fff;
  cursor: pointer;
}
.gwh-filters button:hover, .gwh-filters button.is-active { border-color: var(--gwh-primary); color: #fff; background: var(--gwh-primary); }

.gwh-result-count { min-height: 24px; margin: 0 0 14px; color: var(--gwh-muted); font-size: .92rem; }

.gwh-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.gwh-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--gwh-border);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  background: var(--gwh-surface);
  box-shadow: 0 12px 30px rgba(67,41,100,.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.gwh-card:hover, .gwh-card:focus-visible { transform: translateY(-5px); border-color: var(--gwh-primary); box-shadow: 0 18px 40px rgba(109,40,217,.18); outline: 0; }

.gwh-card__image-wrap { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: #e9e4f4; }
.gwh-card__image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 240ms ease; }
.gwh-card:hover img { transform: scale(1.04); }
.gwh-card__play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: .86rem;
  font-weight: 850;
  background: linear-gradient(135deg, var(--gwh-primary), var(--gwh-primary-dark));
  box-shadow: 0 7px 18px rgba(76,29,149,.32);
}
.gwh-card__body { display: block; padding: 14px; }
.gwh-card__body strong { display: block; overflow: hidden; min-height: 2.7em; line-height: 1.35; }
.gwh-card__meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; color: var(--gwh-muted); font-size: .78rem; }
.gwh-card[hidden] { display: none; }

.gwh-empty { padding: 54px 20px; color: var(--gwh-muted); text-align: center; }
.gwh-footer { padding: 22px 16px; border-top: 1px solid var(--gwh-border); color: var(--gwh-muted); text-align: center; background: #fff; }

.gwh-play-body { height: 100vh; overflow: hidden; color: #fff; background: #100022; }
.gwh-playbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(90deg, #26004d, #4c117a, #26004d);
}
.gwh-playbar__back, .gwh-brand--play { color: #fff; text-decoration: none; }
.gwh-playbar__back { justify-self: start; font-weight: 750; }
.gwh-brand--play { justify-self: center; }
.gwh-playbar__title { justify-self: end; overflow: hidden; max-width: 36vw; text-overflow: ellipsis; white-space: nowrap; color: #e9d5ff; }
.gwh-player { height: calc(100vh - 62px); }
.gwh-player iframe { display: block; width: 100%; height: 100%; border: 0; background: #0c001c; }
.gwh-not-found { display: grid; place-items: center; align-content: center; min-height: calc(100vh - 62px); padding: 24px; text-align: center; }
.gwh-primary-button { padding: 12px 20px; border-radius: 999px; color: #fff; text-decoration: none; background: var(--gwh-primary); }

@media (max-width: 900px) {
  .gwh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gwh-controls { align-items: stretch; flex-direction: column; }
  .gwh-search { width: 100%; }
  .gwh-filters { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .gwh-header__inner, .gwh-main { width: min(100% - 22px, 1180px); }
  .gwh-header__inner { min-height: 60px; }
  .gwh-nav a { padding: 8px 10px; font-size: .88rem; }
  .gwh-main { padding-top: 34px; }
  .gwh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gwh-card__body { padding: 11px; }
  .gwh-card__meta { align-items: flex-start; flex-direction: column; }
  .gwh-card__play { right: 8px; bottom: 8px; padding: 6px 9px; font-size: .75rem; }
  .gwh-playbar { grid-template-columns: 1fr auto; min-height: 56px; padding-inline: 12px; }
  .gwh-playbar__title { display: none; }
  .gwh-player { height: calc(100vh - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
