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

:root {
    --bg: #0e141b;
    --bg-elevated: #151d27;
    --surface: #18222e;
    --surface-2: #1f2b39;
    --surface-hover: #253447;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #c7d0db;
    --text-muted: #8f9bab;
    --text-faint: #66727f;
    --heading: #ffffff;
    --primary: #66c0f4;
    --primary-strong: #1a9fff;
    --primary-soft: rgba(102, 192, 244, 0.14);
    --positive: #66c0f4;
    --mixed: #e0b44c;
    --negative: #e5675c;
    --sale: #a4d007;
    --gold: #f2c94c;
    --silver: #c9d3de;
    --bronze: #d99a6c;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --font: "Inter", "Motiva Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

html {
    scroll-padding-top: 80px;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(26, 159, 255, 0.10), transparent 60%),
        var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    color: inherit;
}

a {
    color: var(--primary);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

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

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(14, 20, 27, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top);
}

.topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.flag-icon {
    width: 30px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    color: var(--heading);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9be15d;
    background: rgba(155, 225, 93, 0.1);
    border: 1px solid rgba(155, 225, 93, 0.25);
    padding: 5px 12px;
    border-radius: 999px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9be15d;
    box-shadow: 0 0 0 0 rgba(155, 225, 93, 0.6);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(155, 225, 93, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(155, 225, 93, 0); }
    100% { box-shadow: 0 0 0 0 rgba(155, 225, 93, 0); }
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 24px 0;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #47bfff, var(--primary-strong));
    color: #fff;
    box-shadow: 0 6px 18px rgba(26, 159, 255, 0.35);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ---------- Spotlight ---------- */

.spotlight {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    isolation: isolate;
}

.spotlight-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center 30%;
    transform: scale(1.02);
    transition: opacity 0.6s;
}

.spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 14, 19, 0.92) 0%, rgba(10, 14, 19, 0.6) 45%, rgba(10, 14, 19, 0.15) 100%),
        linear-gradient(0deg, rgba(10, 14, 19, 0.85) 0%, transparent 55%);
}

.spotlight.is-loading .spotlight-bg {
    opacity: 0;
}

.spotlight-content {
    width: 100%;
    padding: 36px 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.spotlight-game {
    max-width: 560px;
    min-width: 0;
}

.eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}

.spotlight-logo {
    display: block;
    max-width: min(360px, 100%);
    max-height: 130px;
    object-fit: contain;
    object-position: left bottom;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
    margin-bottom: 12px;
}

