/* XDGAME BOX — desktop gaming, light and dark themes. */
:root {
    color-scheme: light;
    --bg: #f4f5f7;
    --bg-elev: #fff;
    --surface: #fff;
    --surface-soft: #eef0f3;
    --text: #171b22;
    --text-muted: #606773;
    --border: #dfe2e8;
    --accent: #ffd447;
    --accent-hover: #ffdf72;
    --accent-ink: #805c00;
    --accent-soft: #fff7da;
    --nav-bg: rgba(244,245,247,.94);
    --shadow: 0 18px 45px rgba(23,27,34,.07);
    --icon-yellow: #b27d00;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101216;
    --bg-elev: #15181e;
    --surface: #1b1f26;
    --surface-soft: #222730;
    --text: #f4f5f7;
    --text-muted: #a5acb8;
    --border: #2c313b;
    --accent-ink: #ffda62;
    --accent-soft: #302b1c;
    --nav-bg: rgba(16,18,22,.94);
    --shadow: 0 18px 45px rgba(0,0,0,.16);
    --icon-yellow: #ffd447;
}
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; }
::selection { background: var(--accent); color: #171b22; }
h1,h2,h3,h4,h5,h6 { color: var(--text); font-weight: 750; letter-spacing: -.035em; }
h2 { font-size: clamp(1.65rem, 2.6vw, 2.25rem); line-height: 1.4; }
.text-muted { color: var(--text-muted) !important; }
section { padding: 88px 0; position: relative; }
section[id] { scroll-margin-top: 98px; }
section:not(.hero-section) { border-top: 1px solid var(--border); }
.section-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-ink); font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin-bottom: 16px; }
.section-eyebrow::before { content: ''; width: 20px; height: 3px; background: var(--accent); }
.section-intro { color: var(--text-muted); font-size: 1rem; line-height: 1.9; margin: 16px 0 0; max-width: 46em; }
#features .text-center, #categories .text-center, #tech .text-center, #changelog .text-center { text-align: left !important; }
.text-gradient { color: var(--accent-ink); }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; }
/* Navigation */
.navbar { background: var(--nav-bg); border-bottom: 1px solid var(--border); padding: 15px 0; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.navbar.scrolled { box-shadow: 0 5px 24px rgba(0,0,0,.05); }
.navbar-brand { color: var(--text) !important; margin-right: 32px; }
.navbar-brand img { width: 39px; height: 39px; margin-right: 12px !important; }
.brand-lockup { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-lockup strong { font-size: 1.18rem; font-weight: 850; letter-spacing: -.04em; }
.brand-box { color: var(--accent-ink); }
.brand-lockup small { font-size: .66rem; color: var(--text-muted); letter-spacing: .18em; font-weight: 500; }
.navbar .nav-link { color: var(--text-muted); font-size: .88rem; font-weight: 600; padding: 10px 12px !important; position: relative; white-space: nowrap; }
.navbar .nav-link::after { content: ''; position: absolute; bottom: 2px; left: 12px; width: 16px; height: 2px; background: var(--accent); opacity: 0; transition: width .2s, opacity .2s; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--text); }
.navbar .nav-link.active::after { width: 24px; opacity: 1; }
.return-site { font-size: .8rem; color: var(--text-muted); text-decoration: none; padding: 10px 8px; white-space: nowrap; }
.return-site:hover { color: var(--text); }
.theme-toggle { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-soft); }
[data-theme="dark"] .navbar-toggler-icon { filter: invert(1); }
/* Buttons */
.btn { border-radius: 8px; padding: 11px 23px; font-size: .9rem; font-weight: 700; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-primary { --bs-btn-color: #191b21; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #191b21; --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover); --bs-btn-active-color: #191b21; --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover); background: var(--accent); border-color: var(--accent); color: #191b21; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #191b21; transform: translateY(-2px); }
.btn-outline-secondary { background: transparent; border-color: var(--border); color: var(--text); --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--surface-soft); --bs-btn-active-border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--surface-soft); color: var(--text); border-color: var(--text-muted); }
/* Hero */
.hero-section { padding: 90px 0 80px; overflow: hidden; }
.hero-section::before { content: ''; position: absolute; pointer-events: none; right: -12%; top: -40%; width: 70%; height: 160%; transform: rotate(20deg); background: linear-gradient(135deg, transparent 10%, color-mix(in srgb, var(--accent) 8%, transparent) 70%, transparent); border-left: 1px solid var(--border); }
.hero-section::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .25; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(90deg, transparent 35%, #000); }
.hero-section .container { position: relative; z-index: 1; }
.hero-layout { --bs-gutter-x: 0; --bs-gutter-y: 0; display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.15fr); gap: 48px; margin: 0; }
.hero-layout > div { width: auto; padding: 0; }
.hero-badge { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-muted); padding: 6px 11px; font-size: .75rem; font-weight: 600; margin-bottom: 24px; }
.hero-badge .dot, .preview-dot { width: 6px; height: 6px; background: #23a66a; border-radius: 50%; display: inline-block; }
.hero-product { color: var(--text-muted); font-size: .8rem; letter-spacing: .04em; margin-bottom: 14px; }
.hero-product span { margin: 0 9px; color: var(--border); }
.hero-section h1 { font-size: clamp(1.9rem, 3vw, 2.75rem); line-height: 1.5; font-weight: 850; letter-spacing: -.05em; }
.hero-slogan { display: inline-block; font-size: clamp(2.6rem, 4.8vw, 4.25rem); line-height: 1.22; letter-spacing: -.045em; margin-top: 2px; }
.hero-section .lead { font-size: .98rem; line-height: 1.95; max-width: 34em; }
.hero-stats { display: flex; gap: 22px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); }
.hero-stats .stat { min-width: 0; padding-right: 22px; border-right: 1px solid var(--border); }
.hero-stats .stat:last-child { padding-right: 0; border-right: 0; }
.hero-stats .num { font-size: 1.05rem; font-weight: 750; color: var(--text); white-space: nowrap; line-height: 1.5; }
.hero-stats .label { color: var(--text-muted); font-size: .73rem; margin-top: 6px; white-space: nowrap; }
.hero-img-wrap { border: 1px solid var(--border); border-radius: 12px; padding: 9px; background: var(--surface); box-shadow: 0 30px 70px rgba(0,0,0,.16); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 7px 13px; color: var(--text-muted); font-size: .65rem; letter-spacing: .025em; }
.preview-toolbar > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.hero-preview { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); overflow: hidden; cursor: zoom-in; }
.hero-preview img { width: 100%; height: auto; display: block; }
.screenshot-note { display: flex; justify-content: space-between; gap: 10px; margin: 13px 7px 4px; font-size: .65rem; color: var(--text-muted); text-align: left; }
/* Features and game categories */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); overflow: hidden; transition: border-color .2s, transform .2s; }
.card:hover { border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--border)); }
.card-title { color: var(--text); }
.card-text { color: var(--text-muted); }
#features .row { --bs-gutter-x: 20px; --bs-gutter-y: 20px; }
.feature-card { position: relative; }
.feature-card .card-body { padding: 30px !important; }
.feature-number { position: absolute; right: 26px; top: 26px; font-family: ui-monospace, 'Consolas', monospace; font-size: .8rem; letter-spacing: .06em; color: var(--text-muted); opacity: .65; }
.feature-icon { display: inline-flex; width: 45px; height: 45px; align-items: center; justify-content: center; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); border-radius: 10px; font-size: 1.35rem; margin-bottom: 24px; }
#features .card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.6; margin-bottom: 12px; letter-spacing: -.015em; }
#features .card-text { font-size: .9rem; line-height: 1.95; margin: 0; }
#features .row > div:first-child .card { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
#categories { padding: 68px 0; }
.category-card .card-body { display: grid; grid-template-columns: 42px minmax(0,1fr); column-gap: 18px; align-content: start; padding: 26px !important; }
.category-icon { grid-row: span 2; font-size: 1.7rem; line-height: 1.4; color: var(--accent-ink); }
.category-card .card-title { font-size: 1.08rem; margin-bottom: 8px !important; }
.category-card .card-text { font-size: .85rem; margin: 0; line-height: 1.85; }
/* Architecture */
#tech > .container, #changelog > .container { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.4fr); gap: 64px; }
#tech .mb-5, #changelog .mb-5 { margin-bottom: 0 !important; }
#tech > .container > .row { margin: 0; }
#tech > .container > .row > .col-lg-10 { width: 100%; padding: 0; }
#tech .row-cols-md-2 { --bs-gutter-x: 18px; --bs-gutter-y: 18px; }
.tech-item { display: flex; gap: 14px; height: 100%; padding: 22px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tech-ico { color: var(--accent-ink); font-size: 1.15rem; flex-shrink: 0; }
.tech-item h3 { font-size: 1rem; margin-bottom: 9px; line-height: 1.6; letter-spacing: -.02em; }
.tech-item p { color: var(--text-muted); font-size: .83rem; line-height: 1.85; margin: 0; }
/* Screenshot gallery */
.gallery-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.screenshot-themes { display: inline-flex; flex-shrink: 0; gap: 4px; padding: 5px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.screenshot-themes button { border: 0; border-radius: 5px; padding: 10px 17px; font-size: .85rem; font-weight: 650; color: var(--text-muted); background: transparent; white-space: nowrap; }
.screenshot-themes button[aria-pressed="true"] { color: #191b21; background: var(--accent); }
.screenshot-themes button:hover { color: var(--text); background: var(--surface-soft); }
.screenshot-themes button[aria-pressed="true"]:hover { color: #191b21; background: var(--accent-hover); }
.shot { padding: 8px 8px 0; background: var(--bg); }
.shot .card-img-container { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 1282 / 822; object-fit: contain; }
.shot .card-body { padding: 20px 15px 23px; }
.shot .card-title { font-size: 1.02rem; }
.shot .card-text { font-size: .86rem; }
.shot .overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,12,16,.25); opacity: 0; transition: opacity .2s; }
.shot:hover .overlay, .shot:has(.card-img-container:focus-visible) .overlay { opacity: 1; }
.shot .badge { background: var(--accent); color: #191b21; border-radius: 6px; font-size: .8rem; font-weight: 700; padding: 12px 18px; }
/* Release notes */
.release-log { min-width: 0; }
.release-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.release-group:last-child { margin-bottom: 0; }
.release-group summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; padding: 20px 24px; cursor: pointer; font-weight: 650; font-size: 1rem; }
.release-group summary::-webkit-details-marker { display: none; }
.release-group summary:hover { background: var(--surface-soft); }
.release-group[open] summary { border-bottom: 1px solid var(--border); }
.release-count { display: inline-block; margin-left: 12px; color: var(--text-muted); font-size: .75rem; font-weight: 400; padding: 1px 7px; background: var(--surface-soft); border-radius: 4px; }
.release-toggle::before { content: '+'; font: 1.25rem ui-monospace, monospace; color: var(--text-muted); }
.release-group[open] .release-toggle::before { content: '−'; }
.release-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 26px; margin: 0; padding: 24px 24px 24px 46px; color: var(--text-muted); font-size: .85rem; line-height: 1.85; }
.release-list li { padding-left: 3px; }
/* Download */
.download-section { --text: #f4f5f7; --text-muted: #a5acb8; --border: #343a44; --accent-ink: #ffda62; --accent-soft: #302b1c; color: var(--text); background: #14171d; padding: 78px 0; overflow: hidden; }
.download-section::before { content: ''; position: absolute; width: 520px; height: 520px; top: -260px; left: -140px; border: 1px solid #34332a; transform: rotate(30deg); pointer-events: none; }
.download-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr); gap: 100px; align-items: center; position: relative; }
.download-copy h2 { font-size: clamp(2rem,3vw,2.85rem); line-height: 1.4; margin-bottom: 20px; }
.download-copy p { color: var(--text-muted); font-size: .95rem; line-height: 1.9; margin-bottom: 28px; }
.download-highlights { display: flex; flex-wrap: wrap; gap: 10px 20px; color: #c5cbd5; font-size: .8rem; }
.download-highlights i { color: var(--accent); margin-right: 7px; }
.download-card { background: #1d222a; border: 1px solid #343a44; border-radius: 12px; padding: 30px; }
.download-platform { display: flex; align-items: center; gap: 18px; margin-bottom: 25px; }
.download-platform .feature-icon { margin: 0; flex-shrink: 0; background: transparent; border: 0; border-radius: 0; color: var(--accent); width: 42px; font-size: 2.2rem; }
.download-platform h3 { font-size: 1.25rem; margin: 0 0 5px; }
.download-platform p { color: var(--text-muted); font-size: .8rem; margin: 0; }
.migration-note { text-align: center; color: var(--text-muted); font-size: .78rem; margin: 16px 0 22px; }
.download-notice { display: flex; align-items: flex-start; gap: 9px; padding-top: 19px; border-top: 1px solid var(--border); font-size: .76rem; line-height: 1.85; color: var(--text-muted); }
.download-notice i { color: #d5bc70; flex-shrink: 0; }
.download-notice strong { color: #ebd494; }
/* Footer and utility controls */
footer { padding: 52px 0 28px; border-top: 1px solid var(--border); background: var(--bg-elev); }
footer p { color: var(--text-muted); font-size: .85rem; }
footer .brand-name { color: var(--text); font-size: 1.05rem !important; }
.footer-divider { opacity: 1; border-color: var(--border); margin: 30px 0 22px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font-size: .77rem; }
.footer-links-label, .footer-copyright { color: var(--text-muted); font-size: .75rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.back-to-top { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; box-shadow: var(--shadow); z-index: 1000; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { border-color: var(--accent-ink); }
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-title { font-size: 1rem; letter-spacing: 0; }
.shot-modal { max-width: min(1320px,96vw); }
.shot-modal .modal-body { padding: 0; }
.shot-modal .modal-body img { width: 100%; height: auto; display: block; border-radius: 0 0 10px 10px !important; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: none; }
/* Responsive */
@media (min-width: 1400px) { .container { max-width: 1320px; } }
@media (max-width: 1399px) {
    .hero-layout { gap: 32px; }
    .navbar .nav-link { padding: 10px 9px !important; }
    .navbar-brand { margin-right: 18px; }
    .download-layout { gap: 64px; }
    #tech > .container, #changelog > .container { gap: 36px; }
}
@media (max-width: 1199px) {
    .navbar-collapse { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-top: 16px; padding: 12px; max-height: calc(100dvh - 110px); overflow-y: auto; }
    .navbar .nav-link { padding: 10px 14px !important; border-radius: 6px; }
    .navbar .nav-link::after { display: none; }
    .navbar .nav-link.active { background: var(--accent-soft); color: var(--accent-ink); }
    .hero-section h1 { font-size: 1.95rem; }
    .hero-stats { gap: 14px; }
    .hero-stats .stat { padding-right: 14px; }
    .hero-stats .label { font-size: .65rem; }
    .hero-stats .num { font-size: .9rem; }
    .hero-product { font-size: .73rem; }
    .feature-card .card-body { padding: 24px !important; }
    #tech > .container { grid-template-columns: minmax(0,.7fr) minmax(0,1.3fr); }
    #tech .row-cols-md-2 > * { width: 100%; }
}
@media (max-width: 991px) {
    section { padding: 68px 0; }
    .hero-section { padding: 56px 0 64px; }
    .hero-layout { grid-template-columns: 1fr; gap: 42px; }
    .hero-section h1 { font-size: 2.6rem; }
    .hero-slogan { font-size: 3.6rem; }
    .hero-section .lead { max-width: 40em; }
    .hero-stats { justify-content: flex-start; gap: 26px; max-width: 500px; }
    .hero-stats .stat { padding-right: 26px; }
    .hero-stats .label { font-size: .75rem; }
    .hero-stats .num { font-size: 1rem; }
    #tech > .container, #changelog > .container { grid-template-columns: 1fr; gap: 32px; }
    #tech .row-cols-md-2 > * { width: 50%; }
    .gallery-heading { display: block; }
    .screenshot-themes { margin-top: 24px; }
    .download-layout { gap: 36px; grid-template-columns: 1fr 1fr; }
    .download-card { padding: 24px; }
}
@media (max-width: 767px) {
    .container { padding-left: 20px; padding-right: 20px; }
    section { padding: 58px 0; }
    .navbar { padding: 12px 0; }
    .navbar-brand img { width: 33px; height: 33px; }
    .brand-lockup strong { font-size: 1.05rem; }
    .brand-lockup small { font-size: .6rem; }
    .navbar-toggler { padding: 5px 6px; }
    .hero-section { padding: 38px 0 48px; }
    .hero-section h1 { font-size: clamp(1.6rem, 6.9vw, 2.6rem); }
    .hero-slogan { font-size: clamp(2.5rem, 11vw, 3.5rem); }
    .hero-section .lead { font-size: .9rem; line-height: 1.9; }
    .hero-product { font-size: .68rem; }
    .hero-product span { margin: 0 5px; }
    .hero-badge { margin-bottom: 20px; }
    .hero-section .btn-lg { padding: 13px 20px; font-size: .9rem; }
    .hero-layout { gap: 32px; }
    .hero-stats { gap: 13px; padding-top: 20px; margin-top: 24px; }
    .hero-stats .stat { padding-right: 13px; }
    .hero-stats .num { font-size: .86rem; }
    .hero-stats .label { font-size: .61rem; }
    .hero-img-wrap { padding: 6px; border-radius: 9px; }
    .preview-toolbar { font-size: .59rem; padding: 5px 4px 10px; }
    .screenshot-note { font-size: .59rem; margin: 10px 4px 4px; }
    .screenshot-note span:last-child { display: none; }
    .mb-5 { margin-bottom: 30px !important; }
    .section-intro { font-size: .9rem; }
    .section-eyebrow { font-size: .7rem; margin-bottom: 12px; }
    .feature-card .card-body { padding: 25px !important; }
    .feature-icon { width: 40px; height: 40px; font-size: 1.2rem; margin-bottom: 18px; }
    #categories { padding: 52px 0; }
    .category-card .card-body { padding: 22px !important; }
    #tech .row-cols-md-2 > * { width: 100%; }
    .tech-item { padding: 22px; }
    .screenshot-themes button { font-size: .8rem; padding: 10px 16px; }
    .shot .card-body { padding: 17px 10px 20px; }
    .release-list { grid-template-columns: 1fr; padding: 20px 20px 24px 43px; }
    .release-group summary { padding: 17px 20px; }
    .download-layout { grid-template-columns: 1fr; gap: 30px; }
    .download-section { padding: 55px 0; }
    .download-platform p { font-size: .75rem; }
    .download-card { padding: 24px; }
    .download-highlights { font-size: .73rem; gap: 8px 14px; }
    footer { padding: 36px 0 26px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
    .footer-links { gap: 12px; }
    .back-to-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}
@media (max-width: 359px) {
    .container { padding-left: 16px; padding-right: 16px; }
    .hero-stats { gap: 9px; }
    .hero-stats .stat { padding-right: 9px; }
    .hero-stats .label { font-size: .57rem; }
    .hero-section .btn-lg { padding: 12px 17px; }
    .download-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* Trim the one-pixel image edge in every screenshot frame. */
.hero-preview img, .shot img, .shot-modal .modal-body img { clip-path: inset(1px); }
