/* ----------------------------------------------------
   SteamLens Minimalist CSS Design - Warm Paper & Sage Green Palette (简约暖沙与森林绿配色)
   ---------------------------------------------------- */
:root {
    --bg-dark: #d5e0ea;           /* Soft Slate Blue Gray (distinctly colored, completely non-white) */
    --bg-sidebar: #b9c9dc;        /* Deep Slate Blue Gray for sidebar */
    --bg-card: #f8fafc;           /* Soft Slate White / Light tint (not pure blinding white) */
    --bg-card-hover: #f1f5f9;
    --border-color: #b8c7d9;      /* Slate Blue Border */
    --border-hover: #9ab0ca;
    
    /* Premium Indigo & Teal Slate Palette */
    --steam-blue: #4f46e5;        /* Deep Indigo (Primary Accent) */
    --trap-red: #ef4444;          /* Modern Red (Trap/Warning) */
    --safe-green: #10b981;        /* Emerald / Teal (Safe/Positive) */
    --caution-yellow: #f59e0b;    /* Amber (Caution) */
    --neutral-gray: #64748b;      /* Muted Slate Gray */

    /* Text Colors */
    --text-primary: #0f172a;      /* Slate 900 for high legibility */
    --text-secondary: #334155;    /* Slate 700 */
    --text-muted: #64748b;        /* Slate 500 */

    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    /* Layout Configurations */
    --sidebar-width: 240px;
    --border-radius-lg: 8px;      /* Slightly rounder for modern app feel */
    --border-radius-md: 6px;
    --border-radius-sm: 4px;
    --transition-smooth: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--steam-blue);
}

/* App Container Layout - Fullscreen Fluid Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;                  /* Expanded to 100% width, no left/right margins */
    background: var(--bg-dark);
}

/* ----------------------------------------------------
   Sidebar Navigation (Warm Paper Style)
   ---------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    padding: 35px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--bg-sidebar);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding: 0 24px;
}

.brand-logo {
    font-size: 1.6rem;
    color: var(--steam-blue);
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.brand-text span {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    border-left: 3px solid transparent;
}

.nav-item i {
    font-size: 0.95rem;
    width: 16px;
    text-align: center;
}

.nav-item:hover {
    color: var(--steam-blue);
    background: rgba(79, 70, 229, 0.04);
}

.nav-item.active {
    color: var(--steam-blue);
    background: rgba(79, 70, 229, 0.08);
    border-left: 3px solid var(--steam-blue);
    font-weight: 600;
}

.system-status {
    margin: auto 20px 0 20px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.2);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--steam-blue);
}

.status-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.68rem;
}

.status-meta div {
    display: flex;
    justify-content: space-between;
}

.status-meta .label {
    color: var(--text-muted);
}

.status-meta .val {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ----------------------------------------------------
   Main Content Area & Topbar
   ---------------------------------------------------- */
.main-content {
    flex-grow: 1;
    padding: 35px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: 100vh;
    background-color: var(--bg-dark); /* Explicit contrast background */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.top-search-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(540px, 100%);
}

.search-box {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    border-color: var(--steam-blue);
    box-shadow: 0 0 0 3px rgba(53, 94, 59, 0.12);
}

.btn-reset-recommendation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 39px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-reset-recommendation:hover {
    border-color: var(--steam-blue);
    color: var(--steam-blue);
    background: rgba(53, 94, 59, 0.06);
}

.btn-reset-recommendation:focus-visible {
    outline: none;
    border-color: var(--steam-blue);
    box-shadow: 0 0 0 3px rgba(53, 94, 59, 0.12);
}

.steam-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: 390px;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.13);
    z-index: 30;
}

.steam-search-results.active {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.steam-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
}

.steam-search-heading small {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
}

.steam-search-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.steam-result-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.steam-result-row:hover {
    border-color: var(--border-color);
    background: var(--bg-card-hover);
}

.steam-result-cover {
    width: 92px;
    aspect-ratio: 460 / 215;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-card-hover);
}

.steam-result-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.steam-result-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.steam-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.steam-result-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.steam-result-meta strong {
    flex-shrink: 0;
    color: var(--steam-blue-dark);
}

