:root {
  --games-ink: #0f172a;
  --games-muted: #64748b;
  --games-line: #dce8df;
  --games-green: #16a34a;
  --games-green-dark: #166534;
  --games-soft: #ecfdf3;
  --games-wash: #f5fbf6;
}

.games-page {
  min-height: 100vh;
  background: var(--games-wash);
  color: var(--games-ink);
}

.games-page .pmt-nav-links a.active {
  background: var(--green-light);
  border-bottom-color: var(--green);
  color: var(--green-dark);
}

.games-page .pmt-nav-links a > img,
.games-page .pmt-mobile-nav-links a > img {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 0.9rem;
  object-fit: contain;
}

.games-page .home-login-button {
  width: auto;
  min-width: 86px;
  padding: 0 15px;
  gap: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #b0ff8c, #46e900);
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.games-page .home-mobile-login {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 0;
  background: transparent;
  color: var(--games-ink);
  font: 500 15px "Poppins", "Plus Jakarta Sans", sans-serif;
  text-align: left;
}

.games-page .home-mobile-login i {
  color: var(--games-green);
  font-size: 18px;
}

.games-page .home-mobile-login:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.3);
  outline-offset: -3px;
}

.games-page .pmt-mobile-nav {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  .games-page .home-login-button {
    width: 34px;
    min-width: 34px;
    padding: 0;
    gap: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 17px;
  }

  .games-page .home-login-button > [data-auth-trigger-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.games-wrap {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.games-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(134, 239, 172, 0.56), transparent 30%),
    linear-gradient(118deg, #f7fff7 0%, #eaffef 53%, #d8f8df 100%);
}

.games-hero::after {
  position: absolute;
  right: -110px;
  bottom: -210px;
  width: 510px;
  height: 510px;
  border: 1px solid rgba(22, 163, 74, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(22, 163, 74, 0.035), 0 0 0 74px rgba(22, 163, 74, 0.025);
  content: "";
}

.games-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: end;
  gap: 50px;
  padding-top: 68px;
  padding-bottom: 54px;
}

.games-hero-copy {
  max-width: 720px;
}

.games-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--games-green-dark);
  font-family: "Poppins-SemiBold", sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.games-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--games-green);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.games-hero h1 {
  max-width: 720px;
  margin: 17px 0 18px;
  color: #14532d;
  font-family: "Poppins-Bold", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(42px, 6.4vw, 78px);
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.games-hero h1 > span {
  display: block;
}

.games-hero h1 > span + span {
  margin-top: 0.08em;
}

.games-hero h1 .games-hero-title-main {
  color: #14532d;
}

.games-hero h1 .games-hero-title-accent {
  color: var(--games-green);
}

.games-hero-copy p {
  max-width: 610px;
  margin: 0;
  color: #486257;
  font-size: 16px;
  line-height: 1.7;
}

.games-hero-card {
  display: grid;
  gap: 7px;
  padding: 24px;
  border: 1px solid rgba(22, 101, 52, 0.15);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 50px rgba(22, 101, 52, 0.1);
  backdrop-filter: blur(10px);
}

.games-hero-card-icon {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #166534, #22c55e);
  color: white;
  font-size: 24px;
  box-shadow: 0 10px 20px rgba(22, 101, 52, 0.2);
}

.games-hero-card strong {
  color: #14532d;
  font-family: "Poppins-SemiBold", sans-serif;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.games-hero-card span {
  color: #5d7968;
  font-size: 12px;
  line-height: 1.5;
}

.games-library {
  padding-top: 34px;
  padding-bottom: 74px;
}

.games-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 20;
  display: grid;
  gap: 16px;
  margin-bottom: 36px;
  padding: 18px 0 16px;
  background: rgba(245, 251, 246, 0.94);
  backdrop-filter: blur(14px);
}

.games-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid #b8d8c1;
  border-radius: 17px;
  background: white;
  box-shadow: 0 12px 30px rgba(22, 101, 52, 0.07);
}

.games-search-field > i {
  color: var(--games-green);
  font-size: 20px;
}

.games-search-field input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  outline: 0;
  color: var(--games-ink);
  font: 500 14px "Plus Jakarta Sans", sans-serif;
}

.games-search-field input::placeholder {
  color: #8da195;
}

.games-search-clear {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8da195;
  cursor: pointer;
}

.games-search-clear:hover {
  background: var(--games-soft);
  color: var(--games-green-dark);
}

.games-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--games-muted);
  font-size: 12px;
}

.games-toolbar-meta span {
  font-family: "Poppins-SemiBold", sans-serif;
}

.games-reset {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--games-green-dark);
  cursor: pointer;
  font: 700 12px "Plus Jakarta Sans", sans-serif;
}

.games-reset:hover {
  text-decoration: underline;
}

