:root {
    --bg: #070b14;
    --bg-top: #1b1022;
    --surface: rgba(17, 24, 39, 0.78);
    --surface-strong: rgba(17, 24, 39, 0.92);
    --surface-soft: rgba(148, 163, 184, 0.1);
    --text: #fff3df;
    --muted: #d7c6aa;
    --accent: #ff7a45;
    --accent-2: #ffb703;
    --accent-warm: #ffd166;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    --radius-lg: 6px;
    --radius-md: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at 10% 8%, rgba(255, 122, 69, 0.22), transparent 28%),
        radial-gradient(circle at 88% 84%, rgba(255, 183, 3, 0.18), transparent 34%),
        radial-gradient(circle at 56% 18%, rgba(131, 56, 236, 0.18), transparent 32%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 60%, #06080f 100%);
    color: var(--text);
    font-family: 'VT323', monospace;
    line-height: 1.45;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to top, transparent 0%, #000 42%);
    pointer-events: none;
    z-index: -2;
    animation: grid-shift 16s linear infinite;
}

body::after {
    content: '';
    position: fixed;
    inset: -12%;
    background:
        radial-gradient(ellipse at 20% 60%, rgba(255, 122, 69, 0.14), transparent 40%),
        radial-gradient(ellipse at 80% 40%, rgba(255, 183, 3, 0.12), transparent 42%),
        radial-gradient(ellipse at 50% 100%, rgba(131, 56, 236, 0.12), transparent 48%);
    pointer-events: none;
    z-index: -3;
    animation: aurora-drift 22s ease-in-out infinite alternate;
}

@keyframes grid-shift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, 26px, 0); }
}

@keyframes aurora-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to { transform: translate3d(2%, 1%, 0) scale(1.03); }
}

.crt-overlay {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.06),
        rgba(0, 0, 0, 0.06) 1px,
        transparent 1px,
        transparent 4px
    );
    z-index: 8;
    pointer-events: none;
    display: none;
}

.crt-flicker {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 58%, rgba(0, 0, 0, 0.12) 100%);
    z-index: 9;
    pointer-events: none;
    display: none;
}

#page-transition {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 15, 0.72);
    background: rgba(6, 8, 15, 0.88);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

#page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.transition-loader {
    font-size: 1.1rem;
    color: #ffe7c1;
    letter-spacing: 0.08em;
    text-shadow: 0 0 16px rgba(255, 183, 3, 0.45);
}

.progressive-img {
    opacity: 0;
    transition: opacity 0.45s ease;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.06) 8%,
        rgba(255, 255, 255, 0.16) 18%,
        rgba(255, 255, 255, 0.06) 33%
    );
    background-size: 220% 100%;
    animation: img-shimmer 1.2s linear infinite;
}

.progressive-img.is-loaded {
    opacity: 1;
    animation: none;
}

@keyframes img-shimmer {
    to {
        background-position-x: -220%;
    }
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

.perf-lite #bg-canvas {
    display: none;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

h1,
h2,
h3,
.logo-text {
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

header {
    position: relative;
    z-index: 30;
    margin-top: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(166, 180, 200, 0.22);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.72));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 8px 16px rgba(255, 122, 69, 0.4));
}

.logo-text {
    font-size: 1.14rem;
    font-weight: 700;
    color: #f3f8ff;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

.logo-text span {
    color: var(--accent);
}

nav {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

nav a {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 4px;
    transition: 0.2s ease;
}

nav a:hover,
nav a.active {
    color: #fff;
    background: rgba(255, 122, 69, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 122, 69, 0.58);
}

.lang-switcher {
    position: relative;
    font-family: inherit;
    z-index: 40;
}

.lang-btn {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #d6e4f8;
    border-radius: 4px;
    padding: 0.45rem 0.7rem;
    font-size: 0.62rem;
    cursor: pointer;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface-strong);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 4000;
    min-width: 74px;
}

.lang-switcher:hover .lang-dropdown {
    display: flex;
}

.lang-switcher:focus-within .lang-dropdown {
    display: flex;
}

.lang-dropdown a {
    padding: 0.5rem 0.7rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.62rem;
}

.lang-dropdown a:hover {
    background: rgba(255, 183, 3, 0.18);
    color: #fff;
}

.hero {
    padding: 2.2rem 0 1rem;
    display: grid;
    gap: 1.3rem;
}

.hero-content {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.84), rgba(30, 41, 59, 0.63));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(166, 180, 200, 0.22);
    position: relative;
}

.hero-content::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    top: 10px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 69, 0.78), transparent);
}

.hero-content h1 {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.2;
    margin-bottom: 0.85rem;
}