.steam-result-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 72px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--steam-blue);
    border-radius: var(--border-radius-sm);
    background: var(--steam-blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.steam-result-add:hover:not(:disabled) {
    background: var(--steam-blue-dark);
    border-color: var(--steam-blue-dark);
}

.steam-result-add:disabled {
    cursor: default;
    color: var(--text-muted);
    border-color: var(--border-color);
    background: var(--bg-card-hover);
}

/* Tab Panels */
.tab-pane {
    display: none;
    flex-direction: column;
    gap: 30px;
}

.tab-pane.active {
    display: flex;
}

/* ----------------------------------------------------
   TAB 1: STATS GRID & TOOLBAR
   ---------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(41, 37, 34, 0.03); /* Soft shadow on card panels */
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(41, 37, 34, 0.05);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
}

.stat-info h3 {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Toolbar & Filters */
.toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(41, 37, 34, 0.03);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.btn-filter {
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.btn-filter:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-filter.active {
    color: #fff;
    background: var(--steam-blue);
    border-color: var(--steam-blue);
}

/* Switch Container */
.switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    user-select: none;
    font-weight: 500;
}

.switch-container input {
    display: none;
}

.slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background-color: var(--border-color);
    transition: .2s;
    border-radius: 9px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: .2s;
    border-radius: 50%;
}

.switch-container input:checked + .slider {
    background-color: var(--steam-blue);
}

.switch-container input:checked + .slider::before {
    transform: translateX(16px);
}

.section-title-bar {
    border-left: 3px solid var(--steam-blue);
    padding-left: 12px;
}

.section-title-bar h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-title-bar .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ----------------------------------------------------
   GAMES RECOMMENDATION GRID & CARDS
   ---------------------------------------------------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(41, 37, 34, 0.03);
}

.game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(41, 37, 34, 0.06);
}

/* Vibrant Indigo style Game Cover */
.game-cover {
    height: 100px;
    position: relative;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.game-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}

.game-card:hover .game-cover-image {
    transform: scale(1.04);
}

.game-cover .game-title-hero {
    font-family: var(--font-display);
    display: none;
    position: relative;
    z-index: 1;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    padding: 0 16px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
}

.game-cover.cover-load-failed .game-title-hero {
    display: block;
}

.game-card.trap-warn .game-cover {
    background: linear-gradient(135deg, #f87171 0%, #f97316 100%);
}

.game-card.trap-warn .game-cover .game-title-hero {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
}

.game-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.game-card-title-block {
    flex: 1 1 auto;
    min-width: 0;
}

.game-card-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 4px;
}

.game-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

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

.game-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.game-tags-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: -4px;
}

.tag-badge-inline {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 8px;
    background: #e2e8f0;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.metric-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric-value {
    font-weight: 600;
    font-family: var(--font-display);
}

.pref-color {
    color: var(--steam-blue);
}

.rating-bar-outer {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.rating-bar-inner {
    height: 100%;
    border-radius: 2px;
}

.bg-blue {
    background: var(--steam-blue);
}

/* Warnings on Cards */
.game-card.trap-warn {
    border-color: rgba(194, 65, 12, 0.25);
}

.game-card.trap-warn:hover {
    border-color: var(--trap-red);
}

.trap-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--trap-red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(194, 65, 12, 0.15);
}

.trap-badge.medium {
    background: var(--caution-yellow);
    color: #fff;
}

.trap-color-high { color: var(--trap-red); }
.trap-color-medium { color: var(--caution-yellow); }
.trap-color-low { color: var(--safe-green); }

.card-footer-tip {
    font-size: 0.68rem;
    color: var(--text-secondary);
    background: #fee2e2;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #fca5a5;
}

.card-footer-tip i {
    color: var(--trap-red);
    margin-right: 3px;
}

/* ----------------------------------------------------
   TAB 2: WEIGHT TUNER LAYOUT
   ---------------------------------------------------- */
.tuner-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 30px;
    align-items: start;
}

.tuner-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(41, 37, 34, 0.04);
}

.tuner-panel h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tuner-panel .description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.weight-value {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--steam-blue);
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Range Input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid var(--steam-blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.slider-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.divider {
    height: 1px;
    background: var(--border-color);
}

.formula-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
}

.formula-score-card {
    padding: 12px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
}

.formula-score-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
}

.formula-score-name {
    color: var(--steam-blue);
    font-family: var(--font-display);
}

.formula-equals,
.formula-minus {
    color: var(--text-muted);
    font-weight: 800;
}

