/* games.gr — front-end redesign (CrazyGames-style, games.gr purple identity).
   Plain CSS, no dependencies. Hand to devs: replace the cards inside each
   <!-- LOOP --> with your server template; .ad-slot marks ad units. */

:root {
  /* games.gr app palette */
  --bg-top:    #3a2870;
  --bg-mid:    #241650;
  --bg-bottom: #140a2e;
  --surface:   #271b4d;   /* CardSurface */
  --surface-2: #34265f;
  --surface-3: #3f2f70;
  --text:      #f3eeff;
  --muted:     #b9aee0;
  --accent:    #8b5cf6;
  --accent-2:  #b388ff;
  --new:       #4fc3f7;
  --top:       #ffc93c;
  --radius:    14px;
  --header-h:  76px;
  --sidebar-w: 232px;
  --rail-w:    76px;   /* collapsed sidebar (icons only) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 38%, var(--bg-bottom) 100%) fixed;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: 0; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: rgba(20,10,46,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ffffff14;
}
.logo-img { height: 50px; width: auto; }

.menu-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: #ffffff14; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.menu-btn:hover { background: #ffffff24; }
.menu-btn svg { width: 22px; height: 22px; fill: var(--text); }

.search {
  flex: 1; max-width: 560px; margin: 0 auto;   /* centered */
  display: flex; align-items: center; gap: 10px;
  background: #ffffff10; border: 1px solid #ffffff1f;
  border-radius: 999px; padding: 0 18px; height: 44px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #8b5cf640;
  background: #ffffff16;
}
.search input { flex: 1; background: none; border: 0; color: var(--text); font-size: 15px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search svg { width: 18px; height: 18px; fill: var(--muted); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px;
  background: #ffffff14; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: #ffffff24; }
.icon-btn svg { width: 21px; height: 21px; fill: var(--text); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5e7e; border: 2px solid var(--bg-mid);
}

/* ---------- Layout ---------- */
.layout { display: flex; }

/* Sidebar is a collapsible rail: shows category ICONS when closed, icons+labels
   when opened with the hamburger (CrazyGames-style). It stays in flow. */
.sidebar {
  width: var(--rail-w); flex-shrink: 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 10px 30px;
  border-right: 1px solid #ffffff10;
  transition: width .22s ease;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 8px; }
.sidebar.open { width: var(--sidebar-w); }

.sidebar h4 {
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  margin: 16px 12px 8px; white-space: nowrap; overflow: hidden;
}
.sidebar:not(.open) h4 { height: 1px; margin: 12px 8px; background: #ffffff14; color: transparent; }

.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 13px; border-radius: 11px; color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden;
  transition: background .15s;
}
.nav-item:hover { background: var(--surface); }
.nav-item.active { background: var(--accent); box-shadow: 0 6px 18px -6px var(--accent); }
.nav-item .ic { min-width: 24px; width: 24px; text-align: center; font-size: 19px; }
.nav-item .label { transition: opacity .15s; }
.sidebar:not(.open) .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar:not(.open) .nav-item .label { width: 0; opacity: 0; }

/* ---------- Sidebar socials (shown when the menu is open) ---------- */
.side-social { display: none; }
.sidebar.open .side-social { display: block; }
.ss-row { display: flex; gap: 10px; padding: 2px 12px 14px; }
.ss {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -8px #000;
  transition: transform .15s, box-shadow .15s;
}
.ss svg { width: 20px; height: 20px; fill: #fff; }
.ss:hover { transform: translateY(-2px); }
.ss.ig { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.ss.ig:hover { box-shadow: 0 8px 20px -6px #d6249f99; }
.ss.fb { background: #1877f2; }
.ss.fb:hover { box-shadow: 0 8px 20px -6px #1877f299; }
.ss.tt { background: #010101; border: 1px solid #ffffff2e; }
.ss.tt svg {
  width: 25px; height: 25px;   /* the note glyph fills less of its viewBox than the IG/FB marks */
  filter: drop-shadow(1px 0 0 #fe2c55) drop-shadow(-1px 0 0 #25f4ee);  /* TikTok glitch */
}
.ss.tt:hover { box-shadow: 0 8px 20px -6px #25f4ee66; }

/* ---------- FAKE AD PLACEHOLDERS (μόνο σε preview mode) --------------------
   Realistic boxes ώστε να κρίνεται το πραγματικό οπτικό βάρος στο layout.
   ΔΕΝ εμφανίζονται στους επισκέπτες: ενεργοποιούνται ΜΟΝΟ όταν το URL έχει
   #adpreview (το app10 βάζει την gg-adpreview στο <html>). Χωρίς αυτήν, τα
   .ad-ph slots μένουν hidden-until-filled όπως όλα τα ad slots. */
html.gg-adpreview .ad-slot.ad-ph { display: flex !important; }
/* AdSense compliance: ad containers must NOT clip or reshape the creative —
   square corners, no overflow tricks, on every ad slot. */
body .ad-slot, body .ad-slot .banner { border-radius: 0; overflow: visible; }
.ad-fake {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  width: 100%; height: 100%; min-height: inherit;
  background: linear-gradient(160deg, #2e2255 0%, #241a45 55%, #1c1338 100%);
  border: 1px solid #ffffff14;
  color: var(--muted);
}
.ad-fake span { font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; opacity: .65; }
.ad-fake em { font-style: normal; font-size: 19px; font-weight: 800; color: #cfc3f5; opacity: .45; }
.ad-slot.ad-side { max-width: 300px; margin-left: auto; margin-right: auto; }
/* Socials χωρίς λογαριασμό (κάθε domain πλην games.gr): το app10 αφαιρεί το
   href — το κουμπί μένει ορατό αλλά αδρανές. */
a.ss:not([href]) { pointer-events: none; cursor: default; }
/* Game page: 728x90 under the action bar, LEFT-aligned to the game's edge. */
.player-wrap > .ad-leaderboard {
  width: 728px; max-width: 100%; height: 90px;
  margin: 16px auto 0 0; justify-content: flex-start;
}
/* 300x250 medium rectangle inside the description — text wraps around it. */
.about .ad-mrec { float: right; width: 300px; height: 250px; margin: 0 0 14px 20px; }
.about::after { content: ""; display: block; clear: both; }   /* contain the float */
/* 300x600: TOP-ALIGNED with the game stage (the generic .ad-slot top margin
   was pushing it 14px lower than the game's top edge). */
.game-side > .ad-slot { margin-top: 0; }
/* The mobile 300x250 (below the description, above «Παρόμοια») exists as its
   own slot — desktop and mobile will carry different AdSense units anyway. */
@media (min-width: 1025px) { .ad-slot.ad-mrec-mobile { display: none !important; } }
@media (max-width: 1024px) {
  /* the desktop in-description rectangle never shows on mobile… */
  .about .ad-slot.ad-mrec { display: none !important; }
  /* …the mobile one takes over: centred, between description and Παρόμοια */
  .ad-slot.ad-mrec-mobile { width: 300px; height: 250px; margin: 16px auto 0; }
  /* 300x600 is a DESKTOP-ONLY format — it never renders on mobile. */
  .game-side .ad-slot.ad-side { display: none !important; }
  /* The 728x90 doesn't fit a phone: the slot becomes a 320x100 mobile-banner
     placement, CENTRED on the landing. The desktop creative inside is
     suppressed (zero size → the checker keeps showing the preview fake). */
  .player-wrap > .ad-leaderboard { width: 320px; height: 100px; margin: 14px auto 0; }
  .player-wrap > .ad-leaderboard > *:not(.ad-fake) { display: none; }
  .player-wrap > .ad-leaderboard .ad-fake em { font-size: 0; }
  .player-wrap > .ad-leaderboard .ad-fake em::after { content: "320×100"; font-size: 19px; }
}

/* footer socials (same .ss buttons, works on desktop + responsive).
   The generic `.footer a { display:block; padding:4px 0 }` was restyling the
   tiles — reset it so they render IDENTICAL to the sidebar ones. */
.footer .ft-follow {
  margin: 18px 0 0; color: var(--muted);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .9px;
}
.ft-social { display: flex; gap: 10px; margin-top: 10px; }
.footer .ft-social a.ss { display: inline-flex; padding: 0; }
/* search-overlay socials (mobile panel, below the categories) — bigger touch targets */
.so-follow {
  margin-top: 12px; padding-top: 20px; border-top: 1px solid #ffffff12;
  text-align: center; color: var(--muted);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .9px;
}
.so-social {
  display: flex; justify-content: center; gap: 14px;
  padding: 14px 0 30px;
}
.so-social .ss { width: 44px; height: 44px; border-radius: 14px; }
.so-social .ss svg { width: 23px; height: 23px; }
.so-social .ss.tt svg { width: 28px; height: 28px; }

.main { flex: 1; min-width: 0; padding: 22px 28px 70px; }

/* Visually-hidden page title kept for SEO (no big hero heading). */
.sr-title { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 26px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid #ffffff12;
  padding: 9px 17px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: background .15s, transform .1s;
}
.chip:hover { background: var(--surface-2); transform: translateY(-1px); }

/* ---------- Sections / rails ---------- */
/* Equal whitespace above and below each section title. All the vertical gap
   lives on the title's own margin (equal top & bottom); the section itself adds
   none, and the rail padding is symmetric (below), so above == below. */
.section { margin-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 11px; margin: 4px 0; }
.section-head .dot {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.section-head h2 { font-size: 21px; font-weight: 800; }
.section-head .more {
  color: var(--accent-2); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 3px; transition: gap .15s;
  margin-top: 4px; /* sits right next to the category name */
}
.section-head .more:hover { gap: 7px; }

/* Rail + horizontal slider arrows */
.rail-wrap { position: relative; }
.rail { display: flex; gap: 7px; overflow-x: auto; padding: 8px 2px 8px; cursor: grab; scrollbar-width: thin; }
.rail.dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.rail.dragging a { pointer-events: none; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: #ffffff1f; border-radius: 8px; }

/* Category tiles (boxes with a coloured symbol) — live inside a .rail slider. */
.cat-tile {
  flex-shrink: 0; width: 158px; height: 96px;
  border-radius: 16px; padding: 13px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; font-weight: 800; font-size: 15px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 20px -12px #00000090;
  transition: transform .14s ease;
}
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile .ic { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 4px #00000040); }
.cat-tile .nm { text-shadow: 0 1px 4px #00000055; }
.rail-arrow {
  position: absolute; top: 38%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -4px #000000aa;
  opacity: 0; transition: opacity .15s, background .15s;
}
.rail-wrap:hover .rail-arrow { opacity: 1; }
.rail-arrow:hover { background: var(--accent); }
.rail-arrow svg { width: 22px; height: 22px; fill: currentColor; }
.rail-arrow.left  { left: -8px; }
.rail-arrow.right { right: -8px; }
.rail-arrow.hidden { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .rail-arrow { display: none; } }   /* touch: native swipe */

/* lead rail (Συνέχισε το παιχνίδι σου / Δημοφιλή): same 180×135 tiles as the rest */
.rail.lead .card,
.rail.lead .card .thumb { width: 180px; }

/* ---------- Game card ---------- */
.card { width: 180px; flex-shrink: 0; }
.card .thumb {
  /* thumbnail size test: 180×135 (4:3) */
  position: relative; width: 180px; aspect-ratio: 180 / 135; border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
  box-shadow: 0 8px 20px -12px #00000080;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.card:hover .thumb img { transform: scale(1.09); }
.card .thumb::after { content: ""; position: absolute; inset: 0; background: rgba(10,6,24,.4); opacity: 0; transition: opacity .2s; }
.card:hover .thumb::after { opacity: 1; }
.card .play-ic {
  position: absolute; inset: 0; margin: auto; width: 50px; height: 50px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.7); transition: .2s;
  box-shadow: 0 8px 20px -4px var(--accent);
}
.card:hover .play-ic { opacity: 1; transform: scale(1); }
.card .play-ic svg { width: 22px; height: 22px; fill: #fff; }
.card .title { margin-top: 9px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Συνέχισε το παιχνίδι σου" — resume progress bar pinned to the thumb bottom */
.card .resume {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: 6px; background: #00000066;
}
.card .resume > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 0 3px 3px 0; }

.badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 7px; color: #1a1040;
}
.badge.new { background: var(--new); color: #06283b; }
.badge.top { background: var(--top); color: #4a3500; }

/* ---------- "Top παιχνίδια σήμερα" mosaic (1 big + small tiles) ---------- */
/* 2-row band that scrolls horizontally; big featured tiles span 2×2, the rest
   are small square tiles that pack into 2×2 clusters between them. */
.top-grid {
  display: grid;
  grid-auto-flow: column;
  /* row height fixed; column width = height × 503/303 so every tile keeps the
     games.gr landscape ratio (small = 1 cell, big = 2×2 → same shape, larger). */
  grid-template-rows: repeat(2, 135px);
  grid-auto-columns: 180px;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}
.top-grid::-webkit-scrollbar { height: 8px; }
.top-grid::-webkit-scrollbar-thumb { background: #ffffff1f; border-radius: 8px; }
.top-grid .card { position: relative; width: auto; height: 100%; }
.top-grid .card .thumb { width: 100%; height: 100%; }
/* featured tile = 2×2 (both rows, double width) */
.top-grid .card.big { grid-row: span 2; grid-column: span 2; }
/* overlay the title on the tile so each card == its thumbnail and the mosaic stays aligned */
.top-grid .card .title {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; z-index: 3;
  padding: 20px 11px 9px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(transparent, #0b0620e6);
  white-space: normal; text-overflow: clip; text-shadow: 0 1px 4px #000;
}
.top-grid .card.big .title { font-size: 18px; padding: 40px 16px 14px; }

/* Rank number badge */
.rank {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 9px;
  background: #0b0620cc; backdrop-filter: blur(3px);
  color: #fff; font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -4px #000000aa, inset 0 0 0 1px #ffffff22;
}
.card.big .rank {
  min-width: 40px; height: 40px; font-size: 20px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
@media (max-width: 560px) {
  .top-grid { grid-template-rows: repeat(2, 108px); grid-auto-columns: 144px; gap: 7px; }
}

/* ---------- Ad slot ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #ffffff0a, #ffffff0a 10px, #ffffff05 10px, #ffffff05 20px);
  border: 1px dashed #ffffff2a; border-radius: 12px;
  color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  margin: 28px 0;
}
.ad-leaderboard { height: 90px; }

/* ---------- Footer ---------- */
.footer { margin-top: 30px; background: #0f0825; border-top: 1px solid #ffffff12; color: var(--muted); font-size: 13px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 28px 24px; }
.footer .cols {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 28px; border-bottom: 1px solid #ffffff10;
}
.footer .brand-col img { height: 42px; margin-bottom: 12px; }
.footer .brand-col p { max-width: 320px; line-height: 1.6; }
.footer h5 { color: var(--text); margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.footer a { display: block; padding: 4px 0; transition: color .15s; }
.footer a:hover { color: var(--accent-2); }
.footer .socials { display: flex; gap: 10px; margin-top: 14px; }
.footer .socials a {
  width: 38px; height: 38px; border-radius: 10px; background: #ffffff12;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.footer .socials a:hover { background: var(--accent); }
.footer .socials svg { width: 18px; height: 18px; fill: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding-top: 20px; font-size: 12.5px;
}
.footer-bottom .links { display: flex; gap: 18px; }
@media (max-width: 760px) {
  .footer .cols { grid-template-columns: 1fr 1fr; gap: 28px; }
  /* The brand column is short while Categories is tall — side by side they left
     a huge void under the socials before the next column. Brand goes full-width
     and centred on top; Categories + site links pair up below it. */
  .footer .brand-col { grid-column: 1 / -1; text-align: center; }
  .footer .brand-col img { margin-left: auto; margin-right: auto; }
  .footer .brand-col p { max-width: none; }
  .footer .ft-social { justify-content: center; }
}

/* ============================================================
   CATEGORY PAGE
   ============================================================ */

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
/* Mobile: hide the breadcrumb (cleaner UI). SEO-safe: Google's breadcrumb rich
   results come from the BreadcrumbList JSON-LD, which stays; responsive hiding
   is not cloaking and the links remain in the DOM. */
@media (max-width: 1024px) { .crumbs { display: none; } }
/* Game page: the crumb sits between the action bar and the description — give
   it a symmetric rhythm: 26px above (its own margin) and 26px below (the
   .about margin-top; sibling margins collapse to the larger value). */
.player-wrap > .crumbs { margin: 26px 2px 0; }
.crumbs a { color: var(--muted); transition: color .15s; }
.crumbs a:hover { color: var(--accent-2); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); font-weight: 600; }

/* Category hero banner (coloured gradient, set inline per category) */
.cat-hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 30px 32px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 26px;
  box-shadow: 0 18px 40px -22px #00000099;
}
.cat-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 140% at 100% 0%, #ffffff26, transparent 55%);
  pointer-events: none;
}
.cat-hero .hero-ic {
  flex-shrink: 0; width: 84px; height: 84px; border-radius: 22px;
  background: #ffffff22; backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  box-shadow: inset 0 0 0 1px #ffffff30;
}
.cat-hero .hero-txt { position: relative; z-index: 1; color: #fff; }
.cat-hero h1 { font-size: 30px; font-weight: 900; letter-spacing: -.3px; text-shadow: 0 2px 8px #00000040; }
.cat-hero .count { font-size: 13px; font-weight: 700; opacity: .9; margin-top: 4px; }
.cat-hero p { max-width: 560px; margin-top: 10px; line-height: 1.55; font-size: 14px; opacity: .95; text-shadow: 0 1px 4px #00000040; }

/* Sort / filter toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar .lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.sort-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid #ffffff14;
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--text);
  transition: background .15s, transform .1s, border-color .15s;
}
.sort-chip:hover { background: var(--surface-2); transform: translateY(-1px); }
.sort-chip.active { background: var(--accent); border-color: transparent; box-shadow: 0 6px 18px -6px var(--accent); }
.sort-chip svg { width: 15px; height: 15px; fill: currentColor; opacity: .9; }

/* Responsive game GRID (the category body) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 9px 7px;
}
.grid .card, .grid .card .thumb { width: 100%; }
.grid .card .thumb { height: auto; aspect-ratio: 180 / 135; }

/* Load-more */
.load-more { display: flex; justify-content: center; margin: 34px 0 6px; }
.btn-load {
  background: var(--surface-2); color: var(--text); border: 1px solid #ffffff1a;
  padding: 13px 30px; border-radius: 999px; font-size: 14px; font-weight: 700;
  transition: background .15s, transform .1s;
}
.btn-load:hover { background: var(--accent); transform: translateY(-1px); }

/* ============================================================
   GAME PAGE
   ============================================================ */
.game-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 26px; align-items: start; }

/* Player / stage */
.player-wrap { min-width: 0; }
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border-radius: 18px; overflow: hidden;
  background: #0c0722 center/cover no-repeat;
  box-shadow: 0 22px 50px -24px #000000c0, inset 0 0 0 1px #ffffff12;
}
.player .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.55); transform: scale(1.06); }
.player .stage-inner {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center; padding: 24px;
}
.player .game-icon {
  width: 110px; height: 110px; border-radius: 24px; object-fit: cover;
  box-shadow: 0 14px 34px -10px #000000c0, 0 0 0 1px #ffffff20;
}
.player .stage-inner h2 { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 2px 10px #000; }
.btn-play {
  display: inline-flex; align-items: center; gap: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 17px; font-weight: 800;
  padding: 15px 38px; border-radius: 999px;
  box-shadow: 0 14px 34px -10px var(--accent);
  transition: transform .12s, box-shadow .15s;
}
.btn-play:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 44px -10px var(--accent); }
.btn-play svg { width: 22px; height: 22px; fill: #fff; }

/* Action bar under the stage */
.game-bar {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid #ffffff12;
  border-radius: 14px; padding: 12px 16px; margin-top: 14px;
}
.game-bar .gb-icon { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.game-bar .gb-meta { min-width: 0; }
.game-bar .gb-meta .nm { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-bar .gb-meta .by { font-size: 12.5px; color: var(--muted); }
.game-bar .gb-actions { margin-left: auto; display: flex; gap: 9px; }
.gb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); color: var(--text); border: 1px solid #ffffff14;
  height: 40px; padding: 0 15px; border-radius: 11px; font-size: 13.5px; font-weight: 700;
  transition: background .15s;
}
.gb-btn:hover { background: var(--surface-3); }
.gb-btn.fav:hover { background: #ff5e7e22; color: #ff90a6; }
.gb-btn.fav.on { color: #ff6b9e; background: #ff5e7e1a; }   /* favourited (svg inherits currentColor) */
.gb-btn.gb-report:hover { background: #ffb22421; color: #ffcc66; }
.gb-btn.fav.on:active svg { transform: scale(1.28); }
.gb-btn svg { width: 17px; height: 17px; fill: currentColor; transition: transform .12s; }
.gb-btn .num { color: var(--muted); font-weight: 700; }

/* Rating row */
.game-stats { display: flex; align-items: center; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.game-stats .stars { display: inline-flex; gap: 2px; }
.game-stats .stars svg { width: 19px; height: 19px; fill: var(--top); }
.game-stats .rate-num { font-size: 15px; font-weight: 800; }
.game-stats .rate-num span { color: var(--muted); font-weight: 600; font-size: 13px; }
.game-stats .tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); font-weight: 600;
}

/* Description / about */
.about { margin-top: 26px; background: var(--surface); border: 1px solid #ffffff10; border-radius: 16px; padding: 22px 24px; }
.about h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.about p { line-height: 1.7; color: #ded5ff; font-size: 14.5px; margin-bottom: 12px; }
.about .pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.about .pills a {
  background: var(--surface-2); border: 1px solid #ffffff14;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--accent-2);
  transition: background .15s;
}
.about .pills a:hover { background: var(--surface-3); }
.about .info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 14px; margin-top: 18px; }
.about .info-grid .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.about .info-grid .v { font-size: 14px; font-weight: 700; margin-top: 3px; }

/* Right sidebar: recommended games list */
.game-side { position: sticky; top: calc(var(--header-h) + 16px); }
.side-card { background: var(--surface); border: 1px solid #ffffff10; border-radius: 16px; padding: 16px; }
.side-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.side-game { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 12px; transition: background .15s; }
.side-game:hover { background: var(--surface-2); }
.side-game img { width: 58px; height: 58px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.side-game .sg-nm { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.side-game .sg-cat { font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-side { position: static; }
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .search { width: 200px; }
  .cat-hero { padding: 22px; gap: 16px; }
  .cat-hero .hero-ic { width: 64px; height: 64px; font-size: 34px; }
  .cat-hero h1 { font-size: 23px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px 12px; }
  .player .game-icon { width: 84px; height: 84px; }
  .btn-play { padding: 13px 30px; font-size: 15px; }
}
@media (max-width: 560px) {
  .header { gap: 10px; padding: 0 12px; }
  .logo-img { height: 38px; }
  .menu-btn { width: 40px; height: 40px; }
  .search { width: 100%; }
  .logo { display: none; }   /* on tiny screens: menu + full-width search */
  .btn { padding: 9px 14px; }
  .main { padding: 16px 14px 56px; }
  .card, .card .thumb { width: 168px; }
  .rail.lead .card, .rail.lead .card .thumb { width: 168px; }
}

/* ============================================================
   MOBILE / TABLET — iOS app-mode (≤1024px)   [responsive layer]
   Reuses the shared classes (.header/.layout/.sidebar/.rail/.card).
   Adds: single-column chrome, frosted header, slide-in category
   drawer (opened by the bottom tab bar) and a floating tab bar.
   ============================================================ */

/* Search-lens toggle is mobile-only; desktop keeps the full search bar. */
.search-toggle { display: none; }
/* (bottom tab bar removed — nav is the header lens + heart; the lens opens a
    full-screen search-and-categories panel) */

@media (max-width: 1024px) {
  /* App-mode chrome: no sidebar column, no hamburger; single scrolling column. */
  .layout { display: block; }
  .menu-btn { display: none; }              /* ☰ hidden — categories live in the search panel */
  .header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
  .header-actions .icon-btn, .header-actions .search-toggle { display: flex; }

  /* iOS Brand gradient: deep blue-indigo, top slightly lighter. */
  body { background: linear-gradient(180deg, #2a1e63 0%, #1c1449 48%, #140d33 100%) fixed; overflow-x: hidden; }

  .header {
    height: 58px; gap: 10px; padding: 0 12px;
    background: rgba(23,14,54,.72); backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid #ffffff12;
  }
  .logo { display: flex; align-items: center; }   /* logo always visible, top-left (override the ≤560 hide) */
  .logo-img { height: 32px; }

  /* Inline search bar + the sidebar column are hidden on mobile; the lens opens
     a full-screen search-and-categories panel instead (see .search-overlay).
     The sidebar stays in the DOM as the category data source for that panel. */
  .search { display: none; }
  .sidebar { display: none; }
  body.search-open { overflow: hidden; }    /* lock page scroll while the panel is open */

  .main { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .rail-arrow { display: none; }            /* touch uses native swipe, not hover arrows */

  /* Row headers: bold white with icon, like the app. */
  .section-head { gap: 9px; margin: 6px 0 2px; }
  .section-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.2px; }

  /* iOS-style square game tiles in touch rails. */
  .section { margin-bottom: 6px; }
  .rail { gap: 11px; padding: 4px 0 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; cursor: default; }
  .rail .card { scroll-snap-align: start; }
  .card, .card .thumb { width: 132px; }
  .card .thumb { aspect-ratio: 1 / 1; border-radius: 18px; }
  .card .title { font-size: 13px; font-weight: 500; margin-top: 8px; }
  .rail.lead .card, .rail.lead .card .thumb { width: 138px; }

  /* Category tiles: smaller, rounder. */
  .cat-tile { width: 138px; height: 88px; border-radius: 18px; }

  /* Grid pages (category / tpl4 .gll) → app-style square tiles. */
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 11px; }
  .grid .card .thumb,
  .grid .gll > a.li > img { aspect-ratio: 1 / 1; border-radius: 18px; }
  /* keep the hover/tap overlay matched to the square image box + its radius */
  .grid .gll > a.li::after { aspect-ratio: 1 / 1; border-radius: 18px; }

  /* ---- Floating bottom tab bar — iOS "liquid glass" capsule ---- */
  .tabbar {
    position: fixed; left: 12px; right: 12px; z-index: 90;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: stretch;
    height: 62px; padding: 0 6px; border-radius: 30px;
    background: rgba(34,23,74,.66); backdrop-filter: blur(26px) saturate(1.5);
    border: 1px solid #ffffff24;
    box-shadow: 0 16px 40px -12px #000000cc, inset 0 1px 0 #ffffff1a;
  }
  .tab {
    flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0;
    background: none; border: 0; cursor: pointer; font: inherit;
  }
  .tab-in {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 11px; border-radius: 16px;
    color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1px;
    white-space: nowrap; transition: background .18s, color .18s, transform .1s;
  }
  .tab svg { width: 24px; height: 24px; fill: currentColor; }
  .tab.active .tab-in { background: #ffffff1c; color: var(--accent-2); }
  .tab:active .tab-in { transform: scale(.9); }
}

/* Tablet: a bit more room, larger tiles. */
@media (min-width: 641px) and (max-width: 1024px) {
  .card, .card .thumb { width: 150px; }
  .rail.lead .card, .rail.lead .card .thumb { width: 158px; }
  .cat-tile { width: 156px; height: 96px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Small phones: tighter chrome. */
@media (max-width: 430px) {
  .header { gap: 8px; padding: 0 10px; }
  .logo-img { height: 30px; }
  .main { padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); }
  .card, .card .thumb { width: 120px; }
  .rail.lead .card, .rail.lead .card .thumb { width: 126px; }
  .cat-tile { width: 124px; height: 82px; }
}

/* ============================================================
   FULL-SCREEN SEARCH + CATEGORIES PANEL (mobile; opened by the header lens).
   CrazyGames-style: back-arrow + search on top, every category below
   (emoji icon + name + › chevron). Rows are built by app.js from .side-cats.
   ============================================================ */
.search-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(180deg, #1a1338 0%, #120c2b 100%);
  flex-direction: column;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.search-overlay, .search-overlay * { box-sizing: border-box; }
body.search-open .search-overlay { display: flex; }

.so-top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #14092e; border-bottom: 1px solid #ffffff10;
}
.so-back {
  flex: none; width: 40px; height: 40px; border: 0; background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.so-back svg { width: 24px; height: 24px; }
.so-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px; border-radius: 999px;
  background: #ffffff14; border: 1px solid #ffffff1a;
}
.so-search svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.so-search input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  color: var(--text); font-size: 16px;
}
.so-search input::placeholder { color: var(--muted); }

.so-body { padding: 8px 18px calc(28px + env(safe-area-inset-bottom)); }
.so-title { display: none; }   /* «Κατηγορίες» heading hidden — the category list is self-evident */
.so-cats { display: flex; flex-direction: column; }
.so-cat {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 30px 16px 2px; border-bottom: 1px solid #ffffff12;
  color: var(--text); text-decoration: none;
}
.so-cat:last-child { border-bottom: 0; }
.so-cat-ic { font-size: 24px; width: 30px; text-align: center; flex: none; }
.so-cat-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-cat-arrow {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  color: #b9a3ff; font-size: 26px; line-height: 1;
}
.so-cat:active { background: #ffffff0a; border-radius: 10px; }

/* ============================================================
   MOBILE GAME FULLSCREEN (pseudo-fullscreen; works on iOS too, where native
   requestFullscreen on a div/iframe is unsupported). Toggled by app.js on play.
   ============================================================ */
body.game-fs { overflow: hidden; }
/* The game fills the whole viewport; the Exit floats top-LEFT over it (like
   CrazyGames). Game ad-controls live top-right, so Exit never overlaps them. */
body.game-fs .player {
  position: fixed; inset: 0;
  z-index: 300; margin: 0; border-radius: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
}
/* Floating Exit pill (top-left, fullscreen only). */
.game-exit-bar {
  position: fixed; z-index: 316; display: none;
  top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left));
}
body.game-fs .game-exit-bar { display: block; }
.game-exit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px 0 8px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px -4px #000000aa;
}
.game-exit-btn svg { width: 14px; height: 14px; fill: #fff; }
.game-exit-btn:active { transform: scale(.95); }
/* armed state (two-step exit): first tap turns the pill red — «Πάτα ξανά» */
.game-exit-bar.confirm .game-exit-btn { background: #e5484d; }
/* Fullscreen sizing. Default: the game fills the whole viewport — most embeds
   (GameDistribution etc.) adapt responsively to their container, so give them
   everything (e.g. Forest Match 800x600 would otherwise be squared needlessly).
   Only full_screen=2 games (fixed-canvas/stretch-prone like Coral Mystery) get
   letterboxed to their native --gw/--gh aspect — the largest box of that shape
   that fits, centred, black space around (where the Exit pill sits). */
body.game-fs #game-wrapper {
  width: 100vw !important; height: 100dvh !important;
  max-width: 100% !important; max-height: 100% !important; margin: 0 !important;
}
body.game-fs .player[data-fs="2"] #game-wrapper {
  width: min(100vw, calc(100dvh * var(--gw, 16) / var(--gh, 9))) !important;
  height: min(100dvh, calc(100vw * var(--gh, 9) / var(--gw, 16))) !important;
}
/* fs=2 fullscreen sizing: the iframe simply FILLS the letterbox box (100%).
   We briefly used the desktop native-size+transform:scale trick here too, but
   Safari has a known WebKit bug where TOUCH coordinates are not mapped through
   CSS transforms on iframes — the game's own PLAY button became untappable in
   landscape (visitor report). Providers serve their mobile-adaptive mode on
   phones anyway, so plain fill is correct here; desktop keeps the scale trick
   (mouse events map fine). */
/* PORTRAIT: the Exit lives in its OWN top strip, OUTSIDE the game — floating
   over the game it was covering in-game scores (many games draw the score at
   the top). The game area starts below the strip. Landscape keeps the floating
   pill (it sits in unused/black space there). */
@media (orientation: portrait) {
  body.game-fs .game-exit-bar {
    top: 0; left: 0; right: 0;
    padding: calc(6px + env(safe-area-inset-top)) 10px 6px calc(10px + env(safe-area-inset-left));
    background: #08050f;
  }
  body.game-fs .player { padding-top: calc(38px + env(safe-area-inset-top)); }
  body.game-fs #game-wrapper {
    height: calc(100dvh - 38px - env(safe-area-inset-top)) !important;
  }
  body.game-fs .player[data-fs="2"] #game-wrapper {
    width: min(100vw, calc((100dvh - 38px - env(safe-area-inset-top)) * var(--gw, 16) / var(--gh, 9))) !important;
    height: min(calc(100dvh - 38px - env(safe-area-inset-top)), calc(100vw * var(--gh, 9) / var(--gw, 16))) !important;
  }
}
body.game-fs #gamearea,
body.game-fs #gamearea-inner,
body.game-fs #gmfr {
  width: 100% !important; height: 100% !important; max-width: 100% !important; margin: 0 !important;
  /* #gmfr carries min-height:360px for the in-page stage; in fullscreen it must
     NEVER floor the height — on Safari landscape the visible viewport is ~330pt,
     so the 360 floor pushed the game's bottom 30pt off-screen (the debug-found
     gmfr:856x360 inside wrap:856x330). */
  min-height: 0 !important;
}
/* Safari sometimes misses the resize event inside the game iframe when our CSS
   changes its size (fullscreen enter / rotation) — the game keeps its stale
   canvas scale until a "real" resize. app10.js toggles .gg-nudge for ~60ms to
   perturb the width by 0.1% and force a genuine resize (invisible to the eye). */
body.game-fs.gg-nudge #gmfr iframe,
body.game-fs.gg-nudge #gmfr canvas,
body.game-fs.gg-nudge #gmfr embed,
body.game-fs.gg-nudge #gmfr object,
body.game-fs.gg-nudge #gmfr > div,
body.game-fs.gg-nudge #gmfr ruffle-player { width: 99.9% !important; }
body.game-fs #gmfr iframe,
body.game-fs #gmfr canvas,
body.game-fs #gmfr embed,
body.game-fs #gmfr object,
body.game-fs #gmfr > div,
body.game-fs #gmfr ruffle-player {
  width: 100% !important; height: 100% !important; border: 0;
}
/* Mobile game PLAY COVER (CrazyGames-style): the game thumbnail + a big circular
   ▶ over the auto-loaded stage. Tap enters fullscreen (native where supported)
   and reveals the game; the tap also unlocks audio. Exit = the phone's back. */
.game-play-cover {
  position: absolute; inset: 0; z-index: 40;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 20px; cursor: pointer; overflow: hidden;
  border-radius: inherit; background: var(--bg-mid);
}
/* Blurred game art as ambience (CrazyGames-style) + dark veil for legibility. */
.gpc-bg {
  position: absolute; inset: -28px; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(20px) brightness(.42) saturate(1.15);
  transform: scale(1.12);
}
.game-play-cover > *:not(.gpc-bg) { position: relative; z-index: 1; }
/* Small rounded art card — the game photo at a size it can't stretch/pixelate. */
.gpc-art {
  width: min(56%, 220px); aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 20px 46px -14px #000000d0, 0 0 0 1px #ffffff24;
}
.gpc-title {
  color: #fff; font-size: 21px; font-weight: 900; letter-spacing: -.3px; text-align: center;
  padding: 0 22px; text-shadow: 0 2px 18px rgba(0,0,0,.75);
}
.gpc-meta {
  display: flex; align-items: center; gap: 18px;
  color: #e9e2ff; font-size: 14px; font-weight: 700; text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.gpc-meta .star { color: var(--top); font-style: normal; }
/* Big glossy pill with the label inside — the CTA reads instantly. The pulse
   rings (the effect we kept) hug the pill's capsule shape. */
.gpc-play {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 28px 0 22px; border-radius: 999px;
  max-width: calc(100vw - 44px);
  background:
    radial-gradient(120% 160% at 30% 18%, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 48%),
    linear-gradient(155deg, #b79bff 0%, var(--accent) 48%, #6f42ff 100%);
  box-shadow:
    0 22px 52px -10px rgba(124,77,255,.72),
    0 0 0 1.5px rgba(255,255,255,.55),
    inset 0 2px 2px rgba(255,255,255,.6),
    inset 0 -7px 16px rgba(64,26,160,.42);
  animation: gpcBreathe 2.8s ease-in-out infinite;
}
.gpc-play svg { flex: 0 0 auto; width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(40,10,90,.5)); }
.gpc-label {
  color: #fff; font-size: 17px; font-weight: 900; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(40,10,90,.45);
}
.gpc-play::before, .gpc-play::after {   /* pulsing rings that invite the tap */
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.5); pointer-events: none;
}
.gpc-play::before { animation: gpcPulse 2s ease-out infinite; }
.gpc-play::after  { animation: gpcPulse 2s ease-out infinite 1s; }
@keyframes gpcPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.18, 1.55); opacity: 0; } }
@keyframes gpcBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.gpc-play:active { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) { .gpc-play, .gpc-play::before, .gpc-play::after { animation: none; } }
@media (max-width: 1024px) {
  .player { position: relative; }
  .game-play-cover { display: flex; }
  /* Landing (cover showing): the stage would keep the game's native pixel
     height (528-704px) — cap it so the landing is a tidy card, not a monster.
     Fullscreen (.game-fs) has its own sizing. */
  body:not(.game-fs) .player { max-height: 480px; overflow: hidden; }
  /* Action bar under the stage → centred round chips (CrazyGames-style).
     The h1 title stays in the DOM for SEO but is visually replaced by the
     cover's own big title. */
  .game-bar { justify-content: center; }
  .game-bar .gb-title {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .game-bar .gb-actions { margin: 0 auto; gap: 10px; }
  .gb-btn { height: 44px; min-width: 52px; justify-content: center; border-radius: 999px; }
  .gb-btn svg { width: 19px; height: 19px; }
}
/* Mobile LANDSCAPE landing: tighter cover so everything fits in 62dvh. */
@media (max-width: 1024px) and (orientation: landscape) {
  body:not(.game-fs) .player { max-height: 62dvh; }
  .game-play-cover { gap: 8px; }
  .gpc-art { width: min(24%, 150px); }
  .gpc-title { font-size: 17px; }
  .gpc-meta { font-size: 12.5px; }
}
/* LANDSCAPE fullscreen: the Exit lives OUTSIDE the game in a narrow LEFT rail,
   as a vertical tab (CrazyGames-style) — a top strip would eat game height,
   and floating over the game it covered in-game UI. The game area starts after
   the rail (both fill and fs=2 letterbox sizing account for it). */
@media (orientation: landscape) {
  body.game-fs .player { padding-left: calc(38px + env(safe-area-inset-left)); }
  body.game-fs #game-wrapper {
    width: calc(100vw - 38px - env(safe-area-inset-left)) !important;
    height: 100dvh !important;
  }
  body.game-fs .player[data-fs="2"] #game-wrapper {
    width: min(calc(100vw - 38px - env(safe-area-inset-left)), calc(100dvh * var(--gw, 16) / var(--gh, 9))) !important;
    height: min(100dvh, calc((100vw - 38px - env(safe-area-inset-left)) * var(--gh, 9) / var(--gw, 16))) !important;
  }
  body.game-fs .game-exit-bar {
    top: calc(10px + env(safe-area-inset-top));
    left: env(safe-area-inset-left);
  }
  body.game-fs .game-exit-btn {
    writing-mode: vertical-rl;
    /* Flipped 180°: the label reads bottom-to-top (like CrazyGames) and the
       FLAT side faces the game — the rounded corners face the screen edge. */
    transform: rotate(180deg);
    width: 34px; height: auto; min-height: 92px;
    padding: 12px 0; gap: 7px; justify-content: center;
    border-radius: 0 13px 13px 0;   /* visually flat-right (game side) after the flip */
  }
  body.game-fs .game-exit-btn svg { transform: none; }   /* parent flip points the arrow LEFT = out */
  body.game-fs .game-exit-btn:active { transform: rotate(180deg) scale(.95); }
}

/* iOS/WebKit ONLY (@supports -webkit-touch-callout — Blink/Chrome skips this
   whole block): in the pseudo-fullscreen, 100dvh can extend under Safari's
   browser chrome in landscape, cutting the game's bottom (Safari-only report:
   Moto X3M). Use the JS-measured visualViewport height (--ivh, set by app10)
   instead — with 100dvh as fallback, so if the JS hasn't run NOTHING changes.
   Mirrors every fullscreen sizing rule above; touches nothing else. */
@supports (-webkit-touch-callout: none) {
  /* The fixed .player (inset:0) spans Safari's LAYOUT viewport, which extends
     under the browser chrome — flex-centering inside it pushed half the
     hidden surplus below the fold. Pin the player itself to the VISIBLE
     height, so centring happens within what the user can actually see. */
  body.game-fs .player { height: var(--ivh, 100dvh) !important; bottom: auto !important; }
  body.game-fs #game-wrapper { height: var(--ivh, 100dvh) !important; }
  body.game-fs .player[data-fs="2"] #game-wrapper {
    width: min(100vw, calc(var(--ivh, 100dvh) * var(--gw, 16) / var(--gh, 9))) !important;
    height: min(var(--ivh, 100dvh), calc(100vw * var(--gh, 9) / var(--gw, 16))) !important;
  }
  @media (orientation: portrait) {
    body.game-fs #game-wrapper {
      height: calc(var(--ivh, 100dvh) - 38px - env(safe-area-inset-top)) !important;
    }
    body.game-fs .player[data-fs="2"] #game-wrapper {
      width: min(100vw, calc((var(--ivh, 100dvh) - 38px - env(safe-area-inset-top)) * var(--gw, 16) / var(--gh, 9))) !important;
      height: min(calc(var(--ivh, 100dvh) - 38px - env(safe-area-inset-top)), calc(100vw * var(--gh, 9) / var(--gw, 16))) !important;
    }
  }
  @media (orientation: landscape) {
    body.game-fs #game-wrapper {
      width: calc(100vw - 38px - env(safe-area-inset-left)) !important;
      height: var(--ivh, 100dvh) !important;
    }
    body.game-fs .player[data-fs="2"] #game-wrapper {
      width: min(calc(100vw - 38px - env(safe-area-inset-left)), calc(var(--ivh, 100dvh) * var(--gw, 16) / var(--gh, 9))) !important;
      height: min(var(--ivh, 100dvh), calc((100vw - 38px - env(safe-area-inset-left)) * var(--gh, 9) / var(--gw, 16))) !important;
    }
  }
}

/* «Ανάφερε πρόβλημα» modal (game page) — posts to the engine's report.php. */
.gg-report {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(7, 4, 18, .68); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ggr-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--surface-2); border: 1px solid #ffffff1f; border-radius: 18px;
  padding: 18px; box-shadow: 0 30px 80px -20px #000;
}
.ggr-card h3 { color: var(--text); font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.ggr-x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  border: 0; border-radius: 10px; background: #ffffff14; color: var(--text);
  font-size: 13px; cursor: pointer;
}
.ggr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ggr-chips button {
  border: 1px solid #ffffff24; background: #ffffff0d; color: var(--text);
  font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.ggr-chips button.on { background: var(--accent); border-color: transparent; color: #fff; }
.ggr-card textarea {
  width: 100%; box-sizing: border-box; background: #00000030; color: var(--text);
  border: 1px solid #ffffff1f; border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 13.5px; resize: none; margin-bottom: 12px;
}
.ggr-card textarea::placeholder { color: var(--muted); }
.ggr-send {
  width: 100%; height: 42px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 800; cursor: pointer;
}
.ggr-send:disabled { opacity: .6; }
.ggr-done { color: var(--text); font-size: 14.5px; font-weight: 700; text-align: center; padding: 18px 6px; }

/* Game rating thumbs: highlight the chosen thumb (like=green, dislike=red),
   dim the other, and lock re-voting. Toggled by rank2() in game.php. */
.gb-vote { transition: transform .12s, opacity .15s; }
.gb-vote:not(.locked):active { transform: scale(.88); }
.gb-vote.locked { pointer-events: none; }
.gb-vote.voted { transform: scale(1.06); }
.gb-vote.locked:not(.voted) { opacity: .38; }
#gb-like.voted svg { fill: #4ade80; }
#gb-dislike.voted svg { fill: #ff6b6b; }

/* Fullscreen toggle button in the game bar: hidden on mobile (the play cover
   already handles fullscreen there); kept on desktop. */
@media (max-width: 1024px) { .gb-btn.fs { display: none; } }

/* Ad slots: drop the dashed "placeholder" box (from legacy-adapt, which loads
   after this file — so we override with `body .ad-slot`). The real ad still
   shows when it fills; an unfilled slot leaves no ugly placeholder. */
body .ad-slot { background: none; border: 0; min-height: 0; }

/* Home «Κατηγορίες» section title: hidden on responsive (the category tiles are
   self-explanatory there); kept on desktop. */
@media (max-width: 1024px) { .cat-tiles-section .section-head { display: none; } }

/* Ad slots start HIDDEN (zero space) on ALL viewports and app10.js reveals
   them only when a real ad has rendered — the user never sees an empty box,
   let alone one that collapses. (body prefix outranks legacy-adapt's .ad-slot
   which loads after this file.) */
body .ad-slot { display: none; }

/* Hide the horizontal scrollbar on all swipeable rails, on every viewport
   (desktop navigates with the arrows/drag; touch swipes). No grey bar anywhere. */
.rail, .top-grid { scrollbar-width: none; -ms-overflow-style: none; }
.rail::-webkit-scrollbar, .top-grid::-webkit-scrollbar { display: none; }

/* Notched phones in landscape: fill the safe-area with the theme colour (not the
   white html default) and keep header/content clear of the notch (viewport-fit=cover). */
html { background: var(--bg-mid); }
@media (max-width: 1024px) {
  .header { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .main   { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* Rotate-device hint for landscape games (engine orientation=2) held in portrait.
   Shown only in fullscreen when body has .needs-rotate (set by app.js). */
.game-rotate {
  position: fixed; inset: 0; z-index: 310;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 28px; background: #0b0620; color: #fff;
}
body.game-fs.needs-rotate .game-rotate { display: flex; }
.game-rotate-x {
  /* Below the portrait Exit strip (38px + safe-area) — it was hidden under it.
     The rotate overlay only ever shows in portrait, so this is always right. */
  position: absolute; top: calc(50px + env(safe-area-inset-top)); right: 14px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: #ffffff1a; color: #fff; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.game-rotate-x:active { background: #ffffff33; }
.game-rotate svg { width: 72px; height: 72px; fill: var(--accent-2); animation: gameRotateHint 2s ease-in-out infinite; }
@keyframes gameRotateHint { 0%, 50% { transform: rotate(0); } 78%, 100% { transform: rotate(-90deg); } }
.game-rotate strong { font-size: 18px; font-weight: 800; }
.game-rotate small { font-size: 13.5px; color: var(--muted); max-width: 250px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .game-rotate svg { animation: none; } }

/* ============================================================
   FAVOURITES — client-side (localStorage). Heart chip on every
   game tile + the client-rendered /favorite/ page.
   ============================================================ */
.card .thumb, .gll > a.li { position: relative; }

/* Heart sits TOP-LEFT so it never collides with the rating pill (.rdr, top-right). */
.fav-chip {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #120a2ecc; backdrop-filter: blur(5px);
  border: 1px solid #ffffff2e; box-shadow: 0 3px 10px -3px #000;
  cursor: pointer; opacity: 1; transition: transform .12s, opacity .15s;
}
.fav-chip svg { width: 18px; height: 18px; fill: #fff; opacity: .95; transition: transform .12s; }
.fav-chip.on svg { fill: #ff6b9e; opacity: 1; }
.fav-chip:hover { transform: scale(1.08); }
.fav-chip:active svg { transform: scale(1.28); }

/* Wide desktop with a hover pointer: keep tiles clean — reveal on hover (or if
   already favourited). Mobile/tablet (≤1024) and touch: always visible. */
@media (hover: hover) and (min-width: 1025px) {
  .fav-chip { opacity: 0; }
  .gll:hover .fav-chip, .card:hover .fav-chip, .fav-chip.on { opacity: 1; }
}

/* Favourites page (built by app.js on /favorite/). */
.fav-page-head { margin: 2px 0 14px; }
.fav-page-head h1 { font-size: 28px; font-weight: 900; letter-spacing: -.4px; color: var(--text); }
.fav-page-head .count { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 64px 24px; color: var(--muted);
}
.empty-state svg { width: 48px; height: 48px; fill: none; stroke: var(--muted); stroke-width: 1.7; margin-bottom: 4px; }
.empty-state h3 { color: var(--text); font-size: 18px; font-weight: 800; }
.empty-state p { font-size: 13.5px; max-width: 280px; line-height: 1.5; }
.empty-state .btn-more { margin-top: 10px; }