.hero-content p {
    font-size: clamp(1.35rem, 2.5vw, 1.62rem);
    color: var(--muted);
    max-width: 760px;
    margin: 0 auto 1.4rem;
}

.btn {
    display: inline-block;
    padding: 0.95rem 1.65rem;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    border-radius: 4px;
    border: 0;
}

.btn-primary {
    background: linear-gradient(180deg, #ffd166 0%, #ffb703 48%, #ff7a45 100%);
    color: #2b1203;
    border: 2px solid #fff4d6;
    box-shadow:
        0 0 0 3px rgba(255, 122, 69, 0.4),
        0 10px 26px rgba(255, 122, 69, 0.45),
        5px 5px 0 #7a3216;
    transition: 0.2s ease;
    transform: translateY(0);
    font-size: 0.98rem;
    padding: 1.15rem 2rem;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 0 0 3px rgba(255, 183, 3, 0.55),
        0 16px 34px rgba(255, 122, 69, 0.55),
        7px 7px 0 #7a3216;
}

.btn-primary .version-tag {
    display: block;
    margin-top: 0.55rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(43, 18, 3, 0.35);
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(43, 18, 3, 0.92);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(217, 70, 239, 0.45);
    background: rgba(30, 41, 59, 0.75);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.68rem;
    text-decoration: none;
    transition: 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(217, 70, 239, 0.18);
    border-color: rgba(217, 70, 239, 0.7);
    transform: translateY(-2px);
}

.seo-intro {
    margin: 1.6rem 0 2rem;
    padding: 1.2rem 1.3rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(166, 180, 200, 0.18);
    line-height: 1.65;
}

.public-stats {
    margin: 1.2rem 0 1.6rem;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.55));
    border: 1px solid rgba(255, 122, 69, 0.22);
    box-shadow: 0 12px 30px rgba(2, 8, 23, 0.28);
}

.public-stats-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.public-stats-heading .section-heading {
    margin-bottom: 0;
}

.stats-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 122, 69, 0.35);
    background: rgba(255, 122, 69, 0.12);
    color: #ffd7a6;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stats-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #ff7a45;
    box-shadow: 0 0 10px rgba(255, 122, 69, 0.8);
    animation: stats-pulse 1.8s ease-in-out infinite;
}

@keyframes stats-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.7rem;
}

.stat-card {
    padding: 0.9rem 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.16);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: clamp(1.1rem, 2.2vw, 1.55rem);
    color: #ffe7c1;
    line-height: 1.1;
    margin-bottom: 0.35rem;
    text-shadow: 0 0 14px rgba(255, 183, 3, 0.18);
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.3;
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.stats-panel {
    padding: 0.95rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.38);
    border: 1px solid rgba(166, 180, 200, 0.14);
}

.stats-panel h3 {
    font-size: 0.85rem;
    color: #d8f9ee;
    margin-bottom: 0.75rem;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.stats-bar-label {
    font-size: 0.72rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-bar-track {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a45, #ffb703);
}

.stats-bar-value {
    font-size: 0.72rem;
    color: #ffd7a6;
    min-width: 2rem;
    text-align: right;
}

.stats-trending-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-trending-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.stats-trending-list a {
    color: #e2e8f0;
    text-decoration: none;
}

.stats-trending-list a:hover {
    color: #ffd7a6;
}

.stats-cta {
    margin-top: 1rem;
    text-align: center;
}

.stats-detail-btn {
    min-width: 12rem;
}

/* Detailed stats page */
.stats-page {
    margin: 1.5rem 0 2rem;
}

.stats-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stats-page-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #f8fafc;
    margin-bottom: 0.35rem;
}

.stats-page-intro {
    color: var(--muted);
    font-size: 0.85rem;
    max-width: 36rem;
}

.stats-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(166, 180, 200, 0.16);
}

.stats-range-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.stats-range-btns .btn-sm {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
}

.stats-range-btns .btn.active {
    background: rgba(217, 70, 239, 0.25);
    border-color: rgba(217, 70, 239, 0.55);
    color: #f5d0fe;
}

.stats-compare {
    font-size: 0.82rem;
    color: var(--muted);
}

.stats-compare.positive { color: #10b981; }
.stats-compare.negative { color: #ef4444; }

.stats-summary-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.stats-summary-card {
    padding: 0.85rem;
    text-align: center;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.14);
}

.stats-summary-label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stats-summary-value {
    font-size: clamp(1rem, 2vw, 1.45rem);
    font-weight: 700;
    color: #f8fafc;
}

.stats-value-green { color: #10b981; }
.stats-value-blue { color: #3b82f6; }
.stats-value-orange { color: #f59e0b; }

.stats-retention-sep {
    color: var(--muted);
    font-size: 0.9em;
    margin: 0 0.15rem;
}

.stats-main-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
}

.stats-dau-card,
.stats-chart-card {
    grid-column: span 4;
    height: 22rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.14);
}

.stats-feed-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    height: 22rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.14);
}