.formula-positive-term,
.formula-risk-term {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.formula-positive-term {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
}

.formula-risk-term {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.formula-score-card p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.73rem;
    line-height: 1.5;
    text-align: center;
}

.formula-weight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.formula-weight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
}

.formula-weight-item span {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.formula-weight-item strong {
    flex-shrink: 0;
    color: var(--steam-blue);
    font-size: 0.76rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.formula-weight-item.risk strong {
    color: var(--trap-red);
}

.formula-weight-item.risk {
    background: rgba(239, 68, 68, 0.04);
}

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

@media (max-width: 560px) {
    .formula-weight-grid {
        grid-template-columns: 1fr;
    }

    .formula-score-main {
        justify-content: flex-start;
    }

    .formula-score-card p {
        text-align: left;
    }
}

.preview-chart-container {
    height: 270px;
}

/* ----------------------------------------------------
   TAB 3: ANALYTICS & CHARTS
   ---------------------------------------------------- */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(41, 37, 34, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chart-expand-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.chart-expand-btn:hover {
    color: var(--steam-blue);
    border-color: var(--steam-blue);
    background: rgba(79, 70, 229, 0.06);
}

.chart-expand-btn:focus-visible,
.chart-zoom-close:focus-visible {
    border-color: var(--steam-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.tag {
    font-size: 0.62rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
}

.card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.chart-control-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

.chart-control-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chart-segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chart-filter-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chart-filter-btn:hover {
    color: var(--text-primary);
    background: rgba(79, 70, 229, 0.05);
}

.chart-filter-btn.active {
    color: var(--steam-blue);
    background: var(--bg-card);
    border-color: rgba(79, 70, 229, 0.22);
}

.chart-control-summary {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chart-wrapper {
    height: 280px;
    position: relative;
}

.chart-zoom-open {
    overflow: hidden;
}

.chart-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.54);
}

.chart-zoom-modal.active {
    display: flex;
}

.chart-zoom-panel {
    width: min(1180px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-zoom-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card-hover);
}

.chart-zoom-title-block {
    min-width: 0;
}

.chart-zoom-title-block h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.chart-zoom-title-block p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 95ch;
}

.chart-zoom-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.chart-zoom-close:hover {
    color: var(--trap-red);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.07);
}

.chart-zoom-chart-wrapper {
    height: min(72vh, 720px);
    min-height: 460px;
    padding: 18px;
    position: relative;
}

.chart-zoom-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-zoom-word-cloud {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

/* Word Cloud Container */
.word-cloud-container {
    height: 280px;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    border-radius: var(--border-radius-md);
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    gap: 10px 15px;
    overflow-y: auto;
}

.chart-zoom-chart-wrapper .chart-zoom-word-cloud {
    height: 100%;
    min-height: 420px;
}

.cloud-word {
    display: inline-block;
    transition: var(--transition-smooth);
    user-select: none;
    cursor: default;
    white-space: nowrap;
}

.cloud-word:hover {
    transform: scale(1.08);
}

.cloud-word.positive {
    color: var(--safe-green);
    opacity: 0.95;
}

.cloud-word.negative {
    color: var(--trap-red);
    opacity: 0.95;
}

.cloud-word.neutral {
    color: var(--text-muted);
    opacity: 0.8;
}

/* ----------------------------------------------------
   GAME DETAIL MODAL
   ---------------------------------------------------- */
/* Smooth Modal Animations */
@keyframes fadeInBackdrop {
    from { background: rgba(15, 23, 42, 0); backdrop-filter: blur(0px); }
    to { background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(6px); }
}

@keyframes slideUpModal {
    from { opacity: 0; transform: scale(0.96) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: display 0.25s ease;
}

.modal-backdrop.active {
    display: flex;
    animation: fadeInBackdrop 0.25s ease-out forwards;
}

.modal-backdrop.active .modal-card {
    animation: slideUpModal 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 950px;
    max-width: 100%;
    height: 80vh;
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.close-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    height: 100%;
}

.modal-left {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-card-hover);
}

.modal-left::-webkit-scrollbar,
.modal-right::-webkit-scrollbar {
    width: 5px;
}

.modal-left::-webkit-scrollbar-thumb,
.modal-right::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: 3px;
}

.modal-game-hero {
    height: 160px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    position: relative;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    isolation: isolate;
}

.modal-game-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.18);
}

.modal-game-hero.risk-danger::after {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.48), rgba(249, 115, 22, 0.32));
}

