:root {
  color-scheme: dark;
  --ink: #f6f1e8;
  --muted: #b8c3c1;
  --bg: #12181f;
  --panel-2: #223036;
  --line: rgba(246, 241, 232, 0.13);
  --green: #55d69c;
  --gold: #ffcf56;
  --coral: #e58f65;
  --blue: #84a8ff;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(85, 214, 156, 0.14), transparent 34rem),
    linear-gradient(315deg, rgba(132, 168, 255, 0.14), transparent 30rem),
    var(--bg);
}

.hub {
  width: min(1120px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 56px) 0;
  display: grid;
  align-content: center;
  gap: 28px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 24px;
  align-items: end;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-top: 5px;
  font-size: clamp(2.7rem, 8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.intro {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

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

.game-card {
  min-width: 0;
  min-height: 420px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 37, 43, 0.86);
  box-shadow: 0 24px 70px var(--shadow);
  color: inherit;
  text-decoration: none;
}

.active {
  transition: transform 180ms ease, border-color 180ms ease;
}

.active:hover {
  transform: translateY(-4px);
  border-color: rgba(85, 214, 156, 0.58);
}

.locked {
  opacity: 0.68;
}

.preview {
  min-height: 230px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent),
    var(--panel-2);
}

.circuit-preview {
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 8px;
}

.circuit-preview span {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 41%, rgba(85, 214, 156, 0.8) 41% 59%, transparent 59%),
    linear-gradient(0deg, transparent 41%, rgba(85, 214, 156, 0.35) 41% 59%, transparent 59%),
    #2a3a3f;
}

.circuit-preview span:first-child {
  background:
    radial-gradient(circle, var(--gold) 0 18%, transparent 19%),
    linear-gradient(180deg, rgba(85, 214, 156, 0.8) 0 100%),
    #2a3a3f;
  box-shadow: 0 0 28px rgba(255, 207, 86, 0.35);
}

.circuit-preview span:nth-child(6),
.circuit-preview span:nth-child(8) {
  background:
    radial-gradient(circle, var(--coral) 0 16%, transparent 17%),
    #2a3a3f;
}

.number-preview,
.word-preview,
.jigsaw-preview {
  grid-template-columns: repeat(2, 74px);
  gap: 10px;
}

.jigsaw-preview {
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 4px;
  background:
    linear-gradient(rgba(8, 13, 24, 0.08), rgba(8, 13, 24, 0.2)),
    url("jigsaw-20/puzzle-thumb.webp") center / cover;
}

.number-preview span,
.word-preview span {
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(246, 241, 232, 0.08);
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.word-preview span {
  color: var(--blue);
}

.jigsaw-preview span {
  width: 54px;
  aspect-ratio: 1;
  border-radius: 4px;
  background:
    linear-gradient(rgba(255, 248, 236, 0.18), rgba(255, 248, 236, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 248, 236, 0.22);
  backdrop-filter: saturate(1.18);
}

.jigsaw-preview span:nth-child(2),
.jigsaw-preview span:nth-child(5),
.jigsaw-preview span:nth-child(7) {
  transform: translateY(8px);
}

.jigsaw-preview span:nth-child(4),
.jigsaw-preview span:nth-child(8) {
  background: linear-gradient(rgba(120, 224, 180, 0.22), rgba(255, 248, 236, 0.04));
}

.card-copy {
  padding: 20px;
}

.tag {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  margin-top: 6px;
  font-size: 1.55rem;
}

.card-copy p:not(.tag) {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.5;
}

.card-copy strong {
  display: inline-block;
  margin-top: 18px;
  color: var(--green);
}

.locked .card-copy strong {
  color: var(--muted);
}

@media (max-width: 900px) {
  .masthead,
  .games {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 0;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .preview {
    min-height: 220px;
  }
}

@media (max-width: 620px) {
  .hub {
    width: min(100vw - 18px, 480px);
  }

  .game-card {
    grid-template-columns: 1fr;
  }

  .preview {
    min-height: 190px;
  }
}
