/* ==============================================================================
   games.css — Portale games.agi-one.ai
   Stile ripreso dal portale News (agi-one-website/css/pages/news.css): fondo navy
   con gradiente radiale, titoli Outfit, testo Inter, card in vetro, testo a gradiente.
   Il restyle dedicato arriverà più avanti; fino ad allora questo file è autonomo
   (il portale ha la sua docroot e non dipende da agi-one-website/css/styles.css).
============================================================================== */

:root,
:root[data-games-theme="dark"] {
    --g-bg: #090b1a;
    --g-bg-grad: radial-gradient(circle at 50% 0%, #15193c 0%, #090b1a 65%, #05060e 100%);
    --g-nav-bg: rgba(9, 11, 26, 0.92);
    --g-card: rgba(15, 23, 42, 0.78);
    --g-card-solid: #0f172a;
    --g-border: rgba(255, 255, 255, 0.12);
    --g-border-soft: rgba(255, 255, 255, 0.08);
    --g-text: #ffffff;
    --g-secondary: #cbd5e1;
    --g-muted: #94a3b8;
    --g-footer: #070816;
    --g-indigo: #6366f1;
    --g-cyan: #06b6d4;
    --g-green: #10b981;
    --g-pink: #fb7185;
    --g-violet: #a855f7;
    --g-amber: #f59e0b;
    --g-gradient: linear-gradient(90deg, #818cf8 0%, #22d3ee 55%, #34d399 100%);
    --g-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --g-radius: 16px;
}

:root[data-games-theme="light"] {
    --g-bg: #f5f7ff;
    --g-bg-grad: radial-gradient(circle at 50% 0%, #e6e9ff 0%, #f5f7ff 60%, #ffffff 100%);
    --g-nav-bg: rgba(255, 255, 255, 0.92);
    --g-card: rgba(255, 255, 255, 0.92);
    --g-card-solid: #ffffff;
    --g-border: rgba(15, 23, 42, 0.12);
    --g-border-soft: rgba(15, 23, 42, 0.08);
    --g-text: #0f172a;
    --g-secondary: #334155;
    --g-muted: #475569;
    --g-footer: #eef1fb;
    --g-gradient: linear-gradient(90deg, #4f46e5 0%, #0891b2 55%, #059669 100%);
    --g-shadow: 0 14px 30px rgba(30, 41, 99, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--g-bg-grad), var(--g-bg);
    background-attachment: fixed;
    color: var(--g-text);
    font: 400 16px/1.6 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}
h1, h2, h3 { font-family: 'Outfit', 'Inter', sans-serif; font-weight: 800; line-height: 1.15; margin: 0; color: var(--g-text); }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--g-cyan); outline-offset: 2px; border-radius: 6px; }

.games-container { width: min(1240px, 100% - 40px); margin: 0 auto; }
.gradient-text { background: var(--g-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- barra */
.games-navbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--g-nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--g-border-soft);
}
.games-navbar__row { display: flex; align-items: center; gap: 24px; height: 68px; }
.games-logo { display: flex; align-items: center; gap: 10px; }
.games-logo__mark img { display: block; width: 40px; height: 40px; }
.games-logo__word {
    font: 800 28px 'Outfit', sans-serif; text-decoration: none; letter-spacing: 0.3px;
    background: var(--g-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.games-nav { display: flex; gap: 26px; list-style: none; margin: 0 auto; padding: 0; }
.games-nav__link { text-decoration: none; font-weight: 700; color: var(--g-secondary); }
.games-nav__link:hover { color: var(--g-text); }
.games-actions { display: flex; align-items: center; gap: 10px; }
.games-icon-btn {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: transparent; color: var(--g-text); border: 1px solid var(--g-border); font-size: 15px;
}
.games-icon-btn:hover { border-color: var(--g-indigo); }
.games-me {
    font: 600 14px 'Inter', 'Noto Color Emoji', sans-serif; padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--g-border); color: var(--g-secondary); white-space: nowrap;
}
.games-nav-toggle { display: none; }

/* ---------------------------------------------------------------- pulsanti, badge, chip */
.games-btn {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
    font: 700 16px 'Inter', sans-serif; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
    transition: transform .12s ease, box-shadow .12s ease;
}
.games-btn:hover { transform: translateY(-1px); }
.games-btn--primary { background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35); }
.games-btn--ghost { background: transparent; color: var(--g-text); border-color: var(--g-border); }
.games-btn--sm { font-size: 15px; padding: 9px 18px; }
.games-badge {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.6px;
    text-transform: uppercase; padding: 6px 14px; border-radius: 999px; color: var(--g-secondary);
    border: 1px solid rgba(99, 102, 241, 0.55); background: rgba(99, 102, 241, 0.12);
}
.games-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.games-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--g-border); color: var(--g-muted); }
.games-chip--live { color: #04241a; background: #34d399; border-color: transparent; }

/* ---------------------------------------------------------------- apertura */
.games-hero { padding: 64px 0 48px; }
.games-hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.games-hero h1 { font-size: clamp(40px, 6vw, 68px); margin: 18px 0 16px; }
.games-hero h1 .gradient-text { display: block; }
.games-hero__lead { font-size: 18px; color: var(--g-secondary); margin: 0 0 26px; max-width: 540px; }
.games-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.games-shot {
    margin: 0; position: relative; border-radius: 20px; overflow: hidden;
    border: 1px solid var(--g-border); box-shadow: var(--g-shadow);
}
.games-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.games-shot figcaption {
    position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border-radius: 10px;
    background: rgba(9, 11, 26, 0.82); color: #fff; font-size: 14px; font-weight: 700;
}

/* ---------------------------------------------------------------- blocchi */
.games-block { padding: 44px 0; }
.games-block__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.games-block__head h2 { font-size: clamp(26px, 3.4vw, 34px); }
.games-block__head span { color: var(--g-muted); font-size: 15px; }

/* ---------------------------------------------------------------- giochi */
.games-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; align-items: start; }
.game-card {
    display: flex; flex-direction: column; overflow: hidden; border-radius: var(--g-radius);
    background: var(--g-card); border: 1px solid var(--g-border); box-shadow: var(--g-shadow);
}
.game-card--main { border-color: rgba(99, 102, 241, 0.55); }
.game-card__img { display: block; }
.game-card__img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s ease; }
.game-card__img { overflow: hidden; }
.game-card__img:hover img { transform: scale(1.03); }
.game-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.game-card h3 { font-size: 26px; }
.game-card p { margin: 0; color: var(--g-secondary); }
.game-card .games-btn { align-self: flex-start; margin-top: auto; }
.game-card--soon { background: transparent; box-shadow: none; border-style: dashed; }
.game-card__placeholder {
    aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 46px; color: var(--g-muted);
    background: repeating-linear-gradient(135deg, transparent 0 12px, var(--g-border-soft) 12px 13px);
}

