/* ───────── Gamlet — site styles ───────── */
:root {
  --coral: #ff5a4e;
  --coral-text: #c7362b;
  --yellow: #ffc83d;
  --yellow-dk: #d9a21a;
  --sky: #2ea8ff;
  --sky-text: #1569b3;
  --sky-lt: #eaf5ff;
  --dot: #cfe6ff;
  --mint: #3ddc97;
  --pink: #ff8fb1;
  --ink: #1b1b2f;
  --body: #4a4858;
  --muted: #5b6478;
  --line: #d6e6f7;
  --line-strong: #b9cbe3;
  --field: #f2f6fc;
  --white: #ffffff;
  --radius-lg: 32px;
  --radius: 24px;
  --radius-sm: 16px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.5;
  background-color: var(--sky-lt);
  background-image: radial-gradient(var(--dot) 2.5px, transparent 3px);
  background-size: 30px 30px;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--ink);
}
a:hover {
  color: var(--coral-text);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--white);
  padding: 8px 14px;
  border-radius: 12px;
  z-index: 10;
}
.skip:focus {
  left: 8px;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--line);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 32px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand svg {
  width: 42px;
  height: 42px;
}
.brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}
.brand .e {
  color: var(--coral);
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-weight: 700;
}
.main-nav a {
  text-decoration: none;
  padding: 6px 0;
}
.main-nav a[aria-current="page"] {
  color: var(--coral-text);
}
.search {
  margin-left: auto;
  flex: 1 1 220px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
}
.search input {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  min-width: 0;
}
.search:focus-within {
  border-color: var(--sky);
}

/* Main */
main.container {
  padding-top: 32px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2,
.section > h2 {
  font-weight: 600;
  font-size: 30px;
}
.section-head a {
  font-weight: 700;
  color: var(--coral-text);
}
.page-title {
  font-weight: 700;
  font-size: clamp(36px, 5vw, 52px);
}
.lead {
  font-size: 18px;
  color: var(--body);
  margin: 8px 0 0;
  max-width: 720px;
}

/* Ads */
.ad {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: 100%;
}
.ad-leaderboard {
  max-width: 728px;
  min-height: 90px;
}
.ad-infeed {
  min-height: 120px;
}
.ad-box {
  width: 300px;
  max-width: 100%;
  min-height: 250px;
}
.ad-placeholder {
  background: var(--white);
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding: 8px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  align-items: center;
  background: var(--coral);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  overflow: hidden;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.badge {
  align-self: flex-start;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.hero h1 {
  font-weight: 700;
  font-size: clamp(44px, 6vw, 64px);
  color: var(--white);
}
.hero p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  max-width: 460px;
}
.hero-art {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--sky);
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
}
.btn-primary {
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--yellow-dk);
}
.btn-primary:hover {
  color: var(--ink);
  filter: brightness(1.04);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--yellow-dk);
}
.btn-white {
  background: var(--white);
}
.btn-white:hover {
  color: var(--ink);
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--white);
  border: 2px solid var(--line);
  font-weight: 700;
  text-decoration: none;
}
.chip[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* Game grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 var(--line);
  color: var(--ink);
}
.card .thumb {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--sky);
}
.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px 6px;
}
.card .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}
.card .cat {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.card.soon {
  border-style: dashed;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
}
.card.soon .thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--field);
  color: var(--muted);
}
.card.soon .thumb span {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
}
.empty {
  display: none;
  font-weight: 700;
  color: var(--muted);
}

/* Feature panel */
.panel {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
}
.about-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.about-panel p {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--body);
}
.perks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.perks li {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
}
.perk-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.perk-icon svg {
  width: 22px;
  height: 22px;
}

/* Game page */
.crumbs {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crumbs [aria-current] {
  color: var(--ink);
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1000px;
  margin: 0 auto;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.game-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.player {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 28px;
  overflow: hidden;
  background: var(--sky);
}
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.player:fullscreen {
  border-radius: 0;
}
.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.game-bar h1 {
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  margin-right: auto;
}
.tag {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  color: var(--ink);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.game-intro {
  font-size: 18px;
  color: var(--body);
  margin: 0;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.info {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.info h2 {
  font-weight: 600;
  font-size: 26px;
}
.info ol,
.info ul {
  margin: 0;
  padding-left: 22px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-coral {
  color: var(--coral-text);
}
.h-sky {
  color: var(--sky-text);
}
.control {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--body);
}
.key {
  min-width: 88px;
  text-align: center;
  background: var(--field);
  border: 2px solid #c9d5e6;
  border-bottom-width: 4px;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 800;
  color: var(--ink);
  flex: none;
}
.share-msg {
  font-size: 14px;
  font-weight: 700;
  color: var(--sky-text);
}

/* Prose pages */
.prose {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 56px);
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.prose h1 {
  font-weight: 700;
  font-size: clamp(34px, 5vw, 48px);
  margin-bottom: 8px;
}
.prose h2 {
  font-weight: 600;
  font-size: 24px;
  margin: 32px 0 8px;
}
.prose p,
.prose li {
  font-size: 17px;
  color: var(--body);
  line-height: 1.7;
}
.prose .updated {
  color: var(--muted);
  font-weight: 700;
  margin-top: 0;
}
.prose a {
  color: var(--coral-text);
  font-weight: 700;
}

/* Footer */
.site-footer {
  background: var(--white);
  border-top: 2px solid var(--line);
}
.site-footer .container {
  padding-top: 32px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--coral-text);
}

/* Taller player on phones for puzzle and word games */
@media (max-width: 700px) {
  .player-tall {
    aspect-ratio: 4 / 5;
  }
}

/* Ad on game pages sits below How to play / Controls / Tips, far from the game window */
.game-page-ad {
  margin-top: 40px;
}

/* Ad placeholders are hidden while the site is waiting for AdSense approval.
   After approval, replace each placeholder div (class "ad-placeholder") with your real AdSense ad code.
   To preview the boxes again, delete this rule. */
.ad-placeholder {
  display: none !important;
}
