/* Marquitos Games — folha de estilos do site.
 *
 * As cores são todas tokens definidos três vezes: no :root (claro, a base), no
 * @media (prefers-color-scheme: dark) restringido a :root:not([data-theme="light"])
 * e em :root[data-theme="dark"] — o mesmo esquema da Marquitos Arcade. Uma cor nova
 * entra nos três sítios, senão a escolha explícita do utilizador deixa de ganhar.
 *
 * Cada jogo pinta as suas páginas com --accent, --accent-ink, --hero-from e --hero-to
 * (ver GameTheme no catálogo); fora delas valem as cores do estúdio, abaixo.
 */

:root {
    --bg: #f4f1ea;
    --bg-glow-1: rgba(106, 91, 246, 0.16);
    --bg-glow-2: rgba(242, 193, 78, 0.18);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --border: rgba(30, 26, 20, 0.1);
    --text: #1e1a14;
    --muted: #625b50;
    --link: #4b3ad6;
    --shadow: 0 10px 30px rgba(30, 26, 20, 0.08);
    --topbar-bg: rgba(244, 241, 234, 0.82);

    --accent: #6a5bf6;
    --accent-ink: #ffffff;
    --hero-from: #6a5bf6;
    --hero-to: #b06af6;

    --radius: 18px;
    --max: 1040px;
    --prose: 720px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #11131a;
        --bg-glow-1: rgba(106, 91, 246, 0.2);
        --bg-glow-2: rgba(242, 193, 78, 0.1);
        --surface: rgba(30, 33, 44, 0.72);
        --surface-strong: #1b1e28;
        --border: rgba(255, 255, 255, 0.1);
        --text: #f1eee8;
        --muted: #a9a398;
        --link: #a99ffc;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
        --topbar-bg: rgba(17, 19, 26, 0.82);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #11131a;
    --bg-glow-1: rgba(106, 91, 246, 0.2);
    --bg-glow-2: rgba(242, 193, 78, 0.1);
    --surface: rgba(30, 33, 44, 0.72);
    --surface-strong: #1b1e28;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f1eee8;
    --muted: #a9a398;
    --link: #a99ffc;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --topbar-bg: rgba(17, 19, 26, 0.82);
    color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 500px at 10% -10%, var(--bg-glow-1), transparent 70%),
        radial-gradient(800px 500px at 100% 0%, var(--bg-glow-2), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
    flex: 1;
    width: 100%;
}

a {
    color: var(--link);
    text-underline-offset: 3px;
}

h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin: 0 0 0.4em;
}

h2 {
    font-size: 1.45rem;
    margin: 1.8em 0 0.6em;
}

h3 {
    font-size: 1.1rem;
    margin: 0 0 0.4em;
}

img {
    max-width: 100%;
}

.muted {
    color: var(--muted);
}

.center {
    text-align: center;
}

.lead {
    font-size: 1.15rem;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 16px;
    top: 12px;
    z-index: 100;
    padding: 8px 14px;
    background: var(--surface-strong);
    border-radius: 10px;
}

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

/* ---------- Barra de topo ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--topbar-bg);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}

.topbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.topbar-links a:hover,
.topbar-links a.active {
    color: var(--text);
    background: var(--surface);
}

.topbar-links .lang-switch {
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface);
}

.theme-icon {
    width: 20px;
    height: 20px;
    display: none;
}

:root:not([data-theme]) .theme-icon-auto,
:root[data-theme="light"] .theme-icon-light,
:root[data-theme="dark"] .theme-icon-dark {
    display: block;
}

@media (max-width: 560px) {
    .brand span {
        display: none;
    }

    .topbar-inner {
        gap: 6px;
    }

    .topbar-links {
        gap: 0;
    }

    .topbar-links a {
        padding: 6px 7px;
        font-size: 0.9rem;
    }
}

@media (max-width: 359px) {
    .topbar-inner {
        padding-left: 10px;
        padding-right: 10px;
    }

    .topbar-links a {
        padding: 6px 4px;
        font-size: 0.82rem;
    }

    .theme-toggle {
        width: 30px;
    }
}

/* ---------- Secções e painéis ---------- */

.intro,
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 16px;
}

.intro {
    padding-top: 56px;
    padding-bottom: 12px;
    text-align: center;
}

