:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #252823;
  background: #fafaf8;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
input, select, button { font: inherit; }
.directory { width: min(100% - 64px, 1000px); margin: 0 auto; padding: 64px 0 72px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.language-control { display: flex; align-items: center; gap: 5px; color: #71786a; flex: 0 0 auto; }
.language-control svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.language-control select { width: 104px; min-height: 40px; padding: 6px 2px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 13px; cursor: pointer; }
h1 { margin: 0; font-size: 30px; font-weight: 650; line-height: 1.2; letter-spacing: -1.2px; }
h1 span { color: #829173; }
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid #e1e3dc; border-radius: 9px; background: #fff; }
.search svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: #858a80; stroke-width: 1.7; fill: none; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; color: inherit; background: transparent; font-size: 14px; }
.search input::placeholder { color: #8b9085; opacity: 1; }
.search:focus-within { border-color: #829173; box-shadow: 0 0 0 3px #82917318; }
.random-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; min-height: 44px; padding: 0 13px; border: 1px solid #dce2d5; border-radius: 9px; background: #edf2e7; color: #4f6343; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.random-button svg { width: 18px; height: 18px; fill: currentColor; }
.random-button svg rect { fill: none; stroke: currentColor; stroke-width: 1.5; }
.random-button:disabled { opacity: .4; cursor: default; }
.random-button:focus-visible, .random-close:focus-visible { outline: 2px solid #758866; outline-offset: 3px; }
.random-dialog { width: min(380px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 16px; border: 1px solid #e0e4d9; border-radius: 16px; background: #fafaf8; color: inherit; box-shadow: 0 18px 70px #18231026; }
.random-dialog::backdrop { background: #20271c55; }
.random-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.random-heading h2 { font-size: 14px; font-weight: 500; color: #67735c; }
.random-close { width: 36px; height: 36px; border: 0; border-radius: 7px; background: transparent; color: #7d8576; font-size: 24px; cursor: pointer; }
.random-dialog .game-image { aspect-ratio: 1.5; }
.random-again { width: 100%; margin-top: 12px; }
.sort { position: relative; flex: 0 0 auto; }
.sort select { height: 44px; min-width: 118px; padding: 0 32px 0 12px; border: 0; border-radius: 7px; background: transparent; color: #565d50; font-size: 13px; appearance: none; cursor: pointer; }
.sort svg { position: absolute; right: 8px; top: 14px; width: 16px; height: 16px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 1.4; }
.genre-control { flex: 0 0 auto; }
.genre-control select { max-width: 165px; min-height: 44px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: #565d50; font-size: 13px; cursor: pointer; }
.genre-control select:focus-visible { outline: 2px solid #758866; outline-offset: 3px; }
.genre-tags { display: none; }
.genre-tag { padding: 2px 6px; border-radius: 4px; background: #f3f4ef; color: #737c69; font-size: 10px; font-weight: 400; white-space: nowrap; }
.is-visited .genre-tags { background: #edf3e8; }
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.games li { min-width: 0; }
.favorites-section { margin-bottom: 30px; }
.section-title { margin: 0 0 13px; color: #71786a; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.game-card { position: relative; overflow: hidden; border: 1px solid #e3e5de; border-radius: 13px; background: #fff; transition: border-color 150ms, box-shadow 150ms; }
.game-card.is-visited { border-color: #9bb38d; }
.game-card .game { border: 0; border-radius: 0; }
.game-card .game:hover, .game-card .game:active { transform: none; box-shadow: none; }
.game-card .game:focus-visible { outline-offset: -3px; }
.countdown { position: absolute; z-index: 1; left: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 2px; max-width: calc(100% - 16px); padding: 5px 7px; border: 1px solid #e5e8df; border-radius: 6px; background: #fffffff0; color: #606858; pointer-events: none; }
.reset-label { color: #737c69; font-size: 9px; }
.countdown time { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown.is-soon time { color: #49663a; }
.favorite-toggle { position: absolute; z-index: 2; top: 4px; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; padding: 11px; border: 0; border-radius: 8px; background: transparent; color: #8a9081; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.favorite-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.favorite-toggle[aria-pressed="true"] { color: #91783c; }
.favorite-toggle[aria-pressed="true"] svg { fill: #e6d5a7; }
.favorite-toggle:focus-visible { outline: 2px solid #758866; outline-offset: -2px; }
.game { display: block; overflow: hidden; border: 1px solid #e3e5de; border-radius: 13px; background: #fff; color: inherit; text-decoration: none; transition: border-color 150ms, box-shadow 150ms, transform 150ms; -webkit-tap-highlight-color: transparent; }
.game-title { display: flex; align-items: center; gap: 9px; min-height: 53px; padding: 0 17px; }
.game-card .game-title { padding-right: 52px; }
.game-card .open-arrow { display: none; }
h2 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.3px; text-overflow: ellipsis; white-space: nowrap; }
.open-arrow { margin-left: auto; color: #9b9f96; font-size: 18px; font-weight: 400; }
.game.is-visited { border-color: #9bb38d; }
.is-visited .game-title { background: #edf3e8; }
.visit-badge { position: absolute; z-index: 1; top: 9px; right: 9px; padding: 4px 7px; border: 1px solid #d8e3cf; border-radius: 5px; background: #f3f8ef; color: #425e32; font-size: 10px; white-space: nowrap; }
.game-image { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.5; overflow: hidden; border-top: 1px solid #eff0eb; background: #f3f3ef; }
.game-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-wordle { background: #fff; }
.image-connections { background: #fff; padding: 14px; }
.image-queens { background: #f3f2ef; padding: 14px; }
.image-haru { background: #191f1b; padding: 12px; }
.image-worldle { background: #fff; }
.image-globle { background: #f9f6f0; }
.image-strands, .image-quordle, .image-nerdle { background: #fff; }
.image-tango, .image-zip, .image-pinpoint { background: #f3f2ef; padding: 12px; }
.image-waffle { background: #fff; padding: 12px; }
.image-travle { background: #1c1c1c; }
.image-framed { background: #101829; }
.image-contexto { background: #fffcf4; padding: 12px; }
.image-bandle { background: #080f21; }
.image-clues-by-sam { background: #191c23; }
.image-foodguessr img, .image-timeguessr img { object-fit: cover; }
.image-ssaangn { background: #fff; }
.game:focus-visible, .sort select:focus-visible, .language-control select:focus-visible { outline: 2px solid #758866; outline-offset: 4px; }
.game:active { transform: scale(.985); }
.empty { padding: 64px 0; color: #7b8274; text-align: center; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (hover: hover) {
  .game-card:hover { border-color: #afbba3; box-shadow: 0 4px 16px #26331b09; }
  .favorite-toggle:hover { background: #f4f4ed; }
  .game:hover { border-color: #afbba3; box-shadow: 0 4px 16px #26331b09; transform: translateY(-2px); }
  .game:hover .open-arrow { color: #657857; }
}
@media (max-width: 760px) {
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .search { grid-column: 1; }
  .genre-control { justify-self: end; }
  .directory { width: calc(100% - 40px); padding-top: 40px; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .game-image { aspect-ratio: 1.2; }
}
@media (max-width: 440px) {
  .directory { width: calc(100% - 32px); padding-top: 32px; }
  .header { margin-bottom: 24px; }
  h1 { font-size: 27px; }
  .language-control { gap: 3px; }
  .language-control select { width: 88px; font-size: 12px; }
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; margin-bottom: 20px; }
  .search { grid-column: 1; }
  .random-button { font-size: 12px; padding: 0 9px; gap: 5px; }
  .genre-control { justify-self: end; min-width: 0; }
  .genre-control select { max-width: 140px; font-size: 12px; }
  .genre-tags { padding: 0 11px 9px; gap: 3px; }
  .genre-tag { font-size: 9px; padding: 2px 4px; }
  .sort select { min-width: 101px; font-size: 12px; padding-left: 6px; }
  .search { padding: 0 11px; gap: 8px; }
  .search input { font-size: 16px; }
  .games { gap: 13px; }
  .game { border-radius: 10px; }
  .game-card { border-radius: 10px; }
  .countdown { left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 4px 5px; }
  .countdown time { font-size: 10px; }
  .reset-label { font-size: 8px; }
  .favorite-toggle { top: 1px; right: 0; }
  .game-card .game-title { padding-right: 42px; }
  .game-title { min-height: 46px; gap: 5px; padding: 0 11px; }
  h2 { font-size: 13px; }
  .open-arrow { font-size: 15px; }
  .visit-badge { top: 6px; right: 6px; font-size: 9px; padding: 3px 5px; }
  .image-queens, .image-connections, .image-haru { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .game, .game-card { transition: none; } }


/* One optional ad, separate from game interactions. Height stays flexible for native ads. */
.ad-slot { min-width: 0; width: 100%; align-self: start; padding-top: 4px; }
.ad-label { margin: 0 0 9px; color: #7b8274; font-size: 10px; font-weight: 400; letter-spacing: .08em; }
.ad-slot .adsbygoogle, .ad-preview { width: 100%; min-height: 250px; }
.ad-preview { display: grid !important; place-items: center; padding: 24px; border: 1px dashed #cdd5c4; border-radius: 12px; background: #f0f3eb; color: #7e8975; text-align: center; font-size: 13px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 42px; padding-top: 22px; border-top: 1px solid #e1e5da; font-size: 12px; }
.site-footer a { color: #71786a; text-decoration: none; padding: 8px 0; }
.site-footer a:hover { text-decoration: underline; }
@media(max-width:900px) { .directory-ad { grid-column: 1 / -1; margin: 8px 0; } }
