@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rubik:wght@400;500;600;700&display=swap');

/* ──────────────────────────────────────────────── */
/* Robotic Invasion — sci-fi / пиксельная тема       */
/* ──────────────────────────────────────────────── */

:root {
    --ri-bg: #0a0e14;
    --ri-bg2: #0e141d;
    --ri-surface: rgba(255, 255, 255, 0.04);
    --ri-surface-2: rgba(255, 255, 255, 0.07);
    --ri-border: rgba(255, 45, 55, 0.2);
    --ri-border-strong: rgba(255, 45, 55, 0.45);

    --ri-accent: #ff2d37;
    --ri-accent-2: #7a1016;
    --ri-grad: linear-gradient(135deg, #ff5a4a 0%, #ff2d37 55%, #a01019 100%);
    --ri-soft: rgba(255, 45, 55, 0.14);

    --ri-text: #dfe8f0;
    --ri-text-dim: #9fb0c0;
    --ri-text-faint: #647688;

    --radius: 16px;
    --radius-sm: 12px;
    --pill: 999px;

    --font-display: 'Press Start 2P', system-ui, sans-serif;
    --font-body: 'Rubik', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--ri-bg);
    color: var(--ri-text);
    -webkit-font-smoothing: antialiased;
}

/* Фоновая картинка (bg.jpg) с тёмным оверлеем — фикс. слой */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(to bottom, rgba(8, 10, 14, 0.38) 0%, rgba(8, 10, 14, 0.58) 55%, rgba(8, 10, 14, 0.8) 100%),
        url('bg.png') center center / cover no-repeat;
}

/* Пиксельная сетка поверх фона */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 45, 55, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 45, 55, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(75% 65% at 50% 30%, #000, transparent 85%);
    -webkit-mask-image: radial-gradient(75% 65% at 50% 30%, #000, transparent 85%);
}

.background {
    display: none;
}

.content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 18px 120px;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    color: var(--ri-text);
    line-height: 1.3;
}

p {
    color: var(--ri-text-dim);
    line-height: 1.7;
}

a {
    color: var(--ri-accent);
    text-decoration: none;
    transition: color 0.25s;
}

a:hover {
    color: var(--ri-accent-2);
}

/* ──────────────────────────────────────────────── */
/* HERO                                             */
/* ──────────────────────────────────────────────── */

.ri-hero {
    text-align: center;
    padding: 48px 0 30px;
}

.ri-logo {
    width: min(150px, 45%);
    height: auto;
    margin: 0 auto 22px;
    display: block;
    border-radius: 24px;
    image-rendering: pixelated;
    box-shadow: 0 0 0 1px var(--ri-border), 0 22px 50px -16px rgba(255, 45, 55, 0.5);
}

.ri-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 5.5vw, 46px);
    line-height: 1.2;
    margin: 6px 0 18px;
    color: var(--ri-accent);
    text-shadow: 0 0 18px rgba(255, 45, 55, 0.6), 0 0 40px rgba(255, 45, 55, 0.3);
}

.ri-tagline {
    font-size: clamp(16px, 2.4vw, 20px);
    color: var(--ri-text);
    max-width: 640px;
    margin: 0 auto 28px;
    line-height: 1.5;
}

.store-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Бейдж «Скоро выйдет» */
.ri-status {
    display: inline-block;
    margin: 0 0 22px;
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--ri-accent);
    background: rgba(255, 45, 55, 0.12);
    border: 1px solid rgba(255, 45, 55, 0.4);
    border-radius: var(--pill);
    padding: 8px 16px;
    text-transform: uppercase;
}

/* Навигация по разделам поддомена */
.ri-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.button.disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* ── Контент Wiki / Политики ── */
.doc {
    max-width: 820px;
    margin: 0 auto;
}

.doc .card {
    text-align: left;
}

.doc h2 {
    color: var(--ri-accent);
}

.doc h3 {
    color: var(--ri-text);
    margin: 22px 0 8px;
}

.doc p,
.doc li {
    color: var(--ri-text-dim);
    line-height: 1.7;
}

.doc ul {
    padding-left: 22px;
}

.doc a {
    text-decoration: underline;
}

.wiki-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 28px;
}

.wiki-toc a {
    font-size: 0.85rem;
    padding: 7px 14px;
    border: 1px solid var(--ri-border);
    border-radius: var(--pill);
    color: var(--ri-text-dim);
    text-decoration: none;
    transition: all 0.2s ease;
}

