/* Web pública de Plataforma: tema oscuro tipo tienda de juegos, sin frameworks y sin fuentes externas (la CSP solo permite 'self'). */

:root {
    color-scheme: dark;
    --bg: #0b0e14;
    --bg-soft: #10141d;
    --surface: #151b27;
    --surface-2: #1b2331;
    --border: #263044;
    --text: #e8ecf4;
    --muted: #9aa6bd;
    --accent: #7c5cff;
    --accent-2: #22d3a6;
    --accent-hover: #9378ff;
    --warn-bg: #2a2110;
    --warn-border: #7a5c1c;
    --warn-text: #ffe3a8;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --container: 1180px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.14), transparent 60%), var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: #b7a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.35rem, 1.2vw + 1rem, 1.8rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.container { width: min(var(--container), 100% - 2rem); margin-inline: auto; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; }
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.section { padding-block: 3rem; }

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--accent); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

/* Cabecera */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 14, 20, 0.82); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 9px; }
.main-nav { display: flex; gap: 1.25rem; margin-right: auto; }
.main-nav a { color: var(--muted); font-weight: 600; padding: 0.4rem 0.2rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.2rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: #3a4a68; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #5b8cff); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #6f9aff); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.1rem; }
.account-link { font-size: 0.92rem; }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade {
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(11, 14, 20, 0.92) 0%, rgba(11, 14, 20, 0.55) 55%, rgba(11, 14, 20, 0.2) 100%),
                linear-gradient(0deg, var(--bg) 0%, transparent 40%);
}
.hero-inner { padding-block: clamp(3rem, 8vw, 6.5rem); min-height: clamp(320px, 48vw, 520px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero-game .hero-inner { min-height: clamp(360px, 52vw, 560px); }
.hero-title { max-width: 18ch; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5); }
.hero-text { max-width: 56ch; color: #cdd5e5; font-size: 1.1rem; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.hero-logo { max-width: min(420px, 70vw); max-height: 140px; width: auto; height: auto; margin-bottom: 1rem; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6)); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; margin-top: 0.6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 800; color: var(--accent-2); margin-bottom: 0.8rem; }

.btn-play { min-width: 190px; }
.play-icon { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }

/* Rejilla de juegos */
.section-head { margin-bottom: 1.5rem; }
.section-head p { margin: 0; }
.game-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.game-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.game-card:hover, .game-card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #3d4d6c; }
.game-card-link { display: block; color: inherit; height: 100%; }
.game-card-link:hover { text-decoration: none; }
.game-cover { aspect-ratio: 2 / 3; background: linear-gradient(160deg, #1d2740, #131a2a); display: grid; place-items: center; overflow: hidden; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-cover-empty { font-size: 4rem; font-weight: 800; color: #3d4d6c; }
.game-card-body { padding: 0.85rem 1rem 1.1rem; }
.game-card-title { margin: 0 0 0.3rem; font-size: 1.05rem; }
.game-card-desc { margin: 0; color: var(--muted); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.notice { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; color: var(--muted); }
.notice-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.notice p { margin: 0.4rem 0 0; }

/* Página de un juego */
.game-layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); padding-block: 2.5rem 4rem; }
@media (min-width: 960px) { .game-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.game-section { margin-bottom: 2.5rem; }
.trailer { margin: 0 0 1.25rem; }
.trailer video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); border: 1px solid var(--border); }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gallery a { display: block; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.25s ease; }
.gallery a:hover img { transform: scale(1.04); }
.game-aside { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.facts { margin: 0 0 1rem; display: grid; gap: 0.8rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.aside-title { font-size: 1rem; margin-top: 1.4rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.85rem; }
.requirements section { margin-bottom: 1rem; }
.requirements h3 { color: var(--accent-2); margin-bottom: 0.3rem; }
.req-text { white-space: pre-line; color: #cdd5e5; margin: 0; font-size: 0.93rem; }

.prose { color: #d6ddec; max-width: 75ch; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.6em; }
.prose h1 { font-size: 1.7rem; }
.prose h2 { font-size: 1.4rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.3rem; }
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--surface-2); }
.prose code { background: var(--surface-2); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding: 0.2rem 1rem; color: var(--muted); }

/* Panel "¿No tienes el launcher?" */
.launcher-panel { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(4px); }
.launcher-panel-card { background: var(--surface); border: 1px solid #3a4a68; border-radius: var(--radius); padding: 1.8rem; max-width: 460px; box-shadow: var(--shadow); }
.launcher-panel-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }

/* Descargar */
.download-card { background: linear-gradient(145deg, #1a2236, #141a29); border: 1px solid var(--border); border-radius: calc(var(--radius) + 6px); padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 2.5rem; box-shadow: var(--shadow); }
.download-meta { display: flex; gap: 1.2rem; color: var(--muted); margin: 1rem 0 0; }
.download-columns { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding-left: 1.7rem; position: relative; margin-bottom: 0.6rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9rem; height: 0.5rem; border-left: 2px solid var(--accent-2); border-bottom: 2px solid var(--accent-2); transform: rotate(-45deg) translateY(-30%); }
.smartscreen { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 1.2rem 1.4rem; color: var(--warn-text); }

/* Legales y 404 */
.legal-page { max-width: 860px; }
.not-found { text-align: center; padding-block: 6rem; }
.not-found .hero-actions { justify-content: center; }

/* Pie */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding-block: 2rem; color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { color: var(--text); font-weight: 600; }
.footer-contact, .footer-rights { margin: 0; }
.footer-rights { width: 100%; font-size: 0.82rem; }

/* Móvil */
@media (max-width: 640px) {
    .header-inner { gap: 0.8rem; }
    .main-nav { gap: 0.8rem; }
    .brand-name { display: none; }
    .account-link { padding-inline: 0.8rem; }
    .hero-shade { background: linear-gradient(0deg, rgba(11, 14, 20, 0.95) 10%, rgba(11, 14, 20, 0.5) 100%); }
    .hero-inner { justify-content: flex-end; }
    .btn-lg { width: 100%; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
    .hero-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
