:root {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #222634;
    --border: #2c3144;
    --text: #e8eaf0;
    --muted: #9aa1b5;
    --accent: #f5b041;
    --accent-text: #1a1304;
    --free: #3ddc97;
    --radius: 12px;
    --gutter: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1:focus { outline: none; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .5rem; }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

main { flex: 1; padding-bottom: 2rem; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
}
.brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}
.brand span { color: var(--accent); }
.main-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.main-nav a { color: var(--text); text-decoration: none; padding: .5rem 0; }
.main-nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 1.75rem 0 .5rem; }
.hero h1 { font-size: 1.6rem; }
.hero p { color: var(--muted); }

/* Card grid: 1 column on phones, more as the screen grows */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card-thumb {
    position: relative;
    aspect-ratio: 460 / 215;
    background: linear-gradient(135deg, var(--surface-2), #2f3550);
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--muted);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .8rem;
    font-weight: 800;
    padding: .15rem .5rem;
    border-radius: 6px;
}
.badge-free { background: var(--free); }
.card-body { padding: .75rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.card-body h3 { margin: 0; }
.price { margin-top: auto; padding-top: .35rem; }
.price strong { font-size: 1.15rem; margin-right: .4rem; }
.price s { color: var(--muted); font-size: .9rem; }

.muted { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; }

.button {
    display: inline-block;
    margin-top: .5rem;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    padding: .5rem .9rem;
    border-radius: 8px;
}
.button:hover { filter: brightness(1.1); }

/* Text pages */
.prose { max-width: 720px; padding-top: 1.5rem; }

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    color: var(--muted);
    font-size: .9rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .5rem 0; }
.footer-nav a { color: var(--text); }
.copyright { margin: 0; }

/* Blazor */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ocurrió un error."; }

/* Listings and filters */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
    margin: 1rem 0;
}
.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.filters select, .filters input {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem;
    font: inherit;
    min-width: 0;
}
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; }
.filter-actions .button { margin-top: 0; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
@media (min-width: 860px) {
    .filters { grid-template-columns: repeat(5, 1fr) ; }
    .filter-actions { grid-column: 1 / -1; }
}

.pagination { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin: 1.5rem 0; }

.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); }
a.card-thumb { text-decoration: none; }

/* Game page */
.breadcrumb { color: var(--muted); font-size: .9rem; padding-top: 1rem; }
.game-head { display: grid; gap: 1rem; padding-top: .75rem; }
.game-cover { width: 100%; max-width: 460px; height: auto; border-radius: var(--radius); }
@media (min-width: 720px) { .game-head { grid-template-columns: 460px 1fr; align-items: start; } }
.historic-low { font-size: 1.05rem; }
.badge-inline { background: var(--free); color: var(--accent-text); font-weight: 800; font-size: .8rem; padding: .1rem .5rem; border-radius: 6px; margin-left: .5rem; }

.stores-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.stores-table th, .stores-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.stores-table th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stores-table .button { margin: 0; padding: .35rem .8rem; }

.chart { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-dot { fill: var(--accent); }
.chart-label { fill: var(--muted); font-size: 11px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stores-table s { margin-left: .4rem; }
.historic-low .muted { margin-left: .25rem; }

/* Chips: category tags and store filters */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.chip {
    display: inline-block;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .2rem .75rem;
    font-size: .85rem;
    text-decoration: none;
}
.chip:hover { border-color: var(--accent); }
.chip-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }

/* Guides */
.guide-list { display: grid; gap: 1rem; margin-top: 1rem; }
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.guide-card h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
.guide-card h2 a { color: var(--text); text-decoration: none; }
.guide-card h2 a:hover { color: var(--accent); }
.badge-draft { background: var(--muted); }
.draft-banner { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--radius); padding: .6rem .8rem; }

.article { padding-bottom: 1rem; }
.article h2 { margin-top: 1.75rem; }
.article h3 { margin-top: 1.25rem; font-size: 1.1rem; }
.article p, .article li { line-height: 1.7; }
.article ul, .article ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.article blockquote { margin: 1rem 0; padding: .5rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); color: var(--muted); }
.article table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article th, .article td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.article code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; }

/* Cookie consent and ads */
.consent-banner {
    position: fixed;
    left: var(--gutter);
    right: var(--gutter);
    bottom: var(--gutter);
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface-2);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    z-index: 50;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.consent-banner[hidden] { display: none; }
.consent-banner p { margin: 0 0 .6rem; font-size: .9rem; }
.consent-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.consent-actions .button { margin: 0; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.button-secondary { background: transparent; color: var(--text); border: 1px solid var(--border) !important; }

.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--accent); }

.ad-slot { display: none; }
.ad-slot.ad-loaded { display: block; margin: 1rem 0; min-height: 90px; text-align: center; }
.ad-slot.ad-loaded::before { content: "Publicidad"; display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.adsbygoogle { display: block; }

.game-layout { display: block; }
@media (min-width: 1000px) {
    .game-layout:has(.ad-loaded) { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
}