.wiki-toc a:hover {
    color: var(--ri-text);
    border-color: var(--ri-accent);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ri-border);
}

.spec-table th {
    color: var(--ri-accent);
    font-weight: 600;
}

.spec-table td {
    color: var(--ri-text-dim);
}

.spec-table tr:hover td {
    background: rgba(255, 45, 55, 0.04);
}

.table-wrap {
    overflow-x: auto;
}

section[id] {
    scroll-margin-top: 24px;
}

/* ──────────────────────────────────────────────── */
/* Секции и карточки                                */
/* ──────────────────────────────────────────────── */

.section {
    margin: 46px 0;
}

.section-title {
    font-family: var(--font-display);
    text-align: center;
    font-size: clamp(16px, 3.5vw, 26px);
    color: var(--ri-text);
    margin: 0 0 26px;
    text-shadow: 0 0 14px rgba(255, 45, 55, 0.3);
}

.card {
    background: rgba(11, 15, 22, 0.62);
    backdrop-filter: blur(8px);
    border: 1px solid var(--ri-border);
    border-radius: var(--radius);
    padding: 26px 24px;
    margin: 18px 0;
    box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(255, 45, 55, 0.05);
}

.about-text {
    font-size: 1.02rem;
    color: var(--ri-text-dim);
    text-align: left;
    max-width: 760px;
    margin: 0 auto;
    white-space: pre-line;
}

/* ── Вставка трейлера (YouTube 16:9) ── */
.video-embed {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--ri-border-strong);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.85), 0 0 34px -10px rgba(255, 45, 55, 0.45);
    background: #000;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Вертикальный трейлер (YouTube Shorts 9:16) */
.video-embed.vertical {
    aspect-ratio: 9 / 16;
    max-width: 340px;
}

/* ── Сетка фич ── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.feature {
    min-width: 0;
    background: rgba(11, 15, 22, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--ri-border);
    border-radius: var(--radius-sm);
    padding: 22px 20px;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.feature:hover {
    transform: translateY(-5px);
    border-color: var(--ri-border-strong);
    background: var(--ri-surface-2);
    box-shadow: 0 14px 30px -18px rgba(255, 45, 55, 0.5);
}

.feature-icon {
    font-size: 1.8rem;
    line-height: 1;
    display: block;
    margin-bottom: 12px;
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--ri-accent);
}

.feature p {
    margin: 0;
    font-size: 0.94rem;
    color: var(--ri-text-dim);
    line-height: 1.55;
}

/* ──────────────────────────────────────────────── */
/* Кнопки                                           */
/* ──────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--ri-surface-2);
    color: var(--ri-text);
    border: 1px solid var(--ri-border-strong);
    border-radius: var(--pill);
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.button:hover {
    background: var(--ri-surface);
    border-color: var(--ri-accent);
    color: var(--ri-text);
    transform: translateY(-2px);
}

.button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.button.primary {
    background: var(--ri-grad);
    color: #06222e;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 10px 28px -10px rgba(255, 45, 55, 0.55);
}

.button.primary:hover {
    filter: brightness(1.06);
    color: #06222e;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* ──────────────────────────────────────────────── */
/* Скриншоты                                        */
/* ──────────────────────────────────────────────── */

.app-screenshots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 6px 2px 16px;
}

.app-screenshots::-webkit-scrollbar {
    height: 8px;
}

.app-screenshots::-webkit-scrollbar-thumb {
    background: var(--ri-border-strong);
    border-radius: var(--pill);
}

.screenshot {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
    border: 1px solid var(--ri-border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    background: #0a0e14;
    padding: 6px;
    transition: transform 0.3s ease;
}

.screenshot:hover {
    transform: translateY(-4px) scale(1.02);
}

.screenshot img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    image-rendering: pixelated;
}

/* ──────────────────────────────────────────────── */
/* Подвал + переключатель языка                      */
/* ──────────────────────────────────────────────── */

footer {
    text-align: center;
    margin-top: 48px;
    padding: 20px;
    color: var(--ri-text-faint);
    font-size: 0.85rem;
}

.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: var(--ri-surface);
    border: 1px solid var(--ri-border-strong);
    border-radius: var(--pill);
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ri-accent);
    backdrop-filter: blur(6px);
}

.lang-switch:hover {
    color: var(--ri-accent-2);
    background: var(--ri-surface-2);
}

/* ──────────────────────────────────────────────── */
/* Адаптив                                          */
/* ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .card {
        padding: 20px 16px;
    }

    .screenshot {
        width: 160px;
    }
}