.intro .lead {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted);
}

.section {
    margin-top: 40px;
}

.prose {
    max-width: calc(var(--prose) + 32px);
}

.page {
    padding-top: 48px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 22px;
}

.panel h2 {
    margin-top: 0;
}

.panel-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.panel-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.panel-link:hover {
    transform: translateY(-2px);
}

.panel-link p {
    color: var(--muted);
    margin: 0;
}

.button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
}

.button:hover {
    filter: brightness(1.05);
}

.chip {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------- Página inicial: cartões dos jogos ---------- */

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
    gap: 16px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border-top: 4px solid var(--accent);
}

.game-card-link {
    display: flex;
    gap: 18px;
    padding: 20px 22px 8px;
    color: inherit;
    text-decoration: none;
}

.game-card-link img {
    flex: none;
    border-radius: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.game-card h3 {
    font-size: 1.35rem;
    margin: 0;
}

.game-card p {
    margin: 0.2em 0;
}

.game-card-tagline,
.game-card-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.game-card-links {
    display: flex;
    gap: 16px;
    padding: 0 22px 16px 136px;
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .game-card-link {
        flex-direction: column;
    }

    .game-card-links {
        padding-left: 22px;
    }
}

/* ---------- Páginas de um jogo ---------- */

.game-hero {
    background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
    color: #fff;
}

.game-hero-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 48px 16px 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.game-icon {
    flex: none;
    width: 128px;
    height: 128px;
    border-radius: 28px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.game-hero h1,
.game-hero-name {
    margin: 0;
    font: 700 clamp(2.1rem, 6vw, 3rem) / 1.1 ui-serif, Georgia, "Times New Roman", serif;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.game-hero-name a {
    color: inherit;
    text-decoration: none;
}

.game-tagline {
    margin: 4px 0 16px;
    font-weight: 600;
    opacity: 0.92;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.app-store-badge {
    display: inline-block;
    line-height: 0;
    border-radius: 8px;
}

.app-store-badge img {
    display: block;
    height: auto;
}

/* Badge que segue o tema: as duas cores vão no HTML e o CSS mostra uma (ver StoreButton). */
.badge-on-dark,
:root[data-theme="dark"] .badge-on-light {
    display: none !important;
}

:root[data-theme="dark"] .badge-on-dark {
    display: block !important;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .badge-on-light {
        display: none !important;
    }

    :root:not([data-theme="light"]) .badge-on-dark {
        display: block !important;
    }
}

.game-card-store {
    padding: 0 22px 12px 136px;
}

@media (max-width: 480px) {
    .game-card-store {
        padding-left: 22px;
    }
}

.store-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 12px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.1;
}

.store-button small {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
}

.store-button.is-soon {
    background: rgba(0, 0, 0, 0.45);
    border: 1px dashed rgba(255, 255, 255, 0.6);
}

.game-tabs {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.game-tabs a {
    padding: 10px 16px;
    border-radius: 12px 12px 0 0;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.18);
}

.game-tabs a:hover {
    background: rgba(0, 0, 0, 0.28);
}

.game-tabs a[aria-current="page"] {
    background: var(--bg);
    color: var(--text);
}

@media (max-width: 560px) {
    .game-hero-inner {
        flex-direction: column;
        text-align: center;
        padding-top: 32px;
    }

    .game-icon {
        width: 104px;
        height: 104px;
        border-radius: 24px;
    }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.feature p {
    margin: 0;
    color: var(--muted);
}

.feature-emoji {
    display: block;
    font-size: 1.9rem;
    margin-bottom: 6px;
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px 24px;
    margin: 0;
}

.facts dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.facts dd {
    margin: 0;
    font-weight: 600;
}

/* ---------- Suporte e privacidade ---------- */

.callout {
    margin: 24px 0 8px;
    border-left: 5px solid var(--accent);
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 0 18px;
}

.faq summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 600;
}

.faq details p {
    margin: 0 0 16px;
    color: var(--muted);
}

.privacy-label {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--accent);
}

.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.link-list img {
    border-radius: 10px;
}

/* ---------- Rodapé ---------- */

.footer {
    margin-top: 72px;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 20px 16px 28px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .panel-link {
        transition: none;
    }
}
