.home-shell { background: #faf7f1; }
.home-page {
  --ink: #241c32;
  --muted: #61566c;
  --line: #ded5e6;
  --accent: #5931ba;
  --surface: #fffdfa;
  --purple: var(--accent);
  background: radial-gradient(ellipse 680px 330px at 13% 0%, #efe6f7 0%, transparent 95%), #faf7f1;
  color: var(--ink);
}
.home-page .wrap { width: min(1180px, calc(100% - 72px)); }
.home-page :focus-visible { outline-color: var(--accent); }
.home-page .skip-link { color: var(--ink); }
.home-page .site-header { min-height: 72px; border-bottom: 1px solid var(--line); }
.home-page .brand { gap: 9px; font-size: 20px; }
.home-page .brand span { color: var(--accent); font-size: 27px; }
.home-page .nav-games { color: var(--accent); }
.home-page .header-contact {
  min-height: 40px;
  background: transparent;
  border: 1px solid #c9b7df;
  border-radius: 9px;
  color: var(--ink);
}
.home-page .header-contact:hover { border-color: var(--accent); color: var(--accent); }

.games-section { padding-block: clamp(24px, 2.7vw, 38px) clamp(38px, 5vw, 68px); }
.games-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 21px;
}
.games-heading .company-name {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: 650;
}
.games-heading h2 {
  font-size: clamp(38px, 6.2vw, 72px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.games-intro {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 13px;
}
.game-card {
  min-width: 0;
  border-radius: 16px;
  background: var(--surface);
}
.game-card .game-art {
  display: block;
  aspect-ratio: 3 / 2;
  background: #efe7f6;
}
.game-card .game-art img { object-fit: contain; }
.game-card .game-art:focus-visible { outline-offset: -4px; }
.game-card .game-info { min-width: 0; gap: 5px; }
.game-card .game-genre { color: var(--accent); font-size: 12px; }
.game-card h3 { line-height: 1.24; letter-spacing: -.022em; }
.game-card .game-description { line-height: 1.56; }
.home-page .game-actions { gap: 0 12px; margin-top: 2px; }
.home-page .game-actions .game-details,
.home-page .game-actions .game-play {
  justify-content: center;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.home-page .game-actions :is(.game-details, .game-play):hover { color: var(--accent); }

.game-feature { grid-row: span 2; }
.game-feature .game-art { background: #ffe8ad; }
.game-feature .game-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: end;
  column-gap: 16px;
  padding: 18px 21px;
}
.game-feature h3 { font-size: clamp(21px, 2.4vw, 32px); }
.game-feature .game-info > :not(.game-actions) { grid-column: 1; }
.game-feature .game-actions { grid-column: 2; grid-row: 2 / span 2; }
.home-page .game-feature .game-play {
  min-height: 44px;
  padding-inline: 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.home-page .game-feature .game-play:hover { background: #492696; color: #fff; text-decoration: none; }

.game-secondary {
  display: grid;
  grid-template-columns: minmax(0, 61%) minmax(0, 1fr);
}
.game-secondary .game-art { position: relative; height: 100%; aspect-ratio: auto; }
.game-secondary .game-art img { position: absolute; inset: 0; object-fit: cover; }
.game-secondary .game-info { align-self: center; padding: 13px; }
.game-secondary h3 { font-size: clamp(17px, 1.7vw, 23px); }
.game-secondary .game-description { font-size: 13px; }
.home-page .game-secondary .game-actions { column-gap: 9px; }
.home-page .game-secondary .game-play {
  padding-inline: 8px;
  border: 1px solid #ccbbe5;
  border-radius: 8px;
}
.home-page .game-secondary .game-play:hover { background: #f1eafa; text-decoration: none; }

.play-guide,
.home-closing {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  gap: clamp(20px, 6vw, 96px);
  border-top: 1px solid var(--line);
  padding-block: clamp(28px, 4.5vw, 62px);
}
.guide-heading h2, .home-closing h2 {
  font-size: clamp(27px, 3.9vw, 54px);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -.04em;
}
.guide-heading p, .guide-card p, .home-closing section > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.guide-heading p { max-width: 19em; }
.guide-heading .text-button { margin-top: 8px; color: var(--accent); }
.guide-lobby {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 12px 0 0;
}
.guide-lobby a { display: block; width: 134px; }
.guide-lobby img { width: 100%; height: auto; border-radius: 11px; border: 1px solid var(--line); }
.guide-lobby figcaption { color: var(--muted); font-size: 12px; }
.guide-grid { display: grid; grid-template-rows: repeat(3, 1fr); }
.guide-card {
  display: grid;
  grid-template-columns: minmax(0, clamp(96px, 13vw, 148px)) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.guide-card:first-child { padding-top: 0; }
.guide-image {
  display: block;
  aspect-ratio: 1.08;
  overflow: hidden;
  border-radius: 8px;
  background: #fbf7ec;
}
.guide-image img { width: 100%; height: 100%; object-fit: cover; }
.guide-image-math img { object-position: 50% 36%; }
.guide-image-flow img { object-position: 50% 50%; }
.guide-image-color img { object-position: 50% 60%; }
.guide-card h3 { font-size: clamp(17px, 1.8vw, 23px); }
.guide-card p { margin-top: 5px; }

.home-closing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-closing h2 { font-size: clamp(23px, 3vw, 38px); }
.home-closing h2 span { color: var(--accent); }
.home-closing section > p { max-width: 34em; }
.home-closing #contact { margin-top: 15px; }
.home-closing h3, .home-closing .copy-status { font-size: 14px; }
.home-closing .copy-status { min-height: 1.5em; color: var(--muted); }
.home-closing .copy-email { color: var(--accent); }
.home-page .site-footer .brand { font-size: 17px; }

.home-page .play-dialog { color: #211831; background: #fff; }
.home-page .play-dialog p { color: #62596c; }
.home-page .play-dialog .dialog-close { color: #211831; }
.home-page .play-dialog .save-game-code { color: #fff; background: #4e2ca2; }
.home-page .play-dialog :focus-visible { outline-color: #7347df; }

@media (max-width: 960px) {
  .home-page .wrap { width: calc(100% - 48px); }
  .game-feature .game-info { display: flex; align-items: start; }
  .game-secondary {
    grid-template-columns: minmax(0, 49%) minmax(0, 1fr);
    align-items: center;
    gap: 0 10px;
    padding: 9px;
  }
  .game-secondary .game-art { height: auto; aspect-ratio: 3 / 2; border-radius: 9px; }
  .game-secondary .game-art img { object-fit: contain; }
  .game-secondary .game-info { padding: 0 3px 0 0; }
  .home-page .game-secondary .game-actions { column-gap: 7px; }
  .home-page .game-secondary .game-actions .game-details,
  .home-page .game-secondary .game-actions .game-play { font-size: 12px; }
}

@media (max-width: 700px) {
  .home-page .wrap { width: calc(100% - 32px); }
  .home-page .site-header { min-height: 61px; }
  .home-page .brand { font-size: 18px; }
  .home-page .menu-toggle, .home-page .site-nav { background: var(--surface); }
  .home-page .menu-toggle { border-color: #c9b7df; color: var(--ink); }
  .games-section { padding-block: 14px 27px; }
  .games-heading { display: block; margin-bottom: 12px; }
  .games-heading .company-name { margin-bottom: 4px; }
  .games-heading h2 { font-size: 35px; }
  .games-intro { margin: 5px 0 0; font-size: 12px; }
  .game-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; gap: 8px; }
  .game-card { border-radius: 13px; }
  .game-feature { grid-row: auto; }
  .game-feature .game-art { aspect-ratio: auto; height: clamp(132px, 33vw, 195px); }
  .game-feature .game-art img { object-fit: cover; object-position: center 71%; }
  .game-card .game-info { gap: 2px; }
  .game-feature .game-info { padding: 8px 11px 3px; }
  .game-card .game-genre { display: none; }
  .game-card .game-description { font-size: 12px; line-height: 1.35; }
  .game-secondary { grid-template-columns: minmax(0, 39%) minmax(0, 1fr); gap: 0 9px; padding: 6px; }
  .game-secondary .game-art { border-radius: 7px; }
  .game-secondary h3 { font-size: clamp(15px, 4.25vw, 19px); }
  .home-page .game-secondary .game-actions { margin-top: 0; }
  .play-guide, .home-closing { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .guide-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 12px;
    align-items: start;
  }
  .guide-lobby { display: block; margin: 0; }
  .guide-lobby a { width: 100%; }
  .guide-lobby figcaption { margin-top: 4px; text-align: center; }
  .site-footer { gap: 10px 13px; }
}