.games-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.games-filter {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cfe1d3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #537060;
  cursor: pointer;
  font: 700 11px "Plus Jakarta Sans", sans-serif;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.games-filter:hover {
  border-color: #86c896;
  color: var(--games-green-dark);
  transform: translateY(-1px);
}

.games-filter.active {
  border-color: var(--games-green);
  background: var(--games-green-dark);
  color: white;
  box-shadow: 0 6px 14px rgba(22, 101, 52, 0.18);
}

.games-filter-count {
  margin-left: 4px;
  opacity: 0.72;
}

.games-search-clear:focus-visible,
.games-reset:focus-visible,
.games-filter:focus-visible,
.game-card-action:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.3);
  outline-offset: 3px;
}

.games-status {
  padding: 38px 20px;
  border: 1px dashed #b8d8c1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--games-muted);
  text-align: center;
}

.games-status.error {
  border-color: #f0b4b4;
  background: #fff7f7;
  color: #9f3636;
}

.games-sections {
  display: grid;
  gap: 42px;
}

.games-specialty-section {
  min-width: 0;
}

.games-specialty-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.games-specialty-heading h2 {
  margin: 0;
  color: #14532d;
  font-family: "Poppins-SemiBold", sans-serif;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: -0.04em;
}

.games-specialty-heading p {
  margin: 5px 0 0;
  color: #74907e;
  font-size: 12px;
}

.games-specialty-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e2f7e7;
  color: var(--games-green-dark);
  font-size: 11px;
  font-weight: 800;
}

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

.game-card {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--games-line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 26px rgba(22, 101, 52, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.game-card:hover {
  border-color: #93cfa1;
  box-shadow: 0 16px 34px rgba(22, 101, 52, 0.11);
  transform: translateY(-3px);
}

.game-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.game-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #eaf9ee;
  color: var(--games-green-dark);
  font-size: 18px;
}

.game-card-title {
  flex: 1;
  margin: 0;
  color: #1e3a2a;
  font-family: "Poppins-SemiBold", sans-serif;
  font-size: 16px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.game-card-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 17px 0 15px;
  color: #63766a;
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 3px;
}

.game-card-tag {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f1f8f2;
  color: #5c7864;
  font-size: 10px;
  font-weight: 700;
}

.game-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  margin-top: 18px;
  border-radius: 11px;
  background: linear-gradient(135deg, #166534, #22c55e);
  color: white;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: filter 160ms ease, transform 160ms ease;
}

.game-card-action:hover {
  color: white;
  filter: brightness(0.96);
  text-decoration: none;
  transform: translateY(-1px);
}

.games-empty {
  padding: 54px 20px;
  border: 1px dashed #b8d8c1;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--games-muted);
  text-align: center;
}

.games-empty i {
  display: block;
  margin-bottom: 12px;
  color: #77b985;
  font-size: 30px;
}

.games-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #28583a;
  font-size: 15px;
}

@media (max-width: 1020px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .games-wrap {
    width: min(100% - 28px, 640px);
  }

  .games-hero-inner {
    grid-template-columns: 1fr;
    gap: 27px;
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .games-hero-card {
    max-width: 340px;
  }

  .games-toolbar {
    top: var(--nav-height);
    margin-bottom: 26px;
  }
}

@media (max-width: 560px) {
  /* Mobile UX refinements: keep the first screen compact and every control easy to tap. */
  .games-hero-inner {
    gap: 20px;
    padding-top: 38px;
    padding-bottom: 28px;
  }

  .games-hero h1 {
    margin: 14px 0;
    font-size: clamp(38px, 11vw, 54px);
  }

  .games-hero-copy p {
    font-size: 14px;
    line-height: 1.6;
  }

  .games-hero-card {
    max-width: none;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    padding: 18px;
  }

  .games-hero-card-icon {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    margin-bottom: 0;
    border-radius: 14px;
    font-size: 20px;
  }

  .games-hero-card strong {
    font-size: 22px;
  }

  .games-toolbar {
    gap: 12px;
    margin-bottom: 22px;
    padding: 12px 0;
  }

  .games-search-clear {
    width: 44px;
    height: 44px;
  }

  .games-reset {
    min-height: 44px;
    padding: 10px 0;
  }

  .games-filters {
    gap: 7px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .games-filter {
    min-height: 44px;
    padding: 0 15px;
    scroll-snap-align: start;
    touch-action: manipulation;
  }

  .games-sections {
    gap: 32px;
  }

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

  .games-specialty-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .games-library {
    padding-top: 20px;
    padding-bottom: 48px;
  }

  .game-card {
    min-height: 0;
    padding: 18px;
  }

  .game-card-description {
    margin: 14px 0 13px;
    -webkit-line-clamp: 3;
  }

  .game-card-action {
    min-height: 46px;
    margin-top: 15px;
    touch-action: manipulation;
  }
}