.spotlight-name {
    margin: 0 0 6px;
    color: var(--heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.spotlight-meta {
    margin: 0 0 20px;
    color: #dde5ee;
    font-size: 0.95rem;
}

.spotlight-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spotlight-numbers {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.big-number {
    display: flex;
    flex-direction: column;
    padding: 16px 22px;
    border-radius: var(--radius);
    background: rgba(12, 17, 23, 0.55);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 180px;
}

.big-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.big-number:first-child .big-value {
    background: linear-gradient(180deg, #fff 10%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.big-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.big-number.total .big-value {
    font-size: 1.6rem;
}

/* ---------- Highlight stat cards ---------- */

#global-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0 28px;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 2px;
    min-height: 150px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    isolation: isolate;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.stat-art {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(10, 14, 19, 0.96) 15%, rgba(10, 14, 19, 0.55) 60%, rgba(10, 14, 19, 0.25) 100%);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.stat-card:hover .stat-art {
    transform: scale(1.06);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary);
}

.stat-label .est {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: none;
}

.stat-name {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.stat-sub-value {
    font-size: 0.85rem;
    color: #dde5ee;
    font-variant-numeric: tabular-nums;
}

/* ---------- Layout & cards ---------- */

.layout-container {
    display: grid;
    grid-template-columns: minmax(380px, 460px) 1fr;
    gap: 24px;
    align-items: stretch;
}

.main-content,
.sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content > .card,
.sidebar > .card {
    flex: 1;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.card-head h2,
.library-head h2 {
    margin: 0;
    color: var(--heading);
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---------- Tabs ---------- */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-elevated);
    border-radius: 999px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    background: var(--surface-hover);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Leaderboard ---------- */

.leaderboard {
    --lb-row-height: 66px;
    list-style: none;
    margin: 0;
    padding: 0 4px 0 0;
    /* Ten and a half rows: the cut-off row hints that the list scrolls */
    max-height: calc(var(--lb-row-height) * 10.5);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-hover) transparent;
}

.leaderboard::-webkit-scrollbar {
    width: 6px;
}

.leaderboard::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 3px;
}

.lb-row {
    display: grid;
    grid-template-columns: 26px 92px minmax(0, 1fr) auto 32px;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.lb-row:hover {
    background: var(--surface-2);
}

.lb-rank {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

.top-1 .lb-rank,
.top-2 .lb-rank,
.top-3 .lb-rank {
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    color: #10161d;
    font-size: 0.75rem;
}

.top-1 .lb-rank { background: var(--gold); }
.top-2 .lb-rank { background: var(--silver); }
.top-3 .lb-rank { background: var(--bronze); }

.lb-thumb {
    width: 92px;
    height: 43px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--surface-2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.lb-thumb.img-missing {
    visibility: hidden;
}

.lb-main {
    min-width: 0;
}

.lb-name {
    display: block;
    max-width: 100%;
    background: none;
    border: none;
    padding: 0;
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-name:hover {
    color: var(--primary);
}

.lb-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 0;
    margin-top: 1px;
}

.lb-studio {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.lb-bar {
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    margin-top: 6px;
    overflow: hidden;
}

.lb-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-strong), var(--primary));
}

.lb-bar.score-mixed span { background: var(--mixed); }
.lb-bar.score-negative span { background: var(--negative); }

.lb-value {
    min-width: 64px;
    text-align: right;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    white-space: nowrap;
}

.lb-value small {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.lb-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.price-tag {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.price-tag.sale {
    background: rgba(164, 208, 7, 0.15);
    color: var(--sale);
}

.methodology-note {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.methodology-note summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.methodology-note summary:hover {
    color: #fff;
}

.methodology-note p {
    margin: 8px 0 0;
    line-height: 1.55;
}

/* ---------- Compare buttons ---------- */

.compare-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.compare-btn:hover {
    border-color: var(--primary);
    color: #fff;
}

.compare-btn.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.compare-btn.icon-only {
    width: 30px;
    height: 30px;
    padding: 0;
}

.compare-btn.icon-only .compare-label {
    display: none;
}

.compare-btn.wide {
    width: 100%;
    padding: 9px;
    margin-top: auto;
}

/* ---------- Comparison dashboard ---------- */

.range-picker {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.range-btn {
    background: none;
    border: none;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.range-btn:hover {
    color: #fff;
}

.range-btn.active {
    background: var(--surface-hover);
    color: #fff;
}

.custom-range {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.custom-range label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

select,
input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: #fff;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    color-scheme: dark;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

select:disabled {
    opacity: 0.5;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

#compare-selector {
    max-width: 280px;
}

.comparison-tags {
    display: contents;
}

.comparison-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px 3px 3px;
    border-radius: 999px;
    border: 1px solid var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 14%, transparent);
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    max-width: 260px;
}

.comparison-tag img {
    width: 44px;
    height: 22px;
    object-fit: cover;
    border-radius: 999px;
    flex-shrink: 0;
}

.comparison-tag span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-tag button {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.comparison-tag button:hover {
    background: var(--negative);
}

.chart-area {
    flex: 1;
    min-height: 340px;
    display: flex;
}

.chart-area > * {
    flex: 1;
}

.placeholder-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.placeholder-msg svg {
    color: var(--primary);
    opacity: 0.8;
}

.placeholder-msg h3 {
    color: #fff;
    margin: 12px 0 6px;
    font-size: 1.05rem;
}

.placeholder-msg p {
    margin: 0;
    max-width: 380px;
    font-size: 0.88rem;
}

.chart-container {
    position: relative;
    min-width: 0;
}

.comparison-chart {
    min-height: 340px;
}

.chart-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.chart-empty strong {
    color: var(--text);
    font-weight: 600;
}

.chart-empty-desc {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Library ---------- */

#library {
    margin-top: 40px;
}

.library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.count-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    vertical-align: middle;
}

.library-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-container input {
    width: 260px;
    padding-left: 38px;
    border-radius: 999px;
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid var(--border-strong);
    background: none;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.chip:hover {
    color: #fff;
}

.chip.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.sort-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sort-select select {
    border-radius: 999px;
    padding: 7px 12px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* ---------- Game card ---------- */

.game-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    min-width: 0;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.game-card.flash {
    animation: flash 1.6s ease;
}

@keyframes flash {
    0%, 40% { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), 0 0 40px rgba(102, 192, 244, 0.35); }
    100% { }
}

.game-art {
    position: relative;
    aspect-ratio: 460 / 215;
    background:
        linear-gradient(135deg, #1d3a55, #13202d);
    overflow: hidden;
}

.game-art img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.game-card:hover .game-art img {
    transform: scale(1.05);
}

.game-art img.img-missing {
    visibility: hidden;
}

.art-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
}

.game-art::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    z-index: 1;
    background: linear-gradient(0deg, rgba(10, 14, 19, 0.75), transparent);
    pointer-events: none;
}

.art-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.art-live {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(10, 14, 19, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.game-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    flex: 1;
}

.game-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.game-title {
    min-width: 0;
}

.game-title h3 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.game-studio {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.game-links {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    transition: color 0.2s, background 0.2s;
}

.icon-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.game-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.game-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    min-width: 0;
}

.game-stat .label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-faint);
}

.game-stat .value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-stat .label span {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.game-stat .value small {
    display: block;
    white-space: normal;
    line-height: 1.3;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-positive { color: var(--positive); }
.score-mixed { color: var(--mixed); }
.score-negative { color: var(--negative); }

.art-price {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 6px;
    background: rgba(10, 14, 19, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.art-price.sale {
    padding-left: 0;
    overflow: hidden;
    color: #beee11;
}

.art-price .discount {
    align-self: stretch;
    display: flex;
    align-items: center;
    margin: -4px 0;
    padding: 0 7px;
    background: #4c6b22;
    color: #beee11;
}

.art-price s {
    color: var(--text-muted);
    font-weight: 500;
}

.game-chart {
    height: 150px;
}

.chart-skeleton {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.art-badges .badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.badge-upcoming {
    background: #6b4fd8;
    color: #fff;
}

.badge-early-access {
    background: #d9822b;
    color: #fff;
}

.badge-delisted {
    background: #5b6470;
    color: #fff;
}

/* ---------- Toast & footer ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: #fff;
    color: #10161d;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100;
    max-width: calc(100% - 32px);
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

footer {
    max-width: 1600px;
    margin: 48px auto 0;
    padding: 24px 24px calc(32px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.8rem;
    text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .layout-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    #global-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .spotlight-content {
        padding: 28px 24px;
    }
}

@media (max-width: 600px) {
    main {
        padding: 16px 16px 0;
    }

    .topbar-inner {
        padding: 10px 16px;
    }

    .brand-sub {
        display: none;
    }

    .spotlight {
        min-height: 0;
        border-radius: var(--radius);
    }

    .spotlight-content {
        padding: 80px 18px 20px;
        gap: 18px;
    }

    .spotlight-logo {
        max-height: 80px;
    }

    .spotlight-numbers {
        width: 100%;
    }

    .big-number {
        flex: 1;
        min-width: 0;
        padding: 12px 14px;
    }

    .big-value {
        font-size: 1.8rem;
    }

    .big-number.total .big-value {
        font-size: 1.3rem;
    }

    #global-stats {
        gap: 10px;
    }

    .stat-card {
        min-height: 120px;
        padding: 14px;
    }

    .stat-name {
        font-size: 0.98rem;
    }

    .card {
        padding: 16px;
    }

    .lb-row {
        grid-template-columns: 22px 64px minmax(0, 1fr) auto 30px;
        gap: 8px;
        padding: 8px 4px;
    }

    .lb-thumb {
        width: 64px;
        height: 30px;
    }

    .leaderboard {
        --lb-row-height: 62px;
    }

    .lb-sub .price-tag {
        display: none;
    }

    .tab-btn {
        padding: 7px 8px;
        font-size: 0.75rem;
    }

    .library-toolbar,
    .search-container,
    .search-container input,
    #compare-selector {
        width: 100%;
        max-width: none;
    }

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

    .comparison-chart,
    .chart-area {
        height: 280px;
        min-height: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
