/*
Theme Name: FG Arcade
Theme URI: https://free-games.gr/
Author: free-games.gr
Description: Greek, mobile-first game portal theme for free-games.gr. Reads MyArcade game data and keeps the old theme's ad placements.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: fg-arcade
*/

:root {
	--ground: #D7EAFE;
	--ink: #102A5C;
	--ink-soft: #3F5480;
	--blue: #0A5BD8;
	--blue-dark: #06419C;
	--blue-tint: #EAF3FF;
	--line: #CFE1FA;
	--yellow: #FFC21A;
	--card: #FFFFFF;
	--shadow: 0 6px 14px rgba(16, 42, 92, .16);
	--shadow-up: 0 14px 26px rgba(16, 42, 92, .24);
	--cell: 104px;
	--gap: 12px;
	--radius: 16px;
	--ease: cubic-bezier(.16, 1, .3, 1);
	--ui: 'M PLUS Rounded 1c', 'Noto Sans', system-ui, sans-serif;
	--text: 'Noto Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 500 16px/1.5 var(--ui); scrollbar-color: #9DBCE8 var(--ground); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
::selection { background: #FFD23F; color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 12px; }
h1, h2, h3 { font-family: var(--ui); font-weight: 800; line-height: 1.15; margin: 0; text-wrap: balance; }
button, input { font: inherit; color: inherit; }

.fg-skip { position: absolute; left: -9999px; top: 8px; z-index: 99; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.fg-skip:focus { left: 8px; }

.fg-page { padding: 16px 12px 0; min-height: 100vh; display: flex; flex-direction: column; }
.fg-wrap { width: 100%; max-width: 1160px; margin: 0 auto; }
main.fg-wrap { display: flex; flex-direction: column; gap: 28px; flex: 1; }

/* ---------- The grid every page is built on ---------- */
.fg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, var(--cell));
	grid-auto-rows: var(--cell);
	gap: var(--gap);
	justify-content: center;
	grid-auto-flow: row dense;
}
.fg-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Logo card */
.fg-logo-card { grid-column: span 2; padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; }
.fg-logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -0.4px; line-height: 1; }
.fg-logo:hover { color: var(--ink); }
.fg-logo-tools { display: flex; gap: 8px; }
.fg-iconbtn { width: 44px; height: 36px; border-radius: 10px; background: var(--blue-tint); color: var(--blue); display: flex; align-items: center; justify-content: center; transition: background .2s ease-out; }
.fg-iconbtn:hover { background: #D6E7FF; }

/* Search card */
.fg-search { grid-column: span 4; padding: 14px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.fg-search label { font-weight: 700; font-size: 14px; }
.fg-search-row { display: flex; gap: 8px; }
.fg-search input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; background: #F5F9FF; font-size: 16px; }
.fg-search input::placeholder { color: #5E729A; }
.fg-search input:focus { outline: none; border-color: var(--blue); background: #fff; }
.fg-search button { width: 48px; height: 44px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fg-search button:hover { background: var(--blue-dark); }

/* Homepage H1 card */
.fg-intro { grid-column: span 4; background: var(--ink); color: #fff; padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.fg-intro h1 { font-size: 20px; line-height: 1.2; }
.fg-intro p { margin: 0; font-size: 14px; line-height: 1.45; color: #C9D8F2; }

/* Game tiles */
.fg-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.fg-tile--big { grid-column: span 2; grid-row: span 2; }
.fg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fg-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(to top, rgba(10, 22, 52, .88), rgba(10, 22, 52, 0)); color: #fff; font: 700 13px/1.25 var(--ui); opacity: 0; transition: opacity .25s ease-out; }
.fg-tile:hover, .fg-tile:focus-visible { transform: translateY(-4px) scale(1.04); box-shadow: var(--shadow-up); z-index: 2; }
.fg-tile:hover .fg-cap, .fg-tile:focus-visible .fg-cap { opacity: 1; }
@media (hover: none) { .fg-tile--big .fg-cap { opacity: 1; } }

/* Hub band */
.fg-band { grid-column: 1 / -1; grid-row: span 2; background: var(--hub, var(--ink)); color: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; overflow: hidden; }
.fg-band-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fg-band h1 { font-size: 32px; line-height: 1.12; }
.fg-band-page { font-size: 16px; font-weight: 700; opacity: .85; }
.fg-band-intro { margin: 0; font-family: var(--text); font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .92); max-width: 70ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fg-band-intro p { margin: 0; }
.fg-band-intro a, .fg-band-intro strong { color: #fff; }
.fg-band .fg-crumbs, .fg-band .fg-crumbs a { color: rgba(255, 255, 255, .9); }
.fg-sort { display: flex; flex-wrap: wrap; gap: 8px; }
.fg-sort a { height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .55); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.fg-sort a:hover { border-color: #fff; }
.fg-sort a[aria-current] { background: #fff; color: var(--ink); border-color: #fff; }

/* Breadcrumbs */
.fg-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.fg-crumbs a { font-weight: 700; text-decoration: none; }

/* Category tiles */
.fg-grid--cats { grid-auto-rows: 64px; }
.fg-cat { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 0 14px; border-radius: 14px; background: var(--hub, var(--blue)); color: #fff; text-decoration: none; box-shadow: var(--shadow); transition: transform .35s var(--ease); min-height: 64px; }
.fg-cat:hover { color: #fff; transform: translateY(-3px); }
.fg-cat-txt { display: flex; flex-direction: column; min-width: 0; }
.fg-cat-name { font-weight: 800; font-size: 15px; line-height: 1.15; }
.fg-cat-n { font-weight: 500; font-size: 12px; opacity: .92; }
.fg-cat img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }

/* Sections and text */
.fg-section { display: flex; flex-direction: column; gap: 14px; }
.fg-section-h { font-size: 24px; text-align: center; }
.fg-text { background: var(--card); border-radius: 20px; box-shadow: 0 6px 14px rgba(16, 42, 92, .12); padding: 28px; font-family: var(--text); font-weight: 400; font-size: 15px; line-height: 1.7; }
.fg-text--split { display: flex; flex-wrap: wrap; gap: 32px; }
.fg-text--split > .fg-prose { flex: 2 1 420px; min-width: 0; }
.fg-prose { max-width: 70ch; }
.fg-prose--center { margin: 0 auto; }
.fg-prose h1 { font-size: 30px; margin-bottom: 12px; }
.fg-prose h2 { font-size: 21px; margin: 22px 0 8px; }
.fg-prose h2:first-child { margin-top: 0; }
.fg-prose p { margin: 0 0 12px; }
.fg-prose strong { font-weight: 600; }
.fg-faq, .fg-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fg-faq h2, .fg-side h2 { font-size: 18px; margin-bottom: 8px; }
.fg-faq details { border-bottom: 1px solid #E1EAF7; padding: 6px 0 10px; }
.fg-faq details:last-child { border-bottom: 0; }
.fg-faq summary { font-family: var(--ui); font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.fg-faq p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }
.fg-side .fg-cat { min-height: 64px; }

/* Empty result */
.fg-empty { grid-column: 1 / -1; grid-row: span 2; padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.fg-empty h2 { font-size: 22px; }
.fg-empty p { margin: 0; font-family: var(--text); }

/* Pagination */
.fg-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fg-pages a, .fg-pages span { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 22px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 800; box-shadow: var(--shadow); }
.fg-pages a:hover { background: var(--blue-tint); }
.fg-pages .current { background: var(--ink); color: #fff; }
.fg-pages .dots { background: none; box-shadow: none; }

/* ---------- Game page ---------- */
.fg-player { grid-column: 2 / span 8; grid-row: 2 / span 5; border-radius: 20px; overflow: hidden; background: #0B1A3A; box-shadow: 0 10px 24px rgba(16, 42, 92, .22); display: flex; }
.fg-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #0B1A3A; }
.fg-stage-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; filter: blur(28px) saturate(1.2); opacity: .55; }
.fg-cover { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px; }
.fg-cover-img { width: 168px; height: 168px; border-radius: 24px; object-fit: cover; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.fg-cover-note { color: #E2EBFB; font-size: 14px; }
.fg-cta { height: 60px; white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; padding: 0 36px; border-radius: 30px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; box-shadow: 0 8px 20px rgba(10, 91, 216, .35); transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .2s ease-out; }
.fg-cta:hover { color: #fff; background: #0B66F0; transform: scale(1.05); box-shadow: 0 12px 28px rgba(10, 91, 216, .45); }
.fg-game { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000; }
.fg-game iframe, .fg-game object, .fg-game embed, .fg-game canvas { display: block; width: 100% !important; height: 100% !important; max-width: 100%; border: 0; }
.fg-game > div, .fg-game #myarcade_game { width: 100%; height: 100%; }
.fg-stage:fullscreen { background: #000; }
.fg-bar { grid-column: 2 / span 8; grid-row: 7 / span 1; padding: 10px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.fg-bar-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fg-bar h1 { font-size: 22px; line-height: 1.15; }
.fg-bar-tools { display: flex; gap: 8px; }
.fg-btn { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.fg-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Rating widget from FG Ratings, restyled */
.fg-bar .fgr { margin: 0; font-family: var(--ui); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.fg-bar .fgr-title { font-weight: 700; color: var(--ink-soft); margin: 0; }
.fg-bar .fgr-star { font-size: 20px; padding: 0 1px; color: #C5D3EA; min-width: 24px; min-height: 28px; }
.fg-bar .fgr-star.on, .fg-bar .fgr-stars:hover .fgr-star { color: #E8A400; }
.fg-bar .fgr-stars .fgr-star:hover ~ .fgr-star { color: #C5D3EA; }
.fg-bar .fgr-label { color: var(--ink-soft); font-size: 13px; margin: 0; }

/* ---------- Ads (old theme placements) ---------- */
.fg-ad { position: relative; display: none; align-items: center; justify-content: center; overflow: hidden; }
.fg-ad.is-filled { display: flex; }
.fg-ad-label { position: absolute; top: 4px; left: 10px; font-size: 11px; color: var(--ink-soft); }
.fg-ad--tile2 { grid-column: span 2; grid-row: span 2; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding-top: 12px; }
.fg-ad--tile3 { grid-column: span 3; grid-row: span 3; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding-top: 12px; }
.fg-ad--wide { min-height: 90px; padding-top: 14px; }
.fg-ad--row { grid-column: 1 / -1; }
.fg-ad-row { margin-bottom: 12px; }
@media (max-width: 760px) { .fg-ad--wide, .fg-ad--wide.is-filled { display: none; } }

/* ---------- Footer ---------- */
.fg-footer { margin: 36px -12px 0; background: var(--ink); color: #C9D8F2; font-size: 14px; }
.fg-footer-in { padding: 26px 12px; display: flex; flex-direction: column; gap: 20px; }
.fg-footer-hubs { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fg-footer a { color: #fff; text-decoration: none; }
.fg-footer a:hover { color: #FFD23F; }
.fg-footer-bottom { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 18px; }
.fg-footer-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.fg-footer-menu, .fg-footer-menu ul { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; list-style: none; }

/* Comments */
.fg-comment-list { padding-left: 20px; }
.fg-comments input[type="text"], .fg-comments input[type="email"], .fg-comments textarea { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fg-comments .submit { height: 44px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 800; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.fg-player { grid-column: 1 / -1; grid-row: auto / span 5; }
	.fg-bar { grid-column: 1 / -1; grid-row: auto / span 1; }
}
@media (max-width: 700px) {
	:root { --cell: 96px; --gap: 10px; }
	.fg-page { padding-top: 10px; }
	.fg-logo-card, .fg-search, .fg-intro { grid-column: 1 / -1; }
	.fg-band { grid-row: auto / span 3; padding: 16px 18px; }
	.fg-band h1 { font-size: 26px; }
	.fg-player { grid-row: auto / span 4; }
	.fg-bar { grid-row: auto / span 2; }
	.fg-bar h1 { font-size: 20px; }
	.fg-text { padding: 22px 18px; }
}
@media (max-width: 420px) {
	/* 3 columns; the extra 16px leaves room for a scrollbar where one takes space */
	:root { --cell: calc((100vw - 24px - 20px - 16px) / 3); }
	.fg-intro { padding: 12px 16px; }
	.fg-intro p { display: none; }
	.fg-cta { height: 52px; padding: 0 24px; font-size: 18px; }
	.fg-grid--cats .fg-cat { grid-column: 1 / -1; }
	.fg-tile--big { grid-column: span 2; grid-row: span 2; }
	.fg-ad--tile3 { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