.modal-game-hero.risk-caution::after {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.42), rgba(217, 119, 6, 0.26));
}

.modal-game-hero.risk-safe::after {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(59, 130, 246, 0.16));
}

.modal-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transform: scale(1.01);
}

.modal-hero-fallback {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
}

.modal-game-hero.modal-cover-load-failed .modal-hero-image {
    display: none;
}

.modal-game-hero.modal-cover-load-failed .modal-hero-fallback {
    display: flex;
}

.cover-overlay {
    width: 100%;
    padding: 24px;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.38) 62%, rgba(15, 23, 42, 0) 100%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.game-tag-badge {
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 600;
    background: var(--steam-blue);
    padding: 3px 10px;
    border-radius: var(--border-radius-sm);
    color: #fff;
}

#modal-game-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
    transition: var(--transition-smooth);
}

#modal-game-developer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: var(--transition-smooth);
}

.modal-section {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-section h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.modal-section h3 i {
    color: var(--steam-blue);
}

.section-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.implicit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.implicit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.implicit-item .label {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.implicit-item .label i {
    color: var(--steam-blue);
    font-size: 0.85rem;
    opacity: 0.85;
}

.implicit-item .val {
    font-weight: 600;
    color: var(--text-primary);
}

.val-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

.val-badge.yes {
    background: rgba(16, 185, 129, 0.1);
    color: var(--safe-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.val-badge.no {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.preference-calc-box {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.02);
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.calc-header .score-num {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--steam-blue);
    background: rgba(79, 70, 229, 0.08);
    padding: 2px 10px;
    border-radius: 6px;
}

.calc-formula-sub {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.04);
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.05);
    word-break: break-all;
}

/* Modal Right */
.modal-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-card);
}

