/* Sala Giochi — lo stile dei giochi (vetro, pillole, Inter, titoli in pixel art, pioggia) con i colori di
   Adwaita chiaro e Adwaita scuro: neutro, così ogni gioco porta i suoi colori solo nella copertina. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Adwaita chiaro (predefinito) */
:root {
  --bg: #fafafa; --view: #ffffff; --fg: rgba(0, 0, 0, .8); --strong: #000; --dim: rgba(0, 0, 0, .55); --faint: rgba(0, 0, 0, .4);
  --glass: rgba(255, 255, 255, .74); --glass2: rgba(0, 0, 0, .06); --hover: rgba(0, 0, 0, .1); --line: rgba(0, 0, 0, .1);
  --field: rgba(0, 0, 0, .05); --field-focus: #fff;
  --accent: #1c71d8; --accent-hover: #1a5fb4; --accent2: #3584e4; --accent2-hover: #4a90e8;
  --yellow: #f6d32d; --red: #c01c28; --red-bg: rgba(224, 27, 36, .1);
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 10px 32px rgba(0, 0, 0, .08); --shadow-hi: 0 2px 6px rgba(0, 0, 0, .1), 0 18px 48px rgba(0, 0, 0, .14);
  --veil-top: rgba(250, 250, 250, .1); --veil-bot: rgba(250, 250, 250, .75); --text-shadow: none;
  --r: 20px; --wrap: 1200px;
  color-scheme: light;
}
/* Adwaita scuro: grigi, non nero */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="chiaro"]) {
    --bg: #242424; --view: #1e1e1e; --fg: #ffffff; --strong: #fff; --dim: rgba(255, 255, 255, .6); --faint: rgba(255, 255, 255, .42);
    --glass: rgba(48, 48, 48, .74); --glass2: rgba(255, 255, 255, .08); --hover: rgba(255, 255, 255, .14); --line: rgba(255, 255, 255, .1);
    --field: rgba(255, 255, 255, .08); --field-focus: rgba(255, 255, 255, .12);
    --accent: #78aeed; --accent-hover: #99c1f1; --accent2: #3584e4; --accent2-hover: #4a90e8;
    --red: #ff7b63; --red-bg: rgba(255, 123, 99, .12);
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .3); --shadow-hi: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .45);
    --veil-top: rgba(36, 36, 36, .1); --veil-bot: rgba(36, 36, 36, .7); --text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-tema="scuro"] {
  --bg: #242424; --view: #1e1e1e; --fg: #ffffff; --strong: #fff; --dim: rgba(255, 255, 255, .6); --faint: rgba(255, 255, 255, .42);
  --glass: rgba(48, 48, 48, .74); --glass2: rgba(255, 255, 255, .08); --hover: rgba(255, 255, 255, .14); --line: rgba(255, 255, 255, .1);
  --field: rgba(255, 255, 255, .08); --field-focus: rgba(255, 255, 255, .12);
  --accent: #78aeed; --accent-hover: #99c1f1; --accent2: #3584e4; --accent2-hover: #4a90e8;
  --red: #ff7b63; --red-bg: rgba(255, 123, 99, .12);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .3); --shadow-hi: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px rgba(0, 0, 0, .45);
  --veil-top: rgba(36, 36, 36, .1); --veil-bot: rgba(36, 36, 36, .7); --text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: transparent; /* il fondo è su html: così la città (z-index negativo) resta visibile */ color: var(--fg); font: 16px/1.6 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-skip { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 8px 16px; border-radius: 999px; background: var(--accent2); color: #fff; }
.sg-skip:focus { top: 12px; }

/* sfondo: città sotto la pioggia in grigi Adwaita (assets/site.js), con un velo verso il basso */
#sg-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; image-rendering: pixelated; image-rendering: crisp-edges; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, var(--veil-top), var(--veil-bot) 75%); }

.glass { background: var(--glass); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* pulsanti a pillola (Adwaita) */
.sg-btn, .gx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--fg); background: var(--glass2); border: 0; padding: 10px 20px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s; }
.sg-btn:hover, .gx-btn:hover { background: var(--hover); color: var(--fg); }
.sg-btn:active, .gx-btn:active { transform: scale(.97); }
.sg-primary, .gx-primary, .sg-primary:hover, .gx-primary:hover { color: #fff; }
.sg-primary, .gx-primary { background: var(--accent2); }
.sg-primary:hover, .gx-primary:hover { background: var(--accent2-hover); }
.sg-flat { background: transparent; }
.sg-big { padding: 13px 26px; font-size: 16px; }
.sg-icon { width: 40px; height: 40px; padding: 0; }
.sg-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* testo in pixel art (blu Adwaita): prima del disegno si vede il testo in Inter corsivo nero */
.sg-pixel { margin: 0; font-style: italic; font-weight: 900; letter-spacing: -.01em; text-transform: uppercase; line-height: 1;
  background: linear-gradient(180deg, #c4ddfa, #99c1f1 35%, #3584e4 70%, #1a5fb4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sg-pixel.on { background: none; color: inherit; }
.sg-pix { display: block; image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(53, 132, 228, .2)); }
.sg-pixel-s { font-size: 20px; }
.sg-pixel-s .sg-pix { width: calc(var(--pw) * 2px); filter: none; }
.sg-pixel-l { font-size: clamp(32px, 5vw, 56px); }
.sg-pixel-l .sg-pix { width: min(calc(var(--pw) * 3px), 92vw); margin-inline: auto; }
.sg-pixel-xl { font-size: clamp(44px, 9vw, 110px); }
.sg-pixel-xl .sg-pix { width: min(calc(var(--pw) * 4px), 860px, 94vw); margin-inline: auto; }

/* barra in alto (headerbar) */
.sg-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; padding: 12px 16px 0; }
.sg-bar { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 7px 8px 7px 18px; border-radius: 999px; }
.sg-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 40px; }
.sg-logo { width: 32px; height: 32px; border-radius: 8px; }
.sg-nav { flex: 1; min-width: 0; }
.sg-menu { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; flex-wrap: wrap; }
.sg-menu a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--fg); text-decoration: none; font-weight: 600; font-size: 15px; }
.sg-menu a:hover, .sg-menu .current-menu-item > a, .sg-menu .current_page_item > a { background: var(--glass2); }
.sg-user { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sg-who { color: var(--dim); font-size: 14px; padding: 0 6px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-scheme .sg-moon { display: none; }
:root[data-schema="scuro"] .sg-scheme .sg-sun { display: none; }
:root[data-schema="scuro"] .sg-scheme .sg-moon { display: block; }
@media (max-width: 640px) {
  .sg-bar { border-radius: 22px; padding: 8px 8px 8px 14px; }
  .sg-nav { order: 3; flex-basis: 100%; }
  .sg-menu a { padding: 6px 12px; }
}

/* contenuto */
.sg-main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 16px; padding-bottom: 40px; }
.sg-first { padding-top: clamp(28px, 6vh, 64px); }
.sg-hero { text-align: center; padding-block: clamp(56px, 14vh, 150px) clamp(28px, 6vh, 64px); }
.sg-hero-tag { margin: 20px auto 0; max-width: 40ch; color: var(--dim); font-style: italic; font-size: clamp(16px, 1.6vw, 20px); text-shadow: var(--text-shadow); }
.sg-section { margin-bottom: 48px; }
.sg-h2 { text-align: center; margin: 0 0 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 700; }
.sg-page-title { text-align: center; margin-bottom: 28px; }
.sg-empty { padding: 22px 26px; border-radius: var(--r); color: var(--dim); text-align: center; }

/* catalogo */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 400px)); justify-content: center; gap: 22px; }
.sg-card { border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s; }
.sg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hi); }
.sg-card-cover, .sg-game-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #1e1e1e; }
.sg-cover-gen, .sg-cover-img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; image-rendering: crisp-edges; }
.sg-play { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px 8px 14px; border-radius: 999px; background: rgba(30, 30, 30, .78); border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sg-play svg { width: 16px; height: 16px; fill: currentColor; }
.sg-card-cover:hover .sg-play, .sg-card-cover:focus-visible .sg-play, .sg-game-cover:hover .sg-play, .sg-game-cover:focus-visible .sg-play { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .sg-play { opacity: 1; transform: translate(-50%, 0); } }
.sg-tag { position: absolute; left: 12px; top: 12px; padding: 3px 10px; border-radius: 999px; background: var(--yellow); color: rgba(0, 0, 0, .8); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sg-tag-inline { position: static; display: inline-block; margin-bottom: 12px; }
.sg-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sg-card-body .sg-row { margin-top: auto; padding-top: 8px; }
.sg-card-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.sg-card-title a { color: var(--strong); text-decoration: none; }
.sg-card-title a:hover { color: var(--accent); }
.sg-sub { margin: 0; color: var(--dim); font-style: italic; }
.sg-excerpt { margin: 0; color: var(--fg); font-size: 15px; }

/* scheda del gioco */
.sg-game-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; margin-bottom: 36px; }
.sg-game-cover { border-radius: var(--r); }
.sg-game-info .sg-pixel-l .sg-pix { margin-inline: 0; }
.sg-game-info .sg-sub { margin-top: 14px; font-size: 18px; }
.sg-lead { margin: 14px 0 0; font-size: 17px; }
.sg-game-info .sg-row { margin-top: 22px; }
.sg-note { margin: 14px 0 0; color: var(--dim); font-size: 14px; }
@media (max-width: 860px) { .sg-game-head { grid-template-columns: 1fr; } .sg-game-info { text-align: center; } .sg-game-info .sg-pixel-l .sg-pix { margin-inline: auto; } .sg-game-info .sg-row { justify-content: center; } }

/* testi (pagine, descrizione dei giochi) */
.sg-prose { max-width: 820px; margin: 0 auto; padding: clamp(20px, 3vw, 30px) clamp(20px, 3.5vw, 36px); border-radius: var(--r); }
.sg-prose > :first-child { margin-top: 0; }
.sg-prose > :last-child { margin-bottom: 0; }
.sg-prose h2, .sg-prose h3 { color: var(--strong); line-height: 1.25; margin: 1.6em 0 .5em; }
.sg-prose h2 { font-size: 24px; }
.sg-prose h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.sg-prose b, .sg-prose strong { color: var(--strong); font-weight: 700; }
.sg-prose ul { padding-left: 1.2em; }
.sg-prose li { margin: .3em 0; }
.sg-prose blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 3px solid var(--accent2); color: var(--dim); font-style: italic; }
.sg-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.sg-post { margin-bottom: 20px; }
.sg-post h2 { margin: 0; }
.sg-post h2 a { color: var(--strong); text-decoration: none; }
.sg-meta { color: var(--dim); font-size: 14px; margin: 4px 0 12px; }
.sg-404 { text-align: center; padding-block: 12vh; }

