/*
Theme Name: Solitaire Hub
Theme URI: https://example.com/solitaire-hub
Author: Your Studio
Author URI: https://example.com
Description: A fast, mobile-first, SEO-optimised WordPress theme built for solitaire / patience card-game sites. Comes with a "Game" custom post type, an automatic games overview page, a responsive full-width game frame that accepts a shortcode, iframe URL, or raw HTML embed, and an SEO text field that renders above the footer on every page. Design inspired by classic card-table sites like harpan.se.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: solitaire-hub
Tags: games, card-games, custom-post-type, responsive, seo, one-column

Design tokens
-------------
Colour   : felt green #0f3d2e (primary), deep felt #0a2b20 (surfaces/nav),
           gold #c9a227 (accent / CTA), cream #f6f1e4 (background),
           ink #20241f (text), card red #b5432a (ratings/highlights)
Type     : system serif for display headings, system sans (system-ui) for
           body copy and UI -- chosen deliberately over a webfont so the
           theme ships zero render-blocking font requests (this is a
           "high speed" brief; the type scale and weight carry the
           character instead of a custom face).
Signature: the game frame is dressed as a felt card table -- rounded gold
           corner "suit tag" marks on the embed frame -- carried through
           as the one recurring motif (card corners on images, buttons).
*/

/* -------------------------------------------------------------------- */
/* 1. Reset & base                                                       */
/* -------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

:root{
  --felt: #0f3d2e;
  --felt-dark: #0a2b20;
  --gold: #c9a227;
  --gold-light: #e4c860;
  --cream: #f6f1e4;
  --ink: #20241f;
  --ink-soft: #4b5248;
  --red: #b5432a;
  --white: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 16px rgba(15, 61, 46, 0.14);
  --shadow-lg: 0 12px 32px rgba(10, 43, 32, 0.22);
  --max-width: 1180px;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark mode: toggled via assets/js/main.js, persisted in localStorage,
   applied pre-paint by an inline script in header.php to avoid a flash.
   Re-uses the same CSS variables everywhere else in the file, so every
   component (cards, tables, forms) adapts automatically. */