.stats-feed-card h3,
.stats-chart-panel h3,
.stats-top-downloads h3 {
    font-size: 0.9rem;
    color: #d8f9ee;
    margin-bottom: 0.65rem;
}

.stats-feed-window {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.28);
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.stats-feed-placeholder {
    color: var(--muted);
    text-align: center;
    margin-top: 1.5rem;
}

.stats-feed-item {
    line-height: 1.35;
}

.stats-feed-time {
    color: #64748b;
    margin-right: 0.35rem;
}

.stats-feed-meta {
    color: #94a3b8;
    font-size: 0.9em;
}

.stats-feed-tag {
    font-weight: 700;
}

.stats-feed-new { color: #f59e0b; }
.stats-feed-return { color: #3b82f6; }
.stats-feed-dl { color: #10b981; }

.stats-chart-panel {
    grid-column: span 2;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.14);
}

.stats-chart-wide {
    grid-column: span 6;
}

.stats-mini-chart {
    height: 13rem;
    position: relative;
}

.stats-peak-chart {
    height: 13rem;
    position: relative;
}

.stats-top-downloads {
    grid-column: span 6;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(7, 11, 20, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.14);
    max-height: 22rem;
    display: flex;
    flex-direction: column;
}

.stats-top-header {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 6rem;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    padding: 0 0.85rem 0.5rem 0;
    border-bottom: 1px solid rgba(166, 180, 200, 0.12);
}

.stats-top-header-count {
    text-align: right;
    padding-right: 0.15rem;
}

.stats-top-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 0.85rem;
    scrollbar-gutter: stable;
}

.stats-top-list::-webkit-scrollbar {
    width: 6px;
}

.stats-top-list::-webkit-scrollbar-track {
    background: transparent;
}

.stats-top-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.stats-top-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 6rem;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(166, 180, 200, 0.08);
    font-size: 1rem;
    color: #cbd5e1;
}

.stats-top-rank {
    color: #ffd7a6;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
}

.stats-top-title a {
    color: #e2e8f0;
    text-decoration: none;
}

.stats-top-title a:hover {
    color: #ffd7a6;
}

.stats-top-count {
    color: #ffd7a6;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    min-width: 6rem;
    padding-right: 0.15rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.stats-top-placeholder {
    color: var(--muted);
    text-align: center;
    padding: 1rem;
}

.stats-page-footer {
    margin-top: 1.2rem;
    text-align: center;
}

@media (max-width: 900px) {
    .stats-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-dau-card,
    .stats-feed-card,
    .stats-chart-panel,
    .stats-chart-wide,
    .stats-top-downloads {
        grid-column: span 6;
    }

    .stats-dau-card,
    .stats-feed-card {
        height: auto;
        min-height: 16rem;
    }
}

@media (max-width: 600px) {
    .stats-summary-row {
        grid-template-columns: 1fr;
    }

    .stats-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

.stats-rank {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 122, 69, 0.18);
    color: #ffd7a6;
    font-size: 0.58rem;
}

.stats-trend-count {
    color: #ffb703;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 3rem;
    text-align: right;
    padding-right: 0.25rem;
}

.seo-intro p {
    margin: 0 0 1rem;
    color: #cbd5e1;
    font-size: 1rem;
}

.seo-intro p:last-child {
    margin-bottom: 0;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    font-size: clamp(1rem, 2vw, 1.35rem);
    margin-bottom: 0.35rem;
    color: #d8f9ee;
}

.section-heading p {
    color: var(--muted);
    font-size: 1rem;
}

.section-cta {
    margin-top: 1rem;
    text-align: center;
}

.popular-section,
.reviews-section {
    margin: 2rem 0;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(166, 180, 200, 0.16);
}

.popular-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.popular-heading .section-heading {
    margin-bottom: 0;
}

.popular-controls {
    display: flex;
    gap: 0.45rem;
    flex-shrink: 0;
}

.popular-nav,
.reviews-nav {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: 1px solid rgba(217, 70, 239, 0.45);
    background: rgba(30, 41, 59, 0.85);
    color: #f5d0fe;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.15);
}

.popular-nav:hover:not(:disabled),
.reviews-nav:hover:not(:disabled) {
    background: rgba(217, 70, 239, 0.22);
    border-color: rgba(217, 70, 239, 0.75);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(217, 70, 239, 0.35);
}

.popular-nav:disabled,
.reviews-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.popular-slider {
    position: relative;
    margin: 0 -0.35rem;
}

.popular-track {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.35rem 0.35rem 0.65rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.popular-track::-webkit-scrollbar {
    display: none;
}

.popular-fade {
    position: absolute;
    top: 0;
    bottom: 0.3rem;
    width: 2.5rem;
    pointer-events: none;
    z-index: 2;
}

.popular-fade-left {
    left: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), transparent);
}

