/* PlayOola — shared styles */
:root {
  --lilac: #F2EEFF;
  --lilac-2: #E6DFFF;
  --grape: #1E1446;
  --grape-soft: #4A3F78;
  --pink: #FF5FA2;
  --teal: #1FC8B0;
  --sun: #FFD23F;
  --tang: #FF7A1A;
  --white: #FFFFFF;
  --radius-tile: 20px;
  --radius-btn: 999px;
  --shadow-hard: 4px 4px 0 var(--grape);
  --shadow-hard-lg: 6px 6px 0 var(--grape);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lilac);
  color: var(--grape);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tang); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: center;
  font-weight: 800; font-size: 26px; letter-spacing: -0.03em;
  text-decoration: none; line-height: 1;
}
.logo .oo { display: inline-flex; gap: 0.06em; margin: 0 0.04em; }
.logo .oo i {
  display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%;
  background: var(--pink); border: 0.08em solid var(--grape);
  transform: translateY(0.06em);
}
.logo .oo i + i { background: var(--teal); }

/* ---------- Header ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { display: flex; gap: 20px; font-weight: 600; font-size: 16px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-btn);
  background: var(--sun); color: var(--grape);
  border: 2.5px solid var(--grape); box-shadow: var(--shadow-hard);
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--grape); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--grape); }
.btn.pink { background: var(--pink); color: var(--white); }
.btn.teal { background: var(--teal); }
.btn.ghost { background: var(--white); }
.btn.small { padding: 8px 16px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 36px; }
.hero h1 {
  margin: 0; font-weight: 800; letter-spacing: -0.045em; line-height: 0.92;
  font-size: clamp(64px, 13vw, 156px);
}
.hero h1 .oo { display: inline-flex; gap: 0.05em; margin: 0 0.03em; vertical-align: baseline; }
.hero h1 .oo i {
  display: inline-block; width: 0.66em; height: 0.66em; border-radius: 50%;
  background: var(--pink); border: 0.06em solid var(--grape);
  box-shadow: 0.04em 0.04em 0 var(--grape);
  animation: bounce 900ms cubic-bezier(.3,1.6,.5,1) both;
}
.hero h1 .oo i + i { background: var(--teal); animation-delay: 140ms; }
@keyframes bounce {
  0% { transform: translateY(-0.9em) scale(.9, 1.1); }
  55% { transform: translateY(0) scale(1.15, .85); }
  75% { transform: translateY(-0.12em) scale(.97, 1.03); }
  100% { transform: translateY(0) scale(1, 1); }
}
.hero p { font-size: clamp(19px, 2.4vw, 23px); max-width: 30ch; margin: 18px 0 24px; color: var(--grape-soft); font-weight: 500; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Toolbar: filters + search ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--lilac); padding: 12px 0;
  border-bottom: 2.5px solid transparent;
}
.toolbar.stuck { border-bottom-color: var(--grape); }
.toolbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px; border-radius: var(--radius-btn);
  border: 2.5px solid var(--grape); background: var(--white);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--grape); color: var(--white); }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 2.5px solid var(--grape); border-radius: var(--radius-btn);
  padding: 6px 14px; min-width: 220px; flex: 0 1 300px;
}
.search input { border: 0; outline: 0; font: inherit; font-size: 16px; width: 100%; background: transparent; color: var(--grape); }
.search:focus-within { box-shadow: var(--shadow-hard); }

/* ---------- Game grid ---------- */
.games { padding: 20px 0 64px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.tile {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border: 2.5px solid var(--grape); border-radius: var(--radius-tile);
  box-shadow: var(--shadow-hard); overflow: hidden; text-decoration: none;
  transition: transform .1s ease, box-shadow .1s ease;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.tile:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--grape); }