html[data-theme="dark"]{
  --cream: #15201a;
  --white: #1d2a22;
  --ink: #ece7d6;
  --ink-soft: #b9c0b2;
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}
html[data-theme="dark"] .game-card__thumb{ background: var(--felt-dark); }
html[data-theme="dark"] .highscore-table tr.is-first td{ background: #23301f; }
html[data-theme="dark"] .highscore-form input{ background: var(--white); color: var(--ink); border-color: #3a4438; }
html[data-theme="dark"] .toolbar-icon-btn{ color: var(--gold-light); }

html { scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img{ max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--felt-dark);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container{
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.screen-reader-text{
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}
.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 10000;
  border-radius: 0 0 6px 0;
  font-weight: 700;
}
.skip-link:focus{ left: 0; }

:focus-visible{
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------- */
/* 2. Header / nav                                                       */
/* -------------------------------------------------------------------- */
.site-header{
  background: var(--felt-dark);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow);
}
.site-header .container{
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}
.site-branding{ display: flex; align-items: center; gap: .6em; margin-right: auto; }
.site-branding img{ max-height: 42px; width: auto; }
.site-title{
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  margin: 0;
}
.site-title a{ color: var(--white); }
.site-description{ display:none; }

.site-header__actions{ display: flex; align-items: center; gap: 6px; }

.menu-toggle{
  display: none;
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.primary-navigation ul{
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.primary-navigation a{
  display: block;
  padding: 12px 14px;
  color: var(--white);
  font-weight: 600;
  font-size: .93rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.primary-navigation a:hover,
.primary-navigation a:focus,
.primary-navigation .current-menu-item > a{
  background: var(--gold);
  color: var(--ink);
}

@media (max-width: 780px){
  .menu-toggle{ display: inline-flex; align-items:center; gap:.4em; }
  .primary-navigation{
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--felt-dark);
    box-shadow: var(--shadow-lg);
  }
  .primary-navigation.is-open{ display: block; }
  .primary-navigation ul{ flex-direction: column; padding: 8px; }
  .primary-navigation a{ padding: 14px 16px; }
}

/* -------------------------------------------------------------------- */
/* 2b. Country / flag switcher -- inline in the footer's bottom bar,     */
/*     centered between the copyright line and the tagline.              */
/* -------------------------------------------------------------------- */
.country-switcher{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.country-switcher__flag{
  display: inline-flex;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.country-switcher__flag:hover,
.country-switcher__flag:focus-visible{
  transform: translateY(-2px) scale(1.15);
  box-shadow: 0 0 0 2px var(--gold);
}
.country-switcher__flag img{ display: block; width: 24px; height: 16px; background: transparent; }

/* -------------------------------------------------------------------- */
/* 3. Hero (front page)                                                   */
/* -------------------------------------------------------------------- */
.hero{
  background: linear-gradient(160deg, var(--felt) 0%, var(--felt-dark) 100%);
  color: var(--cream);
  padding: 52px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::after{
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 85% 20%, rgba(201,162,39,.18), transparent 55%);
  pointer-events: none;
}
.hero .container{ position: relative; }
.hero h1{ color: var(--white); max-width: 20ch; }
.hero p.lead{ max-width: 60ch; font-size: 1.1rem; color: #e5e2d3; }
.hero .btn{ margin-top: 12px; }

.btn{
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  letter-spacing: .02em;
  box-shadow: var(--shadow);
  transition: transform .12s ease, background .15s ease;
}
.btn:hover, .btn:focus{ background: var(--gold-light); transform: translateY(-1px); }
.btn.btn-outline{
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold-light);
}

/* -------------------------------------------------------------------- */
/* 4. Games grid + card (used on front page + archive)                   */
/* -------------------------------------------------------------------- */
.section{ padding: 48px 0; }
.section-title-row{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.section-title-row .see-all{ font-weight: 700; color: var(--felt); white-space: nowrap; }
.section-title-row .see-all::after{ content: " →"; }

.games-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.game-card{
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover, .game-card:focus-within{
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.game-card__thumb{
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--felt);
  overflow: hidden;
}
.game-card__thumb img{ width: 100%; height: 100%; object-fit: cover; }
.game-card__thumb::before,
.game-card__thumb::after{
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--gold);
  opacity: .9;
}
.game-card__thumb::before{ top: 8px; left: 8px; border-right: none; border-bottom: none; }
.game-card__thumb::after{ bottom: 8px; right: 8px; border-left: none; border-top: none; }

.game-card__body{ padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-card__title{ font-size: 1.05rem; margin: 0; }
.game-card__title a::after{ content: ""; position: absolute; inset: 0; }
.game-card__title a{ position: relative; }
.game-card__excerpt{ font-size: .9rem; color: var(--ink-soft); margin: 0; flex: 1; }
.game-card__meta{
  display: flex; align-items: center; justify-content: space-between;
  font-size: .8rem; color: var(--ink-soft); margin-top: 6px;
}
.rating{ display: inline-flex; gap: 2px; color: var(--red); letter-spacing: 1px; }
.rating[data-empty]{ color: #d8d2c0; }

/* -------------------------------------------------------------------- */
/* 5. Single game page + responsive game frame                           */
/* -------------------------------------------------------------------- */
.game-hero{
  background: var(--felt-dark);
  padding: 22px 0 0;
}
.game-hero .container{ padding-bottom: 18px; }
.game-hero h1{ color: var(--white); margin-bottom: 4px; }
.game-hero .game-subtitle{ color: var(--gold-light); font-size: .95rem; margin: 0; }

.game-frame-wrap{
  width: 100%;
  background: var(--felt);
  border-top: 4px solid var(--gold);
  border-bottom: 4px solid var(--gold);
}
.game-frame{
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  /* Height is set responsively by JS: to the viewport for iframe embeds,
     or to the embedded content's real height for HTML/shortcode embeds
     (assets/js/main.js). This aspect-ratio is only the no-JS / first-paint
     fallback so there is no layout shift while main.js runs. */
  aspect-ratio: 4 / 3;
  min-height: 260px;
  overflow: hidden; /* no scrollbars: JS sizes the frame to fit its content exactly */
}
@media (min-width: 900px){
  .game-frame{ aspect-ratio: 16 / 10; }
}
/* Once JS has taken over sizing, drop the CSS aspect-ratio guess so the
   frame can grow/shrink freely to match the real embedded content. */
.game-frame.js-sized{ aspect-ratio: auto; }
.game-frame::before,
.game-frame::after{
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 3px solid var(--gold);
  z-index: 2;
  pointer-events: none;
}
.game-frame::before{ top: 6px; left: 6px; border-right: none; border-bottom: none; }
.game-frame::after{ bottom: 6px; right: 6px; border-left: none; border-top: none; }

.game-frame__inner,
.game-frame iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--felt-dark);
}
.game-frame__inner{ overflow: visible; height: auto; }
.game-frame--iframe .game-frame__inner,
.game-frame--iframe iframe{ height: 100%; }

.game-frame__loading{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
  font-weight: 700;
  font-family: var(--font-display);
}

.game-actions{
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 0;
}
.game-actions .rate-widget{ display: flex; align-items: center; gap: 8px; }
.rate-widget__stars{
  display: inline-flex;
  flex-direction: row-reverse; /* DOM order is 5..1 so hover ~ (later siblings) fills lower values to the left */
  gap: 2px;
}
.rate-widget button{
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: #d8d2c0; padding: 0; line-height: 1;
}
.rate-widget button.is-filled,
.rate-widget__stars button:hover,
.rate-widget__stars button:hover ~ button{ color: var(--red); }
.rate-widget[data-rated] button{ pointer-events: none; }
.play-count{ font-size: .85rem; color: var(--ink-soft); }

.game-info{
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin: 30px 0;
}
.game-info h2{ font-size: 1.15rem; }

.related-games{ margin-top: 10px; }

/* Highscore block */
.highscore-table{ width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: .92rem; }
.highscore-table th{
  text-align: left; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em;
  color: var(--ink-soft); padding: 6px 10px; border-bottom: 2px solid var(--cream);
}
.highscore-table td{ padding: 8px 10px; border-bottom: 1px solid var(--cream); }
.highscore-table tr.is-first td{ font-weight: 700; color: var(--felt); background: #fbf6e8; }
.highscore-empty{ color: var(--ink-soft); font-size: .9rem; }

.highscore-form{
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding-top: 12px; border-top: 1px dashed rgba(15,61,46,.15);
}
.highscore-form label{ display: block; font-size: .75rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.highscore-form input{
  border: 1px solid #ddd6c2; border-radius: 6px; padding: 9px 10px; font-size: .95rem;
  background: var(--cream);
}
.highscore-form input#hs-name{ width: 160px; }
.highscore-form input#hs-score{ width: 110px; }
.highscore-form__status{ font-size: .85rem; font-weight: 600; }
.highscore-form__status.is-success{ color: var(--felt); }
.highscore-form__status.is-error{ color: var(--red); }
.highscore-hint{ font-size: .8rem; color: var(--ink-soft); margin: 10px 0 0; }

/* -------------------------------------------------------------------- */
/* 6. Standard page / post content                                       */
/* -------------------------------------------------------------------- */
.page-header{ padding: 40px 0 6px; }
.entry-content{ padding-bottom: 10px; }
.entry-content > *:first-child{ margin-top: 0; }
.entry-content img{ border-radius: var(--radius); }
.entry-content a{ color: var(--felt); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; font-weight: 600; }

/* -------------------------------------------------------------------- */
/* 7. SEO text block (above footer, all templates)                       */
/* -------------------------------------------------------------------- */
.seo-text-block{
  background: var(--white);
  border-top: 1px solid rgba(15,61,46,.1);
}
.seo-text-block .container{ padding-top: 34px; padding-bottom: 34px; }
.seo-text-block h2{ font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: .8em; }
.seo-text-block .seo-text-content{
  font-size: .92rem;
  color: var(--ink-soft);
  max-width: 90ch;
}
.seo-text-block .seo-text-content p:last-child{ margin-bottom: 0; }

/* -------------------------------------------------------------------- */
/* 8. Footer                                                              */
/* -------------------------------------------------------------------- */
.site-footer{
  background: var(--felt-dark);
  color: #cfd6cd;
  padding: 40px 0 24px;
  font-size: .88rem;
}
.footer-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  padding-bottom: 24px;
}
.footer-grid h2{ color: var(--gold-light); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .9em; }
.footer-widget ul li{ margin-bottom: 6px; }
.footer-widget a:hover{ color: var(--gold-light); }
.site-footer .footer-bottom{
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* middle column (flags) stays perfectly centered regardless of side text length */
  align-items: center;
  gap: 16px;
  color: #9aa398;
}
.site-footer .footer-bottom > span:first-child{ justify-self: start; }
.site-footer .footer-bottom > span:last-child{ justify-self: end; text-align: right; }
.site-footer .footer-bottom .country-switcher{ justify-self: center; }

@media (max-width: 700px){
  .site-footer .footer-bottom{
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }
  .site-footer .footer-bottom > span:first-child,
  .site-footer .footer-bottom > span:last-child{ justify-self: center; text-align: center; }
}

/* -------------------------------------------------------------------- */
/* 9. Utilities                                                          */
/* -------------------------------------------------------------------- */
.breadcrumbs{ font-size: .82rem; color: var(--ink-soft); padding: 14px 0 0; }
.breadcrumbs a{ text-decoration: underline; }
.empty-state{ padding: 40px 0; text-align: center; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------------- */
/* 9b. Favorites, fullscreen controls, highscore tabs, daily featured    */
/*     game, recently played -- new UX features                         */
/* -------------------------------------------------------------------- */

/* Favorite control, card variant: inline heart + label under the title
   (matches the site's reference layout), not an overlay on the thumb. */
.game-card__favorite--card{
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 0; margin: 2px 0 6px;
  font-size: .85rem; font-weight: 600; color: var(--ink-soft);
}
.game-card__favorite--card .game-card__favorite-icon{ color: #c7c2ab; font-size: 1rem; transition: color .15s ease, transform .15s ease; }
.game-card__favorite--card:hover .game-card__favorite-icon{ transform: scale(1.15); }
.game-card__favorite--card.is-favorited{ color: var(--red); }
.game-card__favorite--card.is-favorited .game-card__favorite-icon{ color: var(--red); }
.game-card.is-hidden-by-filter{ display: none; }

/* Favorite control, frame-toolbar variant: icon-only bookmark button,
   sits alongside the dice/dark-mode icons above the game frame. */
/* Favorite control, frame-toolbar variant: heart icon, toned down grey
   when not favorited, normal red once favorited -- sits alongside the
   dice/dark-mode icons above the game frame. */
.toolbar-icon-btn.game-card__favorite--frame{ color: #c7c2ab; font-size: 1.2rem; }
.toolbar-icon-btn.game-card__favorite--frame:hover{ color: var(--red); background: rgba(181,67,42,.08); }
.toolbar-icon-btn.game-card__favorite--frame.is-favorited{ color: var(--red); }

.favorites-toggle{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; border: 2px solid var(--felt);
  background: transparent; color: var(--felt); font-weight: 700; font-size: .82rem;
  cursor: pointer;
}
.favorites-toggle.is-active{ background: var(--felt); color: #fff; }

.game-frame-toolbar{
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 10px 0 4px;
}
.game-frame-toolbar__icons{ display: inline-flex; gap: 4px; }
.toolbar-icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--felt); font-size: 1.1rem; cursor: pointer;
  text-decoration: none; line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}
.toolbar-icon-btn:hover, .toolbar-icon-btn:focus-visible{
  background: rgba(15,61,46,.08); border-color: var(--felt);
}
.fullscreen-btn{
  padding: 7px 14px; border: 1px solid var(--felt); background: transparent;
  color: var(--felt); border-radius: 6px; cursor: pointer; font-size: .82rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.fullscreen-btn:hover{ background: var(--felt); color: #fff; }
.game-frame-wrap:fullscreen .game-frame,
.game-frame-wrap:-webkit-full-screen .game-frame{ max-width: none; height: 100vh !important; }

.highscore-tabs{ display: flex; gap: 6px; margin-bottom: 12px; }
.highscore-tab{
  padding: 7px 16px; border: 1px solid var(--felt); background: transparent;
  color: var(--felt); border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 700;
}
.highscore-tab.is-active{ background: var(--felt); color: #fff; }
.highscore-panel[hidden]{ display: none; }
.highscore-personal-best{
  font-size: .88rem; font-weight: 600; color: var(--felt);
  background: rgba(15,61,46,.06); border-radius: 6px; padding: 10px 14px; margin: 0 0 16px;
}
.highscore-personal-best.has-best{ font-weight: 700; }

.featured-game{
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--felt), var(--felt-dark));
  color: #fff; border-radius: var(--radius-lg); padding: 22px; margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.featured-game__thumb{ width: 170px; max-width: 100%; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.featured-game__thumb img{ width: 100%; height: 100%; object-fit: cover; }
.featured-game__body{ flex: 1; min-width: 220px; }
.featured-game__badge{
  display: inline-block; background: var(--gold); color: var(--ink); font-weight: 700;
  font-size: .72rem; padding: 4px 11px; border-radius: 999px; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .06em;
}
.featured-game__body h2{ color: #fff; margin-bottom: 8px; }
.featured-game__body p{ color: #d8d5c4; margin-bottom: 14px; }

.recently-played,
.js-list-section{ display: none; }
.recently-played.has-items,
.js-list-section.has-items{ display: block; }

/* -------------------------------------------------------------------- */
/* 10. Mobile refinements                                                */
/* -------------------------------------------------------------------- */
html, body{ overflow-x: hidden; max-width: 100%; }

/* Comfortable tap targets + no grey flash on tap for anything clickable. */
a, button, .btn, .primary-navigation a, .rate-widget button{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.rate-widget button{ min-width: 32px; min-height: 32px; }

@media (max-width: 600px){
  .hero{ padding: 36px 0 40px; }
  .section{ padding: 32px 0; }
  .game-frame{ min-height: 220px; border-radius: 0; }
  .game-actions{ flex-direction: column; align-items: flex-start; gap: 10px; }
  .country-switcher{ gap: 8px; }

  /* Highscore form: stack full-width instead of squeezing inputs. */
  .highscore-form{ flex-direction: column; align-items: stretch; }
  .highscore-form input#hs-name,
  .highscore-form input#hs-score{ width: 100%; }
  .highscore-form .btn{ width: 100%; text-align: center; }

  .highscore-table{ font-size: .82rem; }
  .highscore-table th, .highscore-table td{ padding: 6px; }
}

/* Games grid: keep at least 2 columns even on small phones instead of
   letting minmax() collapse to one huge card. */
@media (max-width: 420px){
  .games-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-card__body{ padding: 10px 10px 14px; }
  .game-card__title{ font-size: .92rem; }
  .game-card__excerpt{ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
