:root {
  --ink: #13172a;
  --muted: #687086;
  --paper: #f6f6f2;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(19, 23, 42, 0.1);
  --purple: #7147e8;
  --purple-dark: #4e2bb8;
  --lime: #dfff73;
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
}

a {
  color: inherit;
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(3px);
  opacity: 0.7;
}

.ambient-one {
  top: -180px;
  right: -100px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(113, 71, 232, 0.22), transparent 68%);
}

.ambient-two {
  top: 420px;
  left: -280px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(223, 255, 115, 0.55), transparent 68%);
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  border-radius: 10px;
  background: var(--purple);
  transform: rotate(-5deg);
}

nav {
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--purple);
}

.hero {
  display: grid;
  min-height: 620px;
  padding: 110px 0 72px;
  align-content: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--purple);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 26px;
  height: 2px;
  background: currentColor;
}

h1,
h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 850px;
  font-size: clamp(3.6rem, 8vw, 7.4rem);
  line-height: 0.92;
}

h1 em {
  color: var(--purple);
  font-style: normal;
}

.hero-copy {
  max-width: 570px;
  margin: 32px 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.tag-selector {
  display: flex;
  width: min(100%, 760px);
  align-items: center;
  gap: 14px;
}

.tag-selector > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-filter {
  padding: 10px 15px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.tag-filter:hover,
.tag-filter:focus-visible {
  color: var(--purple);
  border-color: rgba(113, 71, 232, 0.38);
  outline: none;
  transform: translateY(-1px);
}

.tag-filter[aria-pressed="true"] {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.hero-stats {
  display: flex;
  gap: clamp(28px, 6vw, 76px);
  margin-top: 72px;
}

.hero-stats div {
  display: grid;
}

.hero-stats strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.games-section {
  padding: 100px 0 120px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 46px;
}

.section-heading h2,
.coming-soon h2 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.04;
}

.section-heading > p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.game-card {
  position: relative;
  display: flex;
  min-height: 310px;
  overflow: hidden;
  grid-column: span 4;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 18px 60px rgba(30, 26, 60, 0.05);
  text-decoration: none;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.game-card.featured {
  grid-column: span 6;
}

.game-card.solo {
  grid-column: 1 / -1;
}

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

.game-card:hover,
.game-card:focus-visible {
  border-color: rgba(113, 71, 232, 0.35);
  box-shadow: 0 22px 60px rgba(76, 48, 150, 0.13);
  transform: translateY(-5px);
  outline: none;
}

.game-card::after {
  position: absolute;
  right: -65px;
  bottom: -95px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--accent, var(--purple));
  content: "";
  opacity: 0.09;
  transition: transform 300ms ease;
}

.game-card:hover::after {
  transform: scale(1.18);
}

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

.game-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 15%, white);
  font-size: 1.75rem;
}

.external-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.15rem;
  transition: color 180ms ease, background 180ms ease;
}

.game-card:hover .external-icon {
  color: white;
  background: var(--ink);
}

.card-content h3 {
  margin: 0 0 9px;
  font-family: "Outfit", sans-serif;
  font-size: 1.55rem;
}