.tile .art { aspect-ratio: 4 / 3; border-bottom: 2.5px solid var(--grape); }
.tile .art img { width: 100%; height: 100%; object-fit: cover; }
.tile .info { padding: 12px 16px 16px; }
.tile h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.tile p { margin: 4px 0 0; font-size: 15px; color: var(--grape-soft); }
.tile .cat {
  position: absolute; top: 12px; left: 12px;
  background: var(--white); border: 2px solid var(--grape); border-radius: var(--radius-btn);
  padding: 2px 10px; font-size: 13px; font-weight: 700;
}
@media (min-width: 760px) {
  .tile.featured { grid-column: span 2; flex-direction: row; }
  .tile.featured .art { flex: 1.4; aspect-ratio: auto; min-height: 260px; border-bottom: 0; border-right: 2.5px solid var(--grape); }
  .tile.featured .info { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
  .tile.featured h3 { font-size: 34px; }
  .tile.featured p { font-size: 17px; margin-top: 8px; }
}
.empty { padding: 40px 0; font-size: 19px; }
.empty button { background: none; border: 0; text-decoration: underline; cursor: pointer; font-weight: 700; padding: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2.5px solid var(--grape); padding: 28px 0 40px; font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Game page ---------- */
.game-page main { padding: 4px 0 48px; }
.game-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.game-head h1 { margin: 0; font-size: clamp(34px, 6vw, 52px); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.scores { display: flex; gap: 10px; }
.score-box {
  background: var(--white); border: 2.5px solid var(--grape); border-radius: 14px;
  padding: 4px 14px; text-align: center; min-width: 78px;
}
.score-box span { display: block; font-size: 13px; font-weight: 600; color: var(--grape-soft); }
.score-box strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stage {
  position: relative; margin: 0 auto;
  background: var(--grape); border: 2.5px solid var(--grape); border-radius: var(--radius-tile);
  box-shadow: var(--shadow-hard-lg); overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.stage canvas { display: block; width: 100%; height: auto; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; text-align: center;
  background: rgba(30, 20, 70, 0.78); color: var(--white);
}
.overlay[hidden] { display: none; }
.overlay h2 { margin: 0; font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.overlay p { margin: 0; font-size: 17px; max-width: 28ch; opacity: .92; }
.how { max-width: 640px; margin: 24px auto 0; }
.how h2 { font-size: 22px; margin: 0 0 6px; font-weight: 800; }
.how p { margin: 0 0 8px; color: var(--grape-soft); }
.game-tools { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.more { margin-top: 48px; }
.more h2 { font-size: 26px; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.02em; }
.more .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }

/* d-pad for touch */
.dpad { display: none; margin: 18px auto 0; width: 180px; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 6px; justify-content: center; }
.dpad button {
  border: 2.5px solid var(--grape); border-radius: 14px; background: var(--white);
  box-shadow: 3px 3px 0 var(--grape); font-size: 22px; font-weight: 800; cursor: pointer;
  touch-action: manipulation;
}
.dpad button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--grape); }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 3; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* ---------- Text pages ---------- */
.prose { max-width: 68ch; padding: 12px 0 64px; }
.prose h1 { font-size: clamp(40px, 7vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 12px 0 24px; }
.prose h2 { font-size: 24px; font-weight: 800; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--grape-soft); }
.prose a { font-weight: 600; }

@media (max-width: 560px) {
  .nav { gap: 14px; font-size: 15px; }
  .search { flex: 1 1 100%; min-width: 0; }
  .grid { gap: 16px; }
}

/* ---------- Shared bits ---------- */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--grape); color: var(--white); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: inherit; }
.linklike:hover { text-decoration: underline; }
.muted { color: var(--grape-soft); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--grape-soft); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head { max-width: 70ch; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(38px, 7vw, 60px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 0 0 12px; }
.page-head p { color: var(--grape-soft); font-size: 18px; margin: 0 0 8px; }
.category main, .game-page main { padding-bottom: 48px; }
.more-cats { margin-top: 40px; }
.more-cats h2 { font-size: 22px; margin: 0 0 12px; }
a.chip { text-decoration: none; display: inline-block; }
a.chip[aria-current="page"] { background: var(--grape); color: var(--white); }
.tile.featured-off { grid-column: auto; flex-direction: column; }

/* Rows that scroll sideways on the homepage */
.row { margin: 8px 0 28px; }
.row h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 230px); gap: 16px; overflow-x: auto; padding: 2px 6px 10px 2px; scroll-snap-type: x proximity; }
.scroller .tile { scroll-snap-align: start; }
.scroller .tile h3 { font-size: 18px; }
.scroller .tile p { display: none; }

/* FAQ */
.faq { max-width: 760px; margin: 48px 0 0; }
.faq h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.faq details { background: var(--white); border: 2.5px solid var(--grape); border-radius: 14px; padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 800; color: var(--pink); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--grape-soft); }