.popular-fade-right {
    right: 0;
    background: linear-gradient(270deg, rgba(15, 23, 42, 0.95), transparent);
}

.popular-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 0 0 clamp(148px, 32vw, 196px);
    scroll-snap-align: start;
    padding: 0.7rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid rgba(166, 180, 200, 0.2);
    text-decoration: none;
    transition: 0.25s ease;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.25);
}

.popular-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(217, 70, 239, 0.55);
    box-shadow:
        0 12px 28px rgba(2, 8, 23, 0.35),
        0 0 16px rgba(217, 70, 239, 0.2);
}

.popular-cover-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
}

.popular-cover-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 11, 20, 0.55));
    pointer-events: none;
}

.popular-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.popular-card:hover .popular-cover {
    transform: scale(1.06);
}

.popular-title {
    font-size: 0.64rem;
    color: #e2e8f0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.popular-system {
    font-size: 0.54rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.popular-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
    min-height: 0.85rem;
}

.popular-dot,
.reviews-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    border: 1px solid rgba(217, 70, 239, 0.45);
    background: rgba(30, 41, 59, 0.7);
    padding: 0;
    cursor: pointer;
    transition: 0.2s ease;
}

.popular-dot.active,
.reviews-dot.active {
    background: #d946ef;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.65);
    transform: scale(1.15);
}

.popular-dot:hover:not(.active),
.reviews-dot:hover:not(.active) {
    background: rgba(217, 70, 239, 0.35);
}

.reviews-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reviews-heading .section-heading {
    margin-bottom: 0;
}

.reviews-controls {
    display: flex;
    gap: 0.45rem;
    flex-shrink: 0;
}

.reviews-slider {
    position: relative;
    margin: 0 -0.35rem;
}

.reviews-track {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.35rem 0.35rem 0.65rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.reviews-track::-webkit-scrollbar {
    display: none;
}

.reviews-fade {
    position: absolute;
    top: 0;
    bottom: 0.3rem;
    width: 2.5rem;
    pointer-events: none;
    z-index: 2;
}

.reviews-fade-left {
    left: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), transparent);
}

.reviews-fade-right {
    right: 0;
    background: linear-gradient(270deg, rgba(15, 23, 42, 0.95), transparent);
}

.reviews-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
    min-height: 0.85rem;
}

.reviews-rating {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.reviews-stars,
.review-stars {
    color: #fbbf24;
    letter-spacing: 0.05em;
}

.reviews-score {
    font-size: 1.1rem;
    color: #fde68a;
}

.reviews-count {
    color: var(--muted);
    font-size: 0.9rem;
}

.review-card {
    flex: 0 0 clamp(280px, 78vw, 360px);
    scroll-snap-align: start;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid rgba(166, 180, 200, 0.2);
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.25);
    transition: 0.25s ease;
}

.review-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 183, 3, 0.45);
    box-shadow:
        0 12px 28px rgba(2, 8, 23, 0.35),
        0 0 14px rgba(255, 183, 3, 0.15);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.review-author {
    font-size: 0.62rem;
    color: #d8f9ee;
}

.review-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.review-date {
    display: block;
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid rgba(166, 180, 200, 0.2);
    box-shadow: 0 8px 22px rgba(2, 8, 23, 0.3);
    transition: 0.2s ease;
    position: relative;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ffb703;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.7);
}

.feature-card:hover {
    transform: translateY(-3px);
    background: rgba(30, 41, 59, 0.82);
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0.55rem;
    display: block;
}

.feature-card h3 {
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
    color: #d8f9ee;
}

.feature-card p {
    font-size: 1.2rem;
    color: var(--muted);
}

.gold-section {
    margin: 2.2rem 0;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(146, 64, 14, 0.5), rgba(30, 41, 59, 0.8));
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gold-logo {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
}

.gold-info h2 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.gold-info p {
    font-size: 1.2rem;
    color: #fde6be;
}

.badge-soon {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.28rem 0.55rem;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.2);
    color: #ffebc5;
    font-family: inherit;
    font-size: 0.56rem;
}