.trap-indicator-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.trap-indicator-banner.safe {
    background: rgba(16, 185, 129, 0.03);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.trap-indicator-banner.caution {
    background: rgba(245, 158, 11, 0.03);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.trap-indicator-banner.danger {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.banner-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-text {
    flex-grow: 1;
}

.banner-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.banner-text p {
    font-size: 0.75rem;
    opacity: 0.85;
    line-height: 1.5;
}

.banner-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 65px;
    text-align: center;
}

.banner-score .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 2px;
    font-weight: 600;
}

.banner-score .score {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.trap-indicator-banner.safe .banner-score {
    background: rgba(16, 185, 129, 0.1);
    color: var(--safe-green);
}

.trap-indicator-banner.caution .banner-score {
    background: rgba(245, 158, 11, 0.1);
    color: var(--caution-yellow);
}

.trap-indicator-banner.danger .banner-score {
    background: rgba(239, 68, 68, 0.1);
    color: var(--trap-red);
}

.modal-cloud {
    min-height: 130px;
    height: auto !important;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-content: center;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.cloud-word {
    display: inline-block;
    transition: var(--transition-smooth);
    user-select: none;
    cursor: default;
    white-space: nowrap;
    font-family: var(--font-display);
    padding: 2px 8px;
    border-radius: 4px;
}

.cloud-word:hover {
    transform: scale(1.1) translateY(-1px);
    background: rgba(15, 23, 42, 0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cloud-word.positive {
    color: var(--safe-green);
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
}

.cloud-word.negative {
    color: var(--trap-red);
    background: rgba(239, 68, 68, 0.08);
    font-weight: 600;
}

.cloud-word.neutral {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.06);
}

/* User Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comments-sync-state {
    width: 100%;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
}

.comments-sync-state i {
    color: var(--steam-blue);
}

.comment-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: var(--transition-smooth);
}

.comment-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #cbd5e1;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.comment-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-sentiment-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.comment-sentiment-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--safe-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.comment-sentiment-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--trap-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.comment-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Responsive */
@media(max-width: 1000px) {
    .tuner-layout {
        grid-template-columns: 1fr;
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .card-header {
        align-items: flex-start;
    }
    .card-header-actions {
        align-self: flex-start;
    }
    .chart-zoom-modal {
        padding: 12px;
    }
    .chart-zoom-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }
    .chart-zoom-chart-wrapper {
        min-height: 340px;
        height: 64vh;
        padding: 12px;
    }
    .modal-card {
        height: 90vh;
    }
    .modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        overflow-y: auto;
    }
    .modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ====================================================
   TAB 4: AI ANALYST WORKSPACE (AI 舆情分析姬)
   ==================================================== */
.ai-workspace-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    height: calc(100vh - 150px);
    min-height: 550px;
    align-items: stretch;
}

.chat-box-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.chat-header-bar {
    padding: 16px 20px;
    background: var(--bg-card-hover);
    border-bottom: 1px solid var(--border-color);
}

.ai-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar-badge {
    width: 38px;
    height: 38px;
    background: var(--steam-blue);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.ai-info h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-info .status {
    font-size: 0.68rem;
    color: var(--safe-green);
    font-weight: 500;
}

.ai-model-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(100, 116, 139, 0.18);
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.2;
}

.ai-model-status.deepseek {
    border-color: rgba(79, 70, 229, 0.18);
    background: rgba(79, 70, 229, 0.08);
    color: var(--steam-blue);
}

.ai-model-status.fallback {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.ai-model-status.loading {
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.chat-messages-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #fdfdfd;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: flex-end;
}

/* Chat Scrollbar */
.chat-messages-scroll::-webkit-scrollbar {
    width: 5px;
}

.chat-messages-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 3px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    align-items: flex-start;
    animation: messageSlideIn 0.2s ease-out forwards;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message .msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.message.ai .msg-avatar {
    background: var(--bg-sidebar);
    color: var(--steam-blue);
    border: 1px solid var(--border-color);
}

.message.user .msg-avatar {
    background: var(--steam-blue);
    color: #ffffff;
}

.msg-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message.user .msg-content {
    align-items: flex-end;
}

.msg-author {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.message.ai .msg-bubble {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 2px;
}

.message.user .msg-bubble {
    background: rgba(79, 70, 229, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-top-right-radius: 2px;
}

.msg-bubble p:not(:last-child) {
    margin-bottom: 8px;
}

.msg-bubble h3,
.msg-bubble h4,
.msg-bubble h5 {
    margin: 8px 0 6px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.msg-bubble h3:first-child,
.msg-bubble h4:first-child,
.msg-bubble h5:first-child {
    margin-top: 0;
}

.msg-bubble ul,
.msg-bubble ol {
    margin: 6px 0 8px 18px;
    padding: 0;
}

.msg-bubble li {
    margin: 4px 0;
}

.msg-bubble strong {
    font-weight: 700;
    color: var(--text-primary);
}

.msg-bubble em {
    font-style: normal;
    color: var(--text-secondary);
}

.msg-bubble code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
    font-size: 0.74rem;
}

.msg-bubble blockquote {
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.04);
    color: var(--text-secondary);
}

.msg-bubble hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.msg-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.msg-bubble table {
    width: 100%;
    border-collapse: collapse;
    min-width: 360px;
    background: var(--bg-card);
    font-size: 0.74rem;
}

.msg-bubble th,
.msg-bubble td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.msg-bubble th {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    font-weight: 700;
}

.msg-bubble tr:last-child td {
    border-bottom: 0;
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-top-left-radius: 2px;
    margin-left: 42px;
    margin-top: 8px;
}

.typing-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBlink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(2) { animation-delay: .2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: .4s; }

@keyframes typingBlink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Quick Prompts */
.quick-prompts-container {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: #fcfcfc;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-prompt-chip {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-prompt-chip:hover {
    border-color: var(--steam-blue);
    color: var(--steam-blue);
    background: rgba(79, 70, 229, 0.03);
    transform: translateY(-1px);
}

.quick-prompt-chip:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

/* Input Area */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-hover);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: var(--transition-smooth);
}

.chat-input-area input:focus {
    border-color: var(--steam-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.chat-input-area button {
    padding: 10px 20px;
    background: var(--steam-blue);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-area button:hover {
    background: #4338ca;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.chat-input-area input:disabled,
.chat-input-area button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.chat-input-area button:disabled {
    background: #64748b;
    box-shadow: none;
}

/* Right Report Card */
.ai-report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    justify-content: center;
}

.ai-report-card::-webkit-scrollbar {
    width: 5px;
}

.ai-report-card::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 3px;
}

/* Empty State */
.report-empty-state {
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.report-empty-state i {
    font-size: 3rem;
    opacity: 0.4;
    color: var(--steam-blue);
}

.report-empty-state h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.report-empty-state p {
    font-size: 0.78rem;
    max-width: 280px;
    line-height: 1.5;
}

/* Report Content */
.report-content-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.report-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.report-header .badge {
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.08);
    color: var(--steam-blue);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.report-body {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.report-body h4 {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 15px;
    margin-bottom: 8px;
}

.report-body ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.report-body li {
    margin-bottom: 5px;
}

.report-body strong {
    color: var(--text-primary);
}

/* Report Table */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.75rem;
}

.report-table th, .report-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    background: var(--bg-card-hover);
    font-weight: 600;
    color: var(--text-primary);
}

.report-table tr:hover td {
    background: rgba(15, 23, 42, 0.01);
}

.report-visualizer-container {
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

/* Responsive grid for smaller screens */
@media(max-width: 1100px) {
    .ai-workspace-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    .chat-box-card {
        height: 550px;
    }
    .ai-report-card {
        height: 400px;
    }
}

/* Modal Price History & Discount Styles */
.price-status-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.price-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.price-badge.cur {
    background: var(--bg-card);
    color: var(--text-primary);
}

.price-badge.low {
    background: rgba(16, 185, 129, 0.06);
    color: var(--safe-green);
    border-color: rgba(16, 185, 129, 0.15);
}

.price-action-tip {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.price-action-tip.buy-now {
    background: rgba(16, 185, 129, 0.1);
    color: var(--safe-green);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.price-action-tip.wait {
    background: rgba(245, 158, 11, 0.1);
    color: var(--caution-yellow);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.modal-price-chart-wrapper {
    position: relative;
    background: rgba(15, 23, 42, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px;
}

/* Modal Tab Switcher Styles */
.modal-tab-bar {
    display: flex;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.modal-tab-btn {
    background: none;
    border: none;
    padding: 10px 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.modal-tab-btn:hover {
    color: var(--text-primary);
}

.modal-tab-btn.active {
    color: var(--steam-blue);
}

.modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--steam-blue);
    border-radius: 2px;
}

.modal-tab-pane {
    display: none;
    flex-direction: column;
}

.modal-tab-pane.active {
    display: flex;
}

/* Modal Charts Custom Card Styling */
.modal-chart-card {
    border-bottom: 1px solid var(--border-color);
}

.modal-chart-card:last-child {
    border-bottom: none;
}

.modal-detail-chart-wrapper {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px;
    margin-top: 6px;
}

/* Tuner Algorithm Presets Styles */
.tuner-presets-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 24px 0;
}

.presets-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tuner-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-preset {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 8px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}

.btn-preset i {
    font-size: 0.75rem;
}

.btn-preset:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.btn-preset.active {
    color: var(--steam-blue);
    border-color: var(--steam-blue);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.1);
}

/* Tuner Live Top 3 Recommendations Cards Styles */
.tuner-top-cards-container {
    margin-top: 24px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
}

.tuner-top-cards-container h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tuner-top-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tuner-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.tuner-mini-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.tuner-mini-card.trap-warning {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.03);
}

.tuner-mini-card.trap-warning:hover {
    border-color: var(--trap-red);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

.tuner-mini-card-hero {
    height: 48px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    position: relative;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.tuner-mini-card.trap-warning .tuner-mini-card-hero {
    background: linear-gradient(135deg, #f87171 0%, #f97316 100%);
}

.tuner-mini-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}

.tuner-mini-card:hover .tuner-mini-cover-image {
    transform: scale(1.04);
}

.tuner-mini-title-fallback {
    display: none;
    position: relative;
    z-index: 1;
    max-width: calc(100% - 56px);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.tuner-mini-card-hero.tuner-cover-load-failed .tuner-mini-title-fallback {
    display: block;
}

.tuner-mini-rank-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
    padding: 1px 5px;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
}

.tuner-mini-card-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.tuner-mini-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tuner-mini-card-developer {
    font-size: 0.62rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: -4px;
}

.tuner-mini-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.tuner-mini-score-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--steam-blue);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.tuner-mini-card.trap-warning .tuner-mini-score-badge {
    background: rgba(239, 68, 68, 0.08);
    color: var(--trap-red);
    border-color: rgba(239, 68, 68, 0.15);
}

.tuner-mini-status-icons {
    display: flex;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.tuner-mini-status-icons i.active {
    color: var(--steam-blue);
}

.tuner-mini-card.trap-warning .tuner-mini-status-icons i.trap-alert {
    color: var(--trap-red);
}

/* ====================================================
   MULTI-GAME SENTIMENT PK COMPARATOR STYLES
   ==================================================== */

/* 1. Comparison Checkboxes on Game Cards */
.compare-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.15);
    transition: var(--transition-smooth);
    margin-top: 2px;
}

.compare-checkbox-label:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--steam-blue);
}

.compare-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--steam-blue);
    width: 12px;
    height: 12px;
    margin: 0;
}

/* 2. Bottom Compare Drawer */
.compare-drawer {
    position: fixed;
    bottom: -120px;
    left: calc(var(--sidebar-width) + 40px);
    right: 40px;
    height: 72px;
    background: rgba(185, 201, 220, 0.9); /* Opaque slate blue-gray with blur */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
    z-index: 900;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.compare-drawer.active {
    bottom: 24px;
}

.compare-drawer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.compare-drawer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.compare-drawer-info i {
    color: var(--steam-blue);
    font-size: 1rem;
}

.compare-selected-games {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    overflow-x: auto;
    padding: 4px 0;
}

.compare-selected-games::-webkit-scrollbar {
    height: 4px;
}

.compare-selected-games::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.compare-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    animation: slideInItem 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

@keyframes slideInItem {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.compare-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.compare-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.compare-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--trap-red);
}

.compare-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Helper Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 6px;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--steam-blue);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 3. Comparison Modal Layout */
.compare-modal-card {
    width: 1150px;
    max-width: 95vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.compare-modal-body {
    padding: 35px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.compare-modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.compare-modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.compare-modal-header h2 i {
    color: var(--steam-blue);
}

.compare-modal-header .subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 4. Comparative Specs Table */
.compare-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.compare-specs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.compare-specs-table th, 
.compare-specs-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.compare-specs-table th:last-child, 
.compare-specs-table td:last-child {
    border-right: none;
}

.compare-specs-table tr:last-child td {
    border-bottom: none;
}

.compare-specs-table th {
    background: var(--bg-sidebar);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.compare-specs-table td strong {
    font-weight: 600;
}

.compare-specs-table tr:hover {
    background: var(--bg-card-hover);
}

.compare-specs-table td:first-child {
    background: rgba(79, 70, 229, 0.02);
    font-weight: 600;
    width: 160px;
    color: var(--text-secondary);
}

/* 5. Comparative Charts Grid */
.compare-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.compare-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.compare-chart-card h3 {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-chart-card h3 i {
    color: var(--steam-blue);
}

.compare-chart-wrapper {
    position: relative;
    height: 220px;
    width: 100%;
}

/* 6. Compare Selector Mode & Card Styling */
.toggles-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

#games-list-container.compare-mode-active .game-card {
    border-color: rgba(79, 70, 229, 0.3);
    transition: var(--transition-smooth);
    position: relative;
}

#games-list-container.compare-mode-active .game-card::after {
    content: '\f0c8'; /* FontAwesome empty square */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 5;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#games-list-container.compare-mode-active .game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

#games-list-container.compare-mode-active .game-card.selected-for-compare {
    border-color: var(--steam-blue);
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.25);
    background: rgba(79, 70, 229, 0.02);
}

#games-list-container.compare-mode-active .game-card.selected-for-compare::after {
    content: '\f14a'; /* FontAwesome check square */
    font-weight: 900;
    background: var(--steam-blue);
    border-color: var(--steam-blue);
}

/* Compare Mode Banner */
.compare-mode-banner {
    grid-column: 1 / -1;
    background: rgba(79, 70, 229, 0.06);
    border: 1px dashed rgba(79, 70, 229, 0.3);
    padding: 14px 20px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-primary);
    animation: slideInBanner 0.25s ease-out forwards;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

@keyframes slideInBanner {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.compare-mode-banner span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.compare-mode-banner span i {
    color: var(--steam-blue);
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* 7. Typical Comment Sentiment Switcher Tabs */
.comment-sentiment-filters {
    display: flex;
    gap: 4px;
    background: var(--bg-card-hover);
    padding: 3px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.comment-filter-btn {
    border: none;
    background: none;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-filter-btn:hover {
    color: var(--text-primary);
    background: rgba(79, 70, 229, 0.04);
}

.comment-filter-btn.active {
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    color: var(--steam-blue);
}

.comment-filter-btn.active[data-sentiment="positive"] {
    color: var(--safe-green);
}

.comment-filter-btn.active[data-sentiment="negative"] {
    color: var(--trap-red);
}