/* Game page */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.game-side { position: sticky; top: 16px; }
@media (max-width: 1000px) { .game-layout { grid-template-columns: 1fr; } .game-side { display: none; } }
.player { width: 100%; max-height: 82vh; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player:fullscreen { max-width: none !important; max-height: none; border-radius: 0; border: 0; aspect-ratio: auto !important; }
.cover { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: var(--grape) center / cover no-repeat; color: var(--white); }
.cover::before { content: ""; position: absolute; inset: 0; background: rgba(30, 20, 70, .45); transition: background .15s; }
.cover:hover::before { background: rgba(30, 20, 70, .3); }
.cover-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.play-btn { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); border: 3px solid var(--grape); box-shadow: 4px 4px 0 var(--grape); padding-left: 4px; transition: transform .1s; }
.cover:hover .play-btn { transform: scale(1.06); }
.cover-label { font-size: clamp(20px, 3vw, 28px); font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 2px 10px rgba(0,0,0,.4); padding: 0 16px; }
.game-head .plays { margin: 0; font-weight: 600; color: var(--grape-soft); }
.game-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 2.5px solid var(--grape); border-radius: 999px; background: var(--white); font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 2px 2px 0 var(--grape); }
.pill[aria-pressed="true"] { background: var(--sun); }
#fav[aria-pressed="true"] { background: var(--pink); color: var(--white); }
.pill:active { transform: translate(2px, 2px); box-shadow: none; }
.draft-note { background: var(--sun); border: 2.5px solid var(--grape); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.about, .howto, .board { margin-top: 32px; max-width: 760px; }
.about h2, .howto h2, .board h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.about p, .howto p { color: var(--grape-soft); margin: 0 0 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 16px 0 0; }
.facts dt { font-size: 13px; font-weight: 700; color: var(--grape-soft); }
.facts dd { margin: 0; font-weight: 700; }
.board ol { list-style: none; counter-reset: r; padding: 0; margin: 0; background: var(--white); border: 2.5px solid var(--grape); border-radius: 14px; overflow: hidden; }
.board li { counter-increment: r; display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 2px solid var(--lilac-2); font-weight: 600; }
.board li:first-child { border-top: 0; }
.board li:not(.muted)::before { content: counter(r); width: 26px; font-weight: 800; color: var(--pink); }
.board li span { flex: 1; }
.score-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--sun); border: 2.5px solid var(--grape); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.score-form p { margin: 0; flex: 1 1 100%; font-weight: 600; }
.score-form input { font: inherit; padding: 8px 12px; border: 2px solid var(--grape); border-radius: 10px; }
.score-form .err { color: #B00045; }

/* Ad spaces: hidden until AdSense is set up (or shown dashed in preview) */
.ad-slot { margin: 28px auto; text-align: center; min-height: 100px; position: relative; }
.ad-slot > span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--grape-soft); margin-bottom: 4px; }
.ad-wide { max-width: 970px; }
.ad-tall { min-height: 600px; width: 300px; margin: 0; }
.ad-preview { border: 2.5px dashed var(--grape-soft); border-radius: 14px; background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(74,63,120,.06) 12px 24px); display: grid; place-items: center; min-height: 120px; }
.ad-preview.ad-tall { min-height: 600px; }
.ad-preview > span::after { content: " space (preview)"; }

/* Cookie banner & share dialog */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto; background: var(--white); border: 2.5px solid var(--grape); border-radius: 18px; box-shadow: var(--shadow-hard-lg); padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.consent p { margin: 0; flex: 1 1 320px; font-size: 15px; }
.consent div { display: flex; gap: 8px; flex-wrap: wrap; }
.share-dialog { border: 2.5px solid var(--grape); border-radius: 20px; box-shadow: var(--shadow-hard-lg); padding: 22px; width: min(440px, calc(100vw - 32px)); color: var(--grape); }
.share-dialog::backdrop { background: rgba(30, 20, 70, .5); }
.share-dialog h2 { margin: 0 0 14px; font-weight: 800; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* Phones: two game tiles per row, smaller play cover */
@media (max-width: 560px) {
  .games .grid, .more .grid, .category .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid .tile .info { padding: 8px 10px 10px; }
  .grid .tile h3 { font-size: 16px; }
  .grid .tile p { display: none; }
  .grid .tile .cat { top: 6px; left: 6px; font-size: 11px; padding: 1px 7px; }
  .play-btn { width: 60px; height: 60px; }
  .play-btn svg { width: 26px; height: 26px; }
  .cover-label { font-size: 18px; }
  .ad-slot { min-height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