.roms-list {
    padding: 1.8rem 0;
}

.roms-page-title {
    margin-bottom: 0.65rem;
    font-size: clamp(1.18rem, 2.3vw, 1.8rem);
}

.roms-page-intro {
    margin-bottom: 1.2rem;
    color: var(--muted);
    font-size: 1rem;
    max-width: 72ch;
}

.filter-container {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 1.3rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border: 1px solid rgba(166, 180, 200, 0.2);
}

.search-wrapper,
.select-wrapper {
    flex: 1;
    min-width: 220px;
}

.filter-input,
.filter-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 3px;
    color: #ecf4ff;
    padding: 0.5rem 0.7rem;
    font-family: 'VT323', monospace;
    font-size: 1.35rem;
    outline: none;
}

.filter-input:focus,
.filter-select:focus {
    border-color: rgba(255, 122, 69, 0.7);
}

.roms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
}

.rom-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid rgba(166, 180, 200, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.25);
    transition: 0.2s ease;
    position: relative;
}

.rom-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffb703, #ff7a45);
}

.rom-card:hover {
    transform: translateY(-3px);
    background: rgba(30, 41, 59, 0.85);
}

.rom-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    display: block;
    object-fit: cover;
    image-rendering: auto;
}

.rom-info {
    padding: 0.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.rom-title {
    font-size: 1.3rem;
    color: #f6fbff;
    margin-bottom: 0.45rem;
    line-height: 1.12;
}

.rom-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.65rem;
}

.rom-system {
    font-family: inherit;
    font-size: 0.66rem;
    color: #ffd89a;
    text-transform: uppercase;
}

.rom-size {
    color: var(--muted);
    font-size: 1.08rem;
}

.rom-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.pagination {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    border-radius: 3px;
    text-decoration: none;
    font-size: 1.05rem;
    color: #ffeacc;
    background: rgba(255, 183, 3, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.page-btn.active {
    background: rgba(255, 122, 69, 0.38);
    color: #fff;
}

.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #ffd7a6;
    opacity: 0.75;
}

.btn-rom {
    min-height: 42px;
    padding: 0.68rem 0.6rem;
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-download {
    background: rgba(255, 183, 3, 0.3);
    color: #fff7e3;
}

.btn-play {
    background: rgba(255, 122, 69, 0.34);
    color: #fff4ea;
}

.btn-play-lg {
    min-height: 46px;
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
}

.game-page-actions .btn,
.game-page-actions .btn-play-lg {
    min-width: 180px;
}

.game-page-actions .btn {
    font-size: 0.92rem;
}

.game-detail {
    padding: 1.8rem 0;
}

.game-breadcrumb {
    margin-bottom: 1rem;
}

.game-breadcrumb a {
    color: #ffd89a;
    text-decoration: none;
    font-size: 1.35rem;
}

.game-main {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.game-visual,
.game-content {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid rgba(166, 180, 200, 0.2);
    box-shadow: 0 8px 22px rgba(2, 8, 23, 0.28);
}

.game-visual {
    padding: 0.7rem;
    align-self: start;
}

.game-page-cover {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.game-content {
    padding: 1rem;
}

.game-page-title {
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    margin-bottom: 0.75rem;
}

.game-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 1.22rem;
}

.game-page-system {
    color: #ffd89a;
}

.game-page-size {
    color: #fde68a;
}

.game-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.game-description-box {
    padding: 0.9rem;
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(166, 180, 200, 0.2);
}

.game-description-box h3 {
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
    color: #ffd89a;
}

.game-description-text {
    font-size: 1.22rem;
    color: #d7e4f8;
}

#lift-btn {
    position: fixed;
    bottom: 1.1rem;
    right: 1.1rem;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 122, 69, 0.88);
    color: #2c1306;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    font-family: inherit;
    font-weight: 700;
}

#lift-btn.visible {
    opacity: 1;
    visibility: visible;
}

footer {
    padding: 1.9rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 1.16rem;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .crt-overlay,
    .crt-flicker {
        display: none;
    }

    #bg-canvas {
        opacity: 0.38;
    }

    header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    nav {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-details {
        grid-template-columns: 1fr;
    }

    .public-stats-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-live-badge {
        align-self: flex-start;
    }

    .popular-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .popular-controls,
    .reviews-controls {
        justify-content: flex-end;
    }

    .popular-fade,
    .reviews-fade {
        width: 1.5rem;
    }

    .reviews-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .gold-section {
        flex-direction: column;
        text-align: center;
    }

    .rom-actions {
        grid-template-columns: 1fr;
    }

    .btn-primary {
        width: 100%;
        max-width: 320px;
    }
}