.card-content p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.game-tag {
  display: inline-block;
  padding: 6px 10px;
  color: var(--accent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


.resources-section {
  padding: 20px 0 120px;
}

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

.resource-card {
  --resource-accent: var(--purple);
  position: relative;
  display: flex;
  min-height: 235px;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 48px rgba(30, 26, 60, 0.04);
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  border-color: color-mix(in srgb, var(--resource-accent) 48%, transparent);
  box-shadow: 0 20px 54px color-mix(in srgb, var(--resource-accent) 15%, transparent);
  outline: none;
  transform: translateY(-4px);
}

.resource-theme-show {
  --resource-accent: #7147e8;
}

.resource-theme-online {
  --resource-accent: #168d81;
}

.resource-theme-logic {
  --resource-accent: #4f8a3f;
}

.resource-theme-community {
  --resource-accent: #3477cf;
}

.resource-theme-puzzle {
  --resource-accent: #d16f20;
}

.resource-category {
  width: fit-content;
  margin-bottom: auto;
  padding: 6px 9px;
  color: color-mix(in srgb, var(--resource-accent) 82%, var(--ink));
  border-radius: 999px;
  background: color-mix(in srgb, var(--resource-accent) 13%, white);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-card h3 {
  max-width: calc(100% - 32px);
  margin: 30px 0 8px;
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  line-height: 1.12;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.resource-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--resource-accent);
  border: 1px solid color-mix(in srgb, var(--resource-accent) 24%, transparent);
  border-radius: 50%;
}

.resources-disclaimer {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

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

@media (max-width: 560px) {
  .resources-section {
    padding-bottom: 80px;
  }

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

  .resource-card {
    min-height: 210px;
  }
}

.coming-soon {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 70px;
  align-items: end;
  padding: clamp(44px, 7vw, 82px);
  color: white;
  border-radius: 34px;
  background: var(--ink);
}

.eyebrow.light {
  color: var(--lime);
}

.coming-soon > p {
  margin: 0;
  color: #bfc4d4;
  line-height: 1.7;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-block: 54px;
  color: var(--muted);
  font-size: 0.83rem;
}

footer p {
  margin: 0;
}

footer p:last-child {
  text-align: right;
}

.footer-brand {
  color: var(--ink);
}

@media (max-width: 800px) {
  .hero {
    min-height: auto;
    padding-top: 80px;
  }

  .section-heading,
  .coming-soon {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .game-card,
  .game-card.featured,
  .game-card.solo {
    grid-column: span 6;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }

  footer > p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  nav {
    display: none;
  }

  h1 {
    font-size: clamp(3.3rem, 17vw, 5rem);
  }

  .tag-selector {
    display: grid;
  }

  .tag-filters {
    flex-wrap: nowrap;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tag-filters::-webkit-scrollbar {
    display: none;
  }

  .tag-filter {
    flex: 0 0 auto;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .hero-stats span {
    font-size: 0.72rem;
  }

  .games-section {
    padding-top: 70px;
  }

  .game-card,
  .game-card.featured,
  .game-card.solo {
    min-height: 280px;
    grid-column: 1 / -1;
  }

  .coming-soon {
    gap: 30px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.account-button,
.profile-cta,
.google-button,
.auth-primary,
.auth-secondary {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 210px;
  padding: 7px 13px 7px 7px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.account-button > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-initial,
.profile-avatar {
  display: grid;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--purple);
}

.account-initial {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.profile-promo {
  display: grid;
  gap: 22px;
}

.profile-promo p {
  margin: 0;
  color: #bfc4d4;
  line-height: 1.7;
}

.profile-cta {
  width: fit-content;
  padding: 14px 20px;
  color: var(--ink);
  border-radius: 999px;
  background: var(--lime);
}

.auth-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(250, 250, 247, 0.96);
  box-shadow: 0 30px 100px rgba(19, 23, 42, 0.28);
}

.auth-dialog::backdrop {
  background: rgba(19, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}

.auth-dialog-inner {
  position: relative;
  padding: clamp(28px, 6vw, 48px);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 1.5rem;
}

.auth-dialog h2 {
  padding-right: 28px;
  font-size: clamp(2rem, 6vw, 3.15rem);
  line-height: 1;
}

.auth-copy,
#profile-email {
  color: var(--muted);
  line-height: 1.6;
}

.google-button,
.auth-primary,
.auth-secondary {
  min-height: 50px;
  border-radius: 14px;
}

.google-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  color: white;
  background: var(--ink);
}

.google-button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
  background: white;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.auth-separator::before,
.auth-separator::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  padding: 14px 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: white;
  font: inherit;
}

.auth-form input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(113, 71, 232, 0.12);
}

.auth-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.auth-primary {
  color: white;
  background: var(--purple);
}

.auth-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: white;
}

.auth-status {
  min-height: 1.35em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-status[data-kind="error"] {
  color: #b33448;
}

.auth-status[data-kind="success"] {
  color: #14735d;
}

.auth-status[data-kind="email-rate-limit"] {
  display: grid;
  gap: 4px;
}

.auth-status-line {
  display: block;
}

.auth-status-line--danger {
  color: #b33448;
}

.auth-status-line--info {
  color: #3477cf;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  font-family: "Outfit", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}

.profile-identity h2,
.profile-identity p {
  margin: 0;
}

@media (max-width: 560px) {
  .header-actions {
    gap: 8px;
  }

  .account-button {
    max-width: 155px;
  }

  .account-button > span:last-child {
    display: none;
  }

  .auth-form-actions {
    grid-template-columns: 1fr;
  }
}