/* ---------------------------------------------------------------- sfide */
.games-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.games-mode--weekend { border-color: rgba(251, 113, 133, 0.55); }
.games-mode--weekend .games-mode__icon { color: var(--g-pink); }
.games-mode__ref { display: block; margin-top: 10px; font-size: 13px; color: var(--g-muted); }
.games-mode {
    position: relative; padding: 22px; border-radius: var(--g-radius);
    background: var(--g-card); border: 1px solid var(--g-border);
}
.games-mode--world { border-color: rgba(6, 182, 212, 0.55); }
.games-mode--daily { border-color: rgba(168, 85, 247, 0.55); }
.games-mode--cup { border-color: rgba(245, 158, 11, 0.55); }
.games-mode__icon { font-size: 28px; }
.games-mode--world .games-mode__icon { color: var(--g-cyan); }
.games-mode--daily .games-mode__icon { color: var(--g-violet); }
.games-mode--cup .games-mode__icon { color: var(--g-amber); }
.games-mode h3 { font-size: 22px; margin: 10px 0 6px; }
.games-mode p { margin: 0; color: var(--g-secondary); }
.games-mode__soon {
    position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px; background: rgba(99, 102, 241, 0.18); color: var(--g-secondary);
}
.games-steps { list-style: none; counter-reset: s; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.games-steps li {
    counter-increment: s; position: relative; padding: 16px 16px 16px 60px;
    border: 1px solid var(--g-border-soft); border-radius: 14px;
}
.games-steps li::before {
    content: counter(s); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font: 800 16px 'Outfit', sans-serif; color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
}
.games-steps b { display: block; }
.games-steps span { color: var(--g-muted); font-size: 14px; }

/* ---------------------------------------------------------------- campionato mondiale */
.games-cup {
    position: relative; overflow: hidden; padding: 34px; border-radius: 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.12) 55%, rgba(245, 158, 11, 0.16));
    border: 1px solid rgba(245, 158, 11, 0.55); box-shadow: var(--g-shadow);
}
.games-cup__top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.games-cup h2 { font-size: clamp(28px, 4vw, 42px); }
.games-cup__when {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-weight: 800;
    background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.6); color: var(--g-text);
}
.games-cup__lead { color: var(--g-secondary); max-width: 760px; margin: 12px 0 22px; font-size: 17px; }
.games-cup__phases { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.games-cup__phases li { padding: 18px; border-radius: 14px; background: var(--g-card); border: 1px solid var(--g-border); }
.games-cup__phases i { font-size: 22px; color: var(--g-amber); }
.games-cup__phases b { display: block; font: 800 19px 'Outfit', sans-serif; margin: 8px 0 4px; }
.games-cup__phases span { color: var(--g-secondary); font-size: 15px; }
.games-cup__foot { margin: 18px 0 0; color: var(--g-muted); font-size: 14px; }

/* ---------------------------------------------------------------- pagine legali */
.games-legal { padding: 40px 0 20px; }
.games-legal__wrap { max-width: 860px; }
.games-legal__head h1 { font-size: clamp(32px, 5vw, 46px); }
.games-legal__meta { color: var(--g-muted); margin: 8px 0 24px; }
.games-legal__prose { color: var(--g-secondary); }
.games-legal__prose h2 { font-size: 22px; margin: 30px 0 10px; }
.games-legal__prose a { color: var(--g-cyan); }
.games-legal__prose li { margin: 6px 0; }
.games-legal__prose b { color: var(--g-text); }
.games-legal__note { padding: 16px 20px; border-radius: 14px; background: var(--g-card); border: 1px solid rgba(99, 102, 241, 0.45); }
.games-legal__note p { margin: 6px 0; }

/* ---------------------------------------------------------------- pagina 404 */
.games-404 { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.games-404 h1 { font-size: clamp(48px, 9vw, 96px); }
.games-404 p { color: var(--g-secondary); margin: 10px 0 24px; }

/* ---------------------------------------------------------------- classifiche e profilo */
.games-boards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.games-panel { padding: 22px; border-radius: var(--g-radius); background: var(--g-card); border: 1px solid var(--g-border); }
.games-panel h3 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.games-empty {
    display: grid; place-items: center; text-align: center; gap: 6px; min-height: 180px; padding: 20px;
    border: 1px dashed var(--g-border); border-radius: 14px; color: var(--g-muted);
}
.games-empty i { font-size: 30px; }
.games-empty b { color: var(--g-secondary); }
.games-profile { display: flex; align-items: center; gap: 16px; min-height: 120px; }
.games-profile__flag { font: 52px/1 'Noto Color Emoji', sans-serif; }
.games-profile__nick { font: 800 28px 'Outfit', sans-serif; }
.games-profile__where { color: var(--g-muted); }

/* ---------------------------------------------------------------- domande */
.games-faq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.games-faq details { padding: 14px 18px; border-radius: 14px; background: var(--g-card); border: 1px solid var(--g-border); }
.games-faq summary { cursor: pointer; font-weight: 700; }
.games-faq p { margin: 8px 0 0; color: var(--g-secondary); }
.games-faq a, .games-cup__foot a { color: var(--g-cyan); }

/* ---------------------------------------------------------------- footer */
.games-footer { margin-top: 40px; background: var(--g-footer); border-top: 1px solid var(--g-border-soft); color: var(--g-secondary); }
.games-footer__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; padding: 32px 0 18px; }
.games-footer__logo { font: 800 24px 'Outfit', sans-serif; color: var(--g-text); }
.games-footer__brand p { margin: 4px 0 0; }
.games-footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.games-footer__links a { text-decoration: none; color: var(--g-secondary); }
.games-footer__links a:hover { color: var(--g-text); }
.games-footer__bottom { border-top: 1px solid var(--g-border-soft); padding: 14px 0 26px; font-size: 14px; color: var(--g-muted); }
.games-footer__bottom p { margin: 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .games-hero__grid, .games-boards, .games-faq { grid-template-columns: 1fr; }
    .games-grid { grid-template-columns: 1fr 1fr; }
    .game-card--main { grid-column: 1 / -1; }
    .games-modes { grid-template-columns: 1fr 1fr; }
    .games-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .games-nav-toggle { display: grid; }
    .games-nav {
        display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0;
        background: var(--g-card-solid); border-bottom: 1px solid var(--g-border); box-shadow: var(--g-shadow); padding: 8px 20px 14px;
    }
    .games-nav.is-open { display: flex; }
    .games-nav__link { display: block; padding: 10px 0; }
    .games-actions { margin-left: auto; }
}
@media (max-width: 560px) {
    .games-container { width: calc(100% - 32px); }
    .games-grid, .games-steps, .games-modes, .games-cup__phases { grid-template-columns: 1fr; }
    .games-hero { padding-top: 36px; }
    .games-me { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
    .games-logo__word { font-size: 24px; }
    .games-cup { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .games-btn, .game-card__img img { transition: none; }
}
