/* Games extend the site's dark palette and shared raised/inset surfaces. */
.games-main { width: 100%; max-width: 1120px; text-align: left; margin: 0 auto; }
.games-main h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.12; letter-spacing: -.04em; margin: 16px 0; text-wrap: balance; }
.games-main h1 span, .games-main a { color: var(--color-focus); }
.games-main h2 { font-size: 1.3rem; line-height: 1.3; }
.games-main p { max-width: 65ch; }
.games-hero { padding: 8px 0 36px; }
.games-hero > p { color: var(--color-text-muted); margin: 12px 0; }
.games-eyebrow { font: .75rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--color-focus); }
.games-actions, .games-filters, .games-mode { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.games-main button, .games-main select, .games-button, .games-mode a { font: inherit; min-height: 44px; border: 1px solid #42606e; border-radius: 12px; background: var(--neu-surface); color: var(--color-text-light); padding: 10px 16px; box-shadow: var(--neu-small); }
.games-main button, .games-main select { cursor: pointer; }
.games-button, .games-mode a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.games-main .games-primary, .games-mode a[aria-current="page"] { background: var(--color-focus); color: #06171e; font-weight: 700; border-color: transparent; }
.games-main :is(button, select, input, summary):focus-visible { outline: 3px solid var(--color-focus); outline-offset: 4px; }
.games-main button:disabled { opacity: .5; cursor: default; }
.games-filters { padding: 20px; border: 1px solid #29434f; border-radius: 20px; box-shadow: var(--neu-inset); }
.games-filters label { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.games-filters select { max-width: 100%; }
.games-section { margin: 32px 0 48px; }
.games-section > p { margin: 10px 0 20px; color: var(--color-text-muted); }
.games-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 20px; }
.games-grid--ready { grid-template-columns: 1fr; }
.game-card, .games-panel { min-width: 0; padding: 28px; border: 1px solid #29434f; border-radius: 22px; background: var(--neu-surface); box-shadow: var(--neu-raised); }
.games-grid--ready .game-card { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.game-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--neu-inset); color: var(--color-focus); font: 700 1.4rem var(--font-mono); margin-bottom: 16px; }
.games-grid--ready .game-icon { margin: 0; }
.game-card p { color: var(--color-text-muted); font-size: .9rem; margin: 10px 0; }
.game-badge { font: .72rem var(--font-mono); color: #d4b2ff; }
.games-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 20px; }
.games-summary div { flex: 1 1 100px; }
.games-summary dt { color: var(--color-text-muted); font-size: .8rem; }
.games-summary dd { font: 700 1.8rem var(--font-mono); margin-top: 6px; }
.games-stats-group + .games-stats-group { margin-top: 24px; }
.games-stats-group h3 { font-size: 1rem; }
.games-notice { margin: 16px 0; color: var(--color-text-muted); font-size: .85rem; }
.games-rules { margin: 24px 0; line-height: 1.8; }
.games-rules summary { cursor: pointer; color: var(--color-focus); min-height: 44px; padding: 8px 0; }
.games-rules ul { padding-left: 24px; }
.wordle-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 32px; align-items: start; }
.wordle-play { min-width: 0; padding: 24px 12px; }
.wordle-board { display: grid; gap: 8px; max-width: 320px; margin: 24px auto; }
.wordle-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wordle-tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 2px solid #42606e; border-radius: 12px; background: #101e28; font: 750 clamp(1.2rem, 4vw, 1.6rem) var(--font-mono); }
.wordle-tile small { position: absolute; bottom: 3px; right: 4px; font-size: .55rem; line-height: 1; }
.wordle-tile[data-state="correct"], .wordle-key[data-state="correct"], .wordle-legend [data-state="correct"] { background: #126356; border-color: #74ead0; color: #fff; }
.wordle-tile[data-state="present"], .wordle-key[data-state="present"], .wordle-legend [data-state="present"] { background: #735409; border-color: #ffe28b; color: #fff; }
.wordle-tile[data-state="absent"], .wordle-key[data-state="absent"], .wordle-legend [data-state="absent"] { background: #2d3948; border-color: #8b9caf; color: #fff; }
.wordle-row--reveal .wordle-tile { animation: wordle-reveal .25s ease-out both; }
@keyframes wordle-reveal { from { transform: translateY(5px); opacity: .4; } to { transform: none; opacity: 1; } }
.wordle-keyboard { display: grid; gap: 8px; max-width: 520px; margin: 20px auto; }
.wordle-key-row { display: flex; justify-content: center; gap: 4px; }
.games-main .wordle-key { min-width: 0; flex: 1; max-width: 48px; padding: 6px 0; border-radius: 8px; font-size: .85rem; min-height: 48px; box-shadow: none; }
.games-main .wordle-key--wide { flex: 1.7; max-width: 80px; font-size: .7rem; }
.wordle-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .75rem; color: var(--color-text-muted); }
.wordle-legend span { display: inline-flex; align-items: center; gap: 8px; }
.wordle-legend b { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid; border-radius: 6px; }
.wordle-status { min-height: 3.5em; text-align: center; margin: 12px 0; font-weight: 600; overflow-wrap: anywhere; }
.wordle-entry { margin: 16px auto; max-width: 320px; }
.wordle-entry label { display: block; font-size: .8rem; color: var(--color-text-muted); }
.wordle-entry input { width: 100%; min-height: 44px; margin: 8px 0; padding: 10px; border: 1px solid #42606e; border-radius: 10px; background: #101e28; color: #fff; font: inherit; text-transform: uppercase; letter-spacing: .2em; }
.wordle-entry button { width: 100%; }
.wordle-result { margin: 16px 0; }
.wordle-share-text { width: 100%; min-height: 180px; padding: 12px; background: #101e28; color: #fff; font: .8rem var(--font-mono); border: 1px solid #42606e; border-radius: 12px; }
.wordle-history { font-size: .85rem; margin: 16px 0; }
.wordle-history li { margin: 6px 0 6px 20px; }
.games-empty { padding: 24px 0; color: var(--color-text-muted); }
.games-main [hidden] { display: none !important; }
.games-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) { .games-grid { grid-template-columns: 1fr; } .wordle-layout { grid-template-columns: 1fr; } }
@media (max-width: 540px) {
  .games-grid--ready .game-card { grid-template-columns: auto 1fr; gap: 16px; }
  .games-grid--ready .game-card > a { grid-column: 1 / -1; }
  .game-card, .games-panel { padding: 20px; }
  .games-filters { align-items: stretch; }
  .games-filters label { flex: 1 1 140px; }
  .wordle-play { padding: 16px 0; box-shadow: none; border: none; background: transparent; }
  .games-main .wordle-key { font-size: .75rem; }
  .games-main .wordle-key--wide { font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .wordle-row--reveal .wordle-tile { animation: none; } }
@media (forced-colors: active) { .wordle-tile[data-state="correct"] { border-style: double; } .wordle-tile[data-state="present"] { border-style: dashed; } }

/* Three additional games share the site shell and keyboard-friendly controls. */
.puzzle-play { min-width: 0; }
.connections-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.games-main .connections-word { min-height: 76px; padding: 10px 6px; font-size: .75rem; font-weight: 650; overflow-wrap: anywhere; line-height: 1.4; box-shadow: none; }
.games-main .connections-word[aria-pressed="true"] { background: var(--color-focus); color: #06171e; border: 3px solid #fff; }
.connections-solved { display: grid; gap: 12px; margin-bottom: 20px; }
.connections-group { border: 1px solid #83d0bd; border-radius: 14px; padding: 16px; background: #123f39; }
.connections-group h3 { font-size: .85rem; }
.connections-group p { font-size: .75rem; margin-top: 4px; }
.flag-image { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 4 / 3; object-fit: contain; margin: 0 auto 16px; border: 1px solid #8b9caf; background: #fff; }
.flag-description, .flag-hints { color: var(--color-text-muted); font-size: .85rem; margin: 16px 0; }
.flag-hints { padding-left: 24px; }
.flag-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flag-options button { overflow-wrap: anywhere; }
.flag-options button[data-result="correct"] { background: #126356; border: 2px solid #74ead0; opacity: 1; }
.flag-options button[data-result="wrong"] { text-decoration: line-through; opacity: .8; }
.sudoku-board { display: grid; width: 100%; max-width: 480px; border: 2px solid #94c6d6; margin: 0 auto; }
.sudoku-row { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.games-main .sudoku-cell { min-height: 0; min-width: 0; padding: 0; aspect-ratio: 1; border: 1px solid #4d6d7d; border-radius: 0; box-shadow: none; font-size: clamp(.9rem, 3.5vw, 1.35rem); font-weight: 550; color: #86e6f1; background: #0d1922; line-height: 1; }
.games-main .sudoku-cell--fixed { background: #253f4e; color: #fff; font-weight: 750; }
.sudoku-cell:nth-child(3n):not(:last-child) { border-right: 2px solid #94c6d6; }
.sudoku-row:nth-child(3n):not(:last-child) .sudoku-cell { border-bottom: 2px solid #94c6d6; }
.games-main .sudoku-cell[aria-selected="true"] { background: #295866; outline: 2px solid var(--color-focus); outline-offset: -3px; }
.games-main .sudoku-cell:focus-visible { outline: 3px solid #fff; outline-offset: -3px; position: relative; z-index: 1; }
.sudoku-notes { display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(.45rem, 1.5vw, .65rem); width: 100%; height: 100%; align-items: center; color: #c4d8df; }
.sudoku-keypad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.games-main .sudoku-keypad button { padding: 8px 0; }
.games-main [aria-pressed="true"]#notes-toggle { color: #06171e; background: var(--color-focus); }
#game-clock { font: 700 1.1rem var(--font-mono); color: var(--color-text-light); }
@media (max-width: 540px) {
  .connections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .puzzle-play { padding: 16px 8px; }
  .flag-options { grid-template-columns: 1fr; }
  .games-main .sudoku-keypad button { font-size: .8rem; }
}
/* Acceso rápido a los juegos recomendados: catálogo y franja bajo cada juego. */
.games-featured { margin: 0 0 28px; }
.games-featured h2 { margin: 0 0 14px; font-size: 1rem; color: var(--color-text-accent); letter-spacing: .02em; }
.games-featured--more { margin: 32px 0 8px; }
.games-featured-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.games-featured-link { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid #29434f; border-radius: 16px; background: var(--neu-surface); box-shadow: var(--neu-small); color: var(--color-text-light); text-decoration: none; transition: transform 320ms var(--ease-out, ease), border-color 240ms var(--ease-out, ease), box-shadow 320ms var(--ease-out, ease); }
.games-featured-link .game-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; margin: 0; border-radius: 12px; background: #102a35; color: var(--color-focus); font: 750 .85rem var(--font-mono); }
.games-featured-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.games-featured-copy strong { font-size: .95rem; line-height: 1.3; }
.games-featured-copy span { color: var(--color-text-muted); font-size: .8rem; }
.games-featured-arrow { color: var(--color-focus); font-size: 1.1rem; transition: transform 320ms var(--ease-out, ease); }
.games-featured-link:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .games-featured-link:hover { transform: translateY(-3px); border-color: var(--color-focus); box-shadow: var(--neu-small), 0 10px 24px #02050880, 0 0 0 1px #65dbea33; }
  .games-featured-link:hover .games-featured-arrow { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) { .games-featured-link, .games-featured-arrow { transition: none; } }
