/* =====================================================================
   LaGranja Conquer - estilos de la web (tinta + fuego, a juego con el launcher)
   ===================================================================== */
@font-face {
    font-family: "Philosopher";
    src: url("../fonts/Philosopher-Bold/Philosopher-Bold.woff") format("woff"),
         url("../fonts/Philosopher-Bold/Philosopher-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Philosopher";
    src: url("../fonts/Philosopher-Regular/Philosopher-Regular.woff") format("woff"),
         url("../fonts/Philosopher-Regular/Philosopher-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

:root {
    --ink: #0d0807;
    --ink-2: #160d0b;
    --surface: rgba(28, 15, 12, 0.86);
    --surface-2: rgba(44, 22, 15, 0.9);
    --line: rgba(214, 150, 78, 0.28);
    --line-strong: rgba(232, 178, 92, 0.6);
    --text: #ecdcc6;
    --muted: #a8917a;
    --gold: #e8b25c;
    --gold-bright: #ffd682;
    --ember: #ff7a24;
    --ember-deep: #c2410c;
    --ok: #7ee87c;
    --bad: #f66050;
    --radius: 10px;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --heading: "Philosopher", Georgia, "Times New Roman", serif;
    --body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 20% -10%, rgba(255, 122, 36, 0.18), transparent 60%),
        radial-gradient(900px 500px at 100% 10%, rgba(194, 65, 12, 0.14), transparent 60%),
        linear-gradient(180deg, #120a08 0%, var(--ink) 40%, #090504 100%);
    background-attachment: fixed;
}
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-bright); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--heading); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; color: #fff3df; }
p { margin: 0 0 1em; }

.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }
.site-main { flex: 1; position: relative; z-index: 1; padding-bottom: 64px; }
.embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.embers canvas { width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- cabecera */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(13, 8, 7, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff3df; font-family: var(--heading); font-size: 22px; font-weight: 700; }
.brand img { filter: drop-shadow(0 0 10px rgba(255, 122, 36, .45)); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    position: relative; padding: 10px 14px; color: var(--text);
    font-family: var(--heading); font-size: 17px; border-radius: 8px;
}
.site-nav a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--ember), transparent);
    transform: scaleX(0); transition: transform .25s;
}
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--gold-bright); }
.site-nav .nav-cta { margin-left: 8px; background: linear-gradient(180deg, #ff9442, var(--ember-deep)); color: #1a0a04; font-weight: 700; }
.site-nav .nav-cta::after { display: none; }
.site-nav .nav-cta:hover { color: #000; filter: brightness(1.1); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gold); margin: 4px 0; }

/* ---------------------------------------------------------------- portada */
.hero { position: relative; padding: 56px 0 32px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-art::before {
    content: ""; position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 120, 30, .55), transparent 65%);
    filter: blur(10px); animation: breathe 4s ease-in-out infinite;
}
.hero-art img { position: relative; width: min(520px, 100%); animation: float 6s ease-in-out infinite; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--ember); margin-bottom: 12px; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); background: linear-gradient(180deg, #fff3cf, var(--gold) 55%, var(--ember-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.hero p.lead { font-size: 18px; color: #dcc8ae; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 28px; }

/* ---------------------------------------------------------------- botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: 999px; border: 1px solid var(--line-strong);
    font-family: var(--heading); font-size: 18px; font-weight: 700; letter-spacing: .03em;
    color: var(--text); background: rgba(30, 16, 12, .7); cursor: pointer;
    transition: transform .15s, box-shadow .25s, filter .2s;
}
.btn:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 10px 24px rgba(255, 122, 36, .22); }
.btn-primary { background: linear-gradient(180deg, #ffb35c, var(--ember) 45%, var(--ember-deep)); color: #2a0e02; border-color: #ffc27a; box-shadow: 0 0 24px rgba(255, 122, 36, .35); }
.btn-primary:hover { color: #000; filter: brightness(1.08); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-sm { padding: 8px 16px; font-size: 15px; }

/* ---------------------------------------------------------------- paneles */
.section { padding: 28px 0; }
.section-title { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-title h2 { font-size: 30px; margin: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.panel {
    position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.panel::before {
    content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px;
    background: var(--gold); transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 10px rgba(232, 178, 92, .6);
}
.panel h3 { font-size: 21px; color: var(--gold-bright); }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: 1.6fr 1fr; }

/* tarjetas de estado */
.stat { text-align: center; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); }
.stat .value { font-family: var(--heading); font-size: 40px; font-weight: 700; color: #fff3df; line-height: 1.2; }
.stat .hint { font-size: 13px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--heading); font-size: 32px; font-weight: 700; }
.status-pill::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; box-shadow: 0 0 14px currentColor; animation: pulse 1.8s infinite; }
.is-online { color: var(--ok); }
.is-offline { color: var(--bad); }

/* noticias */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 12px; align-items: baseline; padding: 11px 6px; border-bottom: 1px solid rgba(214, 150, 78, .14); }
.news-list li:last-child { border-bottom: none; }
.news-date { flex: none; min-width: 64px; font-weight: 700; color: var(--gold); font-size: 13px; }
.news-list a { color: var(--text); }
.news-list a:hover { color: var(--gold-bright); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; color: var(--muted); font-family: var(--heading); font-size: 18px; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active, .tab:hover { color: var(--gold-bright); border-bottom-color: var(--ember); }
.tab-panel[hidden] { display: none; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.steps li::before { content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--heading); font-weight: 700; color: #2a0e02; background: linear-gradient(180deg, var(--gold-bright), var(--ember)); }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(214, 150, 78, .18); }
.event-list li:last-child { border-bottom: none; }
.event-list strong { color: var(--gold-bright); font-weight: 600; }
.event-list span { color: var(--muted); text-align: right; }

/* ---------------------------------------------------------------- formularios */
.form { display: grid; gap: 16px; }
.field label { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .search input, .form select {
    width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line);
    background: rgba(10, 6, 5, .8); color: #fff; font-size: 15px; font-family: var(--body);
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .search input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255, 122, 36, .2); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; }
.alert { padding: 12px 16px; border-radius: 8px; border: 1px solid; margin-bottom: 14px; }
.alert-error { border-color: rgba(246, 96, 80, .5); background: rgba(246, 96, 80, .1); color: #ffb3a8; }
.alert-ok { border-color: rgba(126, 232, 124, .5); background: rgba(126, 232, 124, .1); color: #c9ffc8; }
.form-narrow { max-width: 560px; margin: 0 auto; }

/* ---------------------------------------------------------------- ranking */
.search { display: flex; gap: 10px; margin-bottom: 16px; }
.search input { flex: 1; }
.rank-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rank-tabs a { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-family: var(--heading); font-size: 16px; }
.rank-tabs a.active, .rank-tabs a:hover { background: linear-gradient(180deg, rgba(255, 122, 36, .3), rgba(194, 65, 12, .2)); border-color: var(--ember); color: #fff; }
.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th { text-align: left; font-family: var(--heading); font-size: 15px; color: var(--gold); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
table.rank td { padding: 10px 12px; border-bottom: 1px solid rgba(214, 150, 78, .12); }
table.rank tr:hover td { background: rgba(255, 122, 36, .06); }
table.rank .num { text-align: right; font-variant-numeric: tabular-nums; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, .06); }
.medal-1 { background: linear-gradient(180deg, #ffe08a, #c98a1b); color: #2a1600; }
.medal-2 { background: linear-gradient(180deg, #eef1f5, #8d97a5); color: #1c2026; }
.medal-3 { background: linear-gradient(180deg, #f0b48a, #9a5a2c); color: #2a1306; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* ---------------------------------------------------------------- descargas */
.download-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.download-card .size { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- tienda */
.market-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.market-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(20, 11, 9, .8); color: var(--text); font-family: var(--heading); font-size: 16px; cursor: pointer; }
.market-tab svg { width: 18px; height: 18px; fill: currentColor; }
.market-tab.active { background: linear-gradient(180deg, #ffb35c, var(--ember-deep)); color: #2a0e02; border-color: #ffc27a; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.market-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .2s, border-color .2s; }
.market-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 12px 26px rgba(0, 0, 0, .45); }
.market-media { height: 140px; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 122, 36, .18), transparent 70%); border-bottom: 1px solid var(--line); }
.market-media img { max-width: 120px; max-height: 120px; }
.market-body { padding: 12px 14px; }
.market-name { font-family: var(--heading); font-size: 17px; color: #fff3df; margin: 0 0 4px; }
.market-old { color: var(--muted); font-size: 12px; text-decoration: line-through; margin: 0; }
.market-price { color: var(--gold-bright); font-weight: 700; margin: 0 0 10px; }
.qty-controls { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255, 122, 36, .15); color: #fff; font-weight: 700; cursor: pointer; }
.qty-btn[disabled] { opacity: .4; cursor: not-allowed; }
.qty-value { min-width: 20px; text-align: center; }
.market-foot { color: var(--muted); font-size: 12px; margin-top: 8px; }
.cart-bar { position: sticky; bottom: 12px; margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: rgba(16, 9, 7, .95); box-shadow: var(--shadow); }
.cart-total { color: var(--gold-bright); font-weight: 700; font-size: 18px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { width: min(520px, 100%); background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.modal-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.modal-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.modal-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 14px; }

/* ---------------------------------------------------------------- pie */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(9, 5, 4, .9); padding: 28px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { display: block; font-family: var(--heading); font-size: 18px; color: #fff3df; }
.footer-brand span { font-size: 13px; color: var(--muted); }
.footer-social { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-legal { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- animaciones */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: .9; transform: scale(1.03); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .hero-grid, .grid-main { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .hero-art img { width: min(360px, 80%); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; background: rgba(13, 8, 7, .97); border-bottom: 1px solid var(--line); display: none; }
    .site-nav.open { display: flex; }
    .site-nav .nav-cta { margin: 6px 0 0; text-align: center; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .brand span { font-size: 18px; }
    .search { flex-direction: column; }
}