/* accesso e registrazione ([giochi_accesso]) */
.sg-page-auth .sg-prose { max-width: 460px; }
.gx-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass2); margin-bottom: 20px; }
.gx-tabs button { flex: 1; font: inherit; font-weight: 600; font-size: 15px; color: var(--dim); background: transparent; border: 0; padding: 9px 12px; border-radius: 999px; cursor: pointer; }
.gx-tabs button[aria-selected="true"] { background: var(--view); color: var(--strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.gx-auth[data-tab="accedi"] .gx-form[data-p="registrati"], .gx-auth[data-tab="registrati"] .gx-form[data-p="accedi"] { display: none; }
.gx-form { display: flex; flex-direction: column; gap: 14px; }
.gx-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.gx-form input:not([type="checkbox"]), .sg-login input[type="text"], .sg-login input[type="password"], .sg-login input[type="email"] {
  font: inherit; font-size: 16px; font-weight: 500; color: var(--fg); background: var(--field); border: 1px solid transparent; border-radius: 12px; padding: 11px 14px; width: 100%; transition: border-color .15s, background .15s; }
.gx-form input:focus, .sg-login input:focus { outline: none; border-color: var(--accent2); background: var(--field-focus); box-shadow: 0 0 0 3px rgba(53, 132, 228, .25); }
.gx-form .gx-check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.gx-check input { width: 18px; height: 18px; accent-color: var(--accent2); }
.gx-form .gx-btn { margin-top: 4px; padding: 13px 20px; font-size: 16px; }
.gx-opt { font-weight: 400; color: var(--dim); }
.gx-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(53, 132, 228, .1); font-size: 14px; }
.gx-note b { color: var(--accent); }
.gx-err { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-size: 14px; font-weight: 600; }
.gx-small { margin: 0; text-align: center; font-size: 14px; }
.gx-trap { position: absolute !important; left: -9999px; }
.gx-in { text-align: center; }
.gx-in .gx-row, .gx-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* piè di pagina */
.sg-foot { text-align: center; color: var(--faint); font-size: 13px; padding: 24px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.sg-foot p { margin: 0; }

/* pagina di WordPress per il recupero della password (wp-login.php) */
html:has(body.sg-login) { background: var(--bg); }
body.sg-login { background: transparent; display: block; }
.sg-login #login { width: min(400px, calc(100vw - 32px)); padding: 8vh 0 0; }
.sg-login #login h1 a { background: none; width: auto; height: auto; text-indent: 0; font-size: 34px; overflow: visible; margin-bottom: 20px; }
.sg-login form { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--fg); padding: 24px; }
.sg-login label { color: var(--fg); font-weight: 600; }
.sg-login .button-primary { background: var(--accent2) !important; border: 0 !important; border-radius: 999px !important; padding: 4px 22px !important; font-weight: 600; text-shadow: none; box-shadow: none; }
.sg-login .message, .sg-login .notice, .sg-login #login_error { background: var(--glass); color: var(--fg); border-radius: 12px; border-left-color: var(--accent2); box-shadow: var(--shadow); }
.sg-login #nav a, .sg-login #backtoblog a, .sg-login .privacy-policy-page-link a { color: var(--dim) !important; }
.sg-login .language-switcher { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
