/* =========================================================
   mkbenchmark.com — Modern Premium Stylesheet
   Clean tech UI inspired by Apple / professional SaaS
   dashboards. Soft accents, generous spacing, layered shadows.
   ========================================================= */


/* ---------- CSS Reset / Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family:
        system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    transition: background-color var(--dur-normal) var(--ease-smooth), color var(--dur-normal) var(--ease-smooth);
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ---------- Theme Variables ---------- */
/* "Onyx / Emerald" premium theme — dark luxe palette with
   a subtle ambient glow, warmer black, inset highlights on
   cards, and multi-layer shadows that read as depth, not noise. */
:root,
html[data-theme="dark"] {
    /* Surfaces — deeper, slightly warm black with subtle tonal lift */
    --bg:          #0B0D10;
    --bg-gradient: radial-gradient(ellipse 90% 55% at 50% -10%, rgba(16, 185, 129, 0.06) 0%, transparent 55%), #0B0D10;
    --surface:     #141619;
    --surface-2:   #1A1D21;
    --surface-3:   #22262B;
    --border:      rgba(255, 255, 255, 0.07);
    --border-soft: rgba(255, 255, 255, 0.04);

    /* Text */
    --text:       #E7EAEE;
    --text-muted: #9CA3AF;
    --text-dim:   #6B7280;

    /* Accent — refined emerald with optional glow */
    --accent:      #10B981;
    --accent-2:    #059669;
    --accent-3:    #34D399;   /* brighter highlight */
    --accent-soft: rgba(16, 185, 129, 0.14);
    --accent-glow: rgba(16, 185, 129, 0.32);
    --accent-on:   #FFFFFF;

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger:  #EF4444;

    --success-bg: rgba(16, 185, 129, 0.12);
    --success-bd: rgba(16, 185, 129, 0.25);
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-bd: rgba(245, 158, 11, 0.25);
    --danger-bg:  rgba(239, 68, 68, 0.12);
    --danger-bd:  rgba(239, 68, 68, 0.25);

    /* Shadows — multi-layer with inset highlight for lifted cards */
    --shadow-soft:  0 1px 2px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.20);
    --shadow-card:  0 2px 4px rgba(0, 0, 0, 0.18), 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    --shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.25), 0 22px 50px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --shadow-focus: 0 0 0 3px var(--accent-soft);
    --shadow-glow:  0 0 0 1px var(--accent-soft), 0 8px 28px var(--accent-glow);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

html[data-theme="light"] {
    --bg:          #F5F7FA;
    --bg-gradient: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.06) 0%, transparent 55%), #F5F7FA;
    --surface:     #FFFFFF;
    --surface-2:   #F2F5F9;
    --surface-3:   #E7ECF3;
    --border:      rgba(15, 23, 42, 0.09);
    --border-soft: rgba(15, 23, 42, 0.05);

    --text:       #0F172A;
    --text-muted: #475569;
    --text-dim:   #94A3B8;

    --accent:      #10B981;
    --accent-2:    #059669;
    --accent-3:    #34D399;
    --accent-soft: rgba(16, 185, 129, 0.10);
    --accent-glow: rgba(16, 185, 129, 0.22);
    --accent-on:   #FFFFFF;

    --success: #059669;
    --warning: #D97706;
    --danger:  #DC2626;

    --success-bg: rgba(16, 185, 129, 0.10);
    --success-bd: rgba(16, 185, 129, 0.22);
    --warning-bg: rgba(217, 119, 6, 0.10);
    --warning-bd: rgba(217, 119, 6, 0.22);
    --danger-bg:  rgba(220, 38, 38, 0.10);
    --danger-bd:  rgba(220, 38, 38, 0.22);

    --shadow-soft:  0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-card:  0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --shadow-hover: 0 4px 8px rgba(15, 23, 42, 0.08), 0 20px 40px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --shadow-focus: 0 0 0 3px var(--accent-soft);
    --shadow-glow:  0 0 0 1px var(--accent-soft), 0 8px 24px var(--accent-glow);
}


/* ---------- Premium Motion Tokens ---------- */
/* Standardized easing curves + durations so every transition
   reads as the same "voice". expo-out is the hero curve —
   starts fast, decelerates with a luxurious tail. */
:root {
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

    --dur-fast:   160ms;
    --dur-normal: 260ms;
    --dur-slow:   440ms;
    --dur-xslow:  720ms;
}

/* Respect users who've opted out of motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ---------- Keyframes ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0%   { background-position: -150% 0; }
    100% { background-position: 150% 0; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50%      { box-shadow: 0 0 0 8px transparent; }
}


/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1800px; /* gives the 4-column Upgrade dashboard real estate */
    margin: 0 auto;
    padding: 0 1.5rem;
}

main.main-content {
    flex: 1 0 auto;
    padding: 2.5rem 1.5rem 5rem;
    background: var(--bg-gradient);
}


/* ---------- Header ---------- */
.site-header {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-3), var(--accent), var(--accent-2));
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform var(--dur-normal) var(--ease-spring), box-shadow var(--dur-normal) var(--ease-out-expo);
}

.logo:hover .logo-mark {
    transform: scale(1.06) rotate(-3deg);
    box-shadow: 0 6px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.logo-text {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

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

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--dur-normal) var(--ease-out-expo), background var(--dur-normal) var(--ease-out-expo);
}

.lang-select:hover {
    border-color: var(--accent);
}

.lang-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: background var(--dur-normal) var(--ease-out-expo), border-color var(--dur-normal) var(--ease-out-expo), transform var(--dur-normal) var(--ease-out-expo);
}

.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--surface-3);
    transform: rotate(12deg);
}

.theme-toggle:active {
    transform: rotate(-10deg) scale(0.94);
    transition-duration: 80ms;
}

.theme-icon {
    display: none;
    transition: transform var(--dur-normal) var(--ease-spring);
}
html[data-theme="dark"] .theme-icon-light {
    display: inline;
}
html[data-theme="light"] .theme-icon-dark {
    display: inline;
}


/* ---------- Page Tabs / Nav Bar ---------- */
.site-nav {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 70px; /* sits below the main header */
    z-index: 90;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.site-nav-inner {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    transition: background var(--dur-normal) var(--ease-out-expo), color var(--dur-normal) var(--ease-out-expo), border-color var(--dur-normal) var(--ease-out-expo);
}

.nav-tab:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-tab.is-active {
    color: var(--text);
    background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
    border-color: var(--border);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-tab.is-active .nav-tab-icon {
    color: var(--accent);
}

.nav-tab-icon {
    font-size: 1rem;
    color: var(--text-dim);
    transition: color var(--dur-normal) var(--ease-out-expo);
}

/* Pages — subtle fade-in on tab switch */
.page[hidden] {
    display: none;
}

.page:not([hidden]) {
    animation: fadeIn var(--dur-slow) var(--ease-out-expo);
}


/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.hero-title {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    margin: 0 0 0.85rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.075rem;
    line-height: 1.6;
    max-width: 660px;
    margin: 0 auto;
}


/* ---------- Card Panel ---------- */
.card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--dur-normal) var(--ease-out-expo), transform var(--dur-normal) var(--ease-out-expo), border-color var(--dur-normal) var(--ease-out-expo);
    animation: fadeInUp var(--dur-slow) var(--ease-out-quint) both;
}

.section-title {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
}

.section-subtitle {
    margin: -0.75rem 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.925rem;
    line-height: 1.55;
}


/* ---------- Form ---------- */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.form-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-field select.native-select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--dur-normal) var(--ease-out-expo), box-shadow var(--dur-normal) var(--ease-out-expo);
}

.form-field select.native-select:hover {
    border-color: var(--accent);
}

.form-field select.native-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}


/* ---------- Searchable Select ---------- */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select .ss-input {
    width: 100%;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 2.75rem 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--dur-normal) var(--ease-out-expo), box-shadow var(--dur-normal) var(--ease-out-expo);
}

.searchable-select .ss-input::placeholder {
    color: var(--text-dim);
}

.searchable-select .ss-input:hover {
    border-color: var(--accent);
}

.searchable-select .ss-input:focus,
.searchable-select.is-open .ss-input {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.searchable-select .ss-chevron {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    transition: transform var(--dur-normal) var(--ease-out-expo), color var(--dur-normal) var(--ease-out-expo);
}

.searchable-select.is-open .ss-chevron {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}

.searchable-select .ss-clear {
    position: absolute;
    right: 2.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1.15rem;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--dur-fast) var(--ease-out-expo), color var(--dur-fast) var(--ease-out-expo);
}

.searchable-select .ss-clear:hover {
    color: var(--text);
    background: var(--surface-3);
}

.searchable-select.has-value .ss-clear {
    display: flex;
}

.searchable-select .ss-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    z-index: 50;
    animation: scaleIn var(--dur-normal) var(--ease-out-expo);
    transform-origin: top center;
}

.searchable-select .ss-list[hidden] {
    display: none;
}

.searchable-select .ss-item {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    font-size: 0.95rem;
    transition: background var(--dur-fast) var(--ease-out-expo), color var(--dur-fast) var(--ease-out-expo);
}

.searchable-select .ss-item:hover,
.searchable-select .ss-item.is-active {
    background: var(--accent-soft);
    color: var(--text);
}

.searchable-select .ss-item mark {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
}

.searchable-select .ss-empty {
    padding: 0.85rem 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
}

.searchable-select .ss-list::-webkit-scrollbar {
    width: 8px;
}
.searchable-select .ss-list::-webkit-scrollbar-track {
    background: transparent;
}
.searchable-select .ss-list::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 4px;
}
.searchable-select .ss-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}


/* ---------- Button ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.6rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.975rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.005em;
    transition: transform var(--dur-fast) var(--ease-out-expo), background var(--dur-normal) var(--ease-out-expo), box-shadow var(--dur-normal) var(--ease-out-expo);
}

.btn-primary {
    background: linear-gradient(180deg, var(--accent-3) 0%, var(--accent) 50%, var(--accent-2) 100%);
    color: var(--accent-on);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.08),
        0 6px 20px var(--accent-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--accent-3) 0%, var(--accent) 60%, var(--accent-2) 100%);
    transform: translateY(-2px);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.12),
        0 14px 32px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.btn-primary:active {
    transform: translateY(0) scale(0.985);
    transition-duration: 80ms;
}


/* ---------- Calculator Results ---------- */
.results {
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-slow) var(--ease-out-quint), transform var(--dur-slow) var(--ease-out-quint);
}

.results[hidden] {
    display: none;
}

.results.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.results-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.results-disclaimer {
    max-width: 820px;
    margin: 0 0 1.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: transform var(--dur-normal) var(--ease-out-expo), box-shadow var(--dur-normal) var(--ease-out-expo), border-color var(--dur-normal) var(--ease-out-expo);
    position: relative;
    will-change: transform;
}

.results.is-visible .result-card {
    animation: fadeInUp var(--dur-slow) var(--ease-out-quint) both;
}
.results.is-visible .result-card:nth-child(1) { animation-delay:  60ms; }
.results.is-visible .result-card:nth-child(2) { animation-delay: 140ms; }
.results.is-visible .result-card:nth-child(3) { animation-delay: 220ms; }
.results.is-visible .result-card:nth-child(4) { animation-delay: 300ms; }

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in srgb, var(--border) 50%, var(--accent) 30%);
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.result-icon {
    font-size: 1.4rem;
}

.result-card-title {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.result-primary {
    margin: 0 0 0.4rem;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.result-secondary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.bottleneck-card.state-warning .result-primary {
    color: var(--warning);
}
.bottleneck-card.state-success .result-primary {
    color: var(--success);
}
.bottleneck-card.state-info .result-primary {
    color: var(--accent);
}

.fps-card .result-primary {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    color: var(--accent);
    font-size: clamp(2.75rem, 5vw, 3.25rem);
    font-variant-numeric: tabular-nums;
}

.fps-card .fps-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


/* =========================================================
   Hardware Comparison Page
   ========================================================= */
.compare-selectors-panel {
    margin-bottom: 1.5rem;
}

.compare-selectors {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.25rem;
    align-items: end;
}

.compare-selector-field {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.compare-selector-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compare-vs-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    width: 50px;
    height: 50px;
    margin-bottom: 2px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Idle state */
.compare-idle-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.compare-idle-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Hero verdict */
.verdict-hero {
    margin-bottom: 1.75rem;
    padding: 2.25rem 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.verdict-hero-text {
    margin: 0;
    font-size: clamp(1.4rem, 3.4vw, 2.15rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.02em;
}

.verdict-hero-name {
    color: var(--accent);
    white-space: nowrap;
    font-weight: 800;
}

.verdict-hero-pct {
    display: inline-block;
    margin: 0 0.15em;
    padding: 0.1em 0.55em;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-md);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.verdict-hero-text.verdict-hero-tie,
.verdict-hero-text.verdict-hero-mixed {
    color: var(--text-muted);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 500;
}

/* Metric rows */
.metric-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-soft);
}

.metric-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric-label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.metric-badge.is-positive {
    background: var(--success-bg);
    color: var(--success);
}

.metric-badge.is-tied {
    background: var(--surface-3);
    color: var(--text-muted);
}

.metric-sides {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.metric-side {
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: center;
    gap: 1rem;
}

.metric-side-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color var(--dur-normal) var(--ease-out-expo);
}

.metric-side.is-winner .metric-side-value {
    color: var(--success);
    font-size: 1.25rem;
    font-weight: 700;
}

.metric-side.is-loser .metric-side-value {
    color: var(--danger);
}

.metric-bar-track {
    position: relative;
    height: 10px;
    background: var(--surface-2);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.metric-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width var(--dur-slow) var(--ease-out-quint);
    position: relative;
    overflow: hidden;
}

.metric-bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity var(--dur-normal) var(--ease-out-expo);
}

.metric-row:hover .metric-bar-fill::after {
    opacity: 1;
    animation: shimmer 1.6s var(--ease-smooth) infinite;
}

.metric-bar-fill.is-winner {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
    box-shadow: 0 0 12px var(--accent-glow);
}

.metric-bar-fill.is-loser {
    background: var(--surface-3);
    opacity: 0.75;
}

@media (max-width: 720px) {
    .compare-selectors {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .compare-vs-mini {
        justify-self: center;
        align-self: center;
        margin: 0.25rem 0;
    }
}


/* =========================================================
   Can I Run It? Page
   ========================================================= */
.cir-results {
    margin: 1.75rem 0;
}

.cir-game-header {
    margin-bottom: 1.25rem;
    text-align: center;
}

.cir-game-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Verdict banner (Pass/Fail indicator for user specs) */
.cir-verdict {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.cir-verdict-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.cir-verdict-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cir-verdict-text {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cir-verdict-fps {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.cir-verdict-fps strong {
    color: var(--text);
    font-size: 1.3rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.cir-verdict-passRec {
    background: var(--success-bg);
    border-color: var(--success-bd);
}
.cir-verdict-passRec .cir-verdict-icon {
    background: var(--success);
    color: var(--surface);
}
.cir-verdict-passRec .cir-verdict-text {
    color: var(--success);
}

.cir-verdict-passMin {
    background: var(--warning-bg);
    border-color: var(--warning-bd);
}
.cir-verdict-passMin .cir-verdict-icon {
    background: var(--warning);
    color: var(--surface);
}
.cir-verdict-passMin .cir-verdict-text {
    color: var(--warning);
}

.cir-verdict-fail {
    background: var(--danger-bg);
    border-color: var(--danger-bd);
}
.cir-verdict-fail .cir-verdict-icon {
    background: var(--danger);
    color: #ffffff;
}
.cir-verdict-fail .cir-verdict-text {
    color: var(--danger);
}

/* Min/Rec spec cards */
.cir-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.cir-spec-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: relative;
    overflow: hidden;
}

.cir-spec-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    opacity: 0.85;
}

.cir-spec-min::before {
    background: var(--warning);
}

.cir-spec-rec::before {
    background: var(--success);
}

.cir-spec-card-header {
    margin: 0;
}

.cir-spec-card-title {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.cir-spec-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cir-spec-row {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
}

.cir-spec-row dt {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted);
}

.cir-spec-row dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* FPS gauge — large number with pastel tinted background */
.cir-fps-gauge {
    margin-top: 0.25rem;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.cir-fps-value {
    font-size: clamp(2.5rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.025em;
}

.cir-fps-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.cir-fps-good {
    background: var(--success-bg);
    border-color: var(--success-bd);
}
.cir-fps-good .cir-fps-value {
    color: var(--success);
}

.cir-fps-ok {
    background: var(--warning-bg);
    border-color: var(--warning-bd);
}
.cir-fps-ok .cir-fps-value {
    color: var(--warning);
}

.cir-fps-bad {
    background: var(--danger-bg);
    border-color: var(--danger-bd);
}
.cir-fps-bad .cir-fps-value {
    color: var(--danger);
}

@media (max-width: 720px) {
    .cir-specs-grid {
        grid-template-columns: 1fr;
    }
    .cir-verdict {
        flex-direction: column;
        text-align: center;
    }
}


/* =========================================================
   Upgrade Assistant — Horizontal Dashboard
   ---------------------------------------------------------
   Refined for maximum on-screen readability: larger type,
   brighter secondary text, generous padding, soft pastel
   bottleneck badges. Keeps the 4-column horizontal layout
   on wide screens (≥1440px), 2 columns on laptops,
   1 column on mobile.
   ========================================================= */

.up-dashboard {
    display: grid;
    /* 320px floor per column so names/specs never squeeze.
       On ≥1440px viewports all 4 columns fit side-by-side;
       below that the media query falls back to 2 columns. */
    grid-template-columns: repeat(4, minmax(320px, 1fr));
    gap: 1rem;                  /* tighter gap → more column width */
    margin-bottom: 2rem;
    align-items: stretch;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 880px);
    padding: 2.5rem 2.25rem;     /* 40px / 36px — extremely generous */
    border-radius: var(--radius-lg);
    min-width: 0;
}

.dashboard-card-header {
    flex-shrink: 0;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-card-header .section-title {
    font-size: 1.5rem;             /* 24px — bold prominent heading */
    font-weight: 700;
    margin-bottom: 0.55rem;
    letter-spacing: -0.015em;
    color: var(--text);
}

.dashboard-card-header .section-subtitle {
    margin: 0;
    font-size: 1rem;               /* 16px */
    line-height: 1.6;
    color: var(--text-muted);
}

.dashboard-card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-card-body.scroll-body {
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

/* Subtle scrollbar inside dashboard cards */
.dashboard-card-body.scroll-body::-webkit-scrollbar {
    width: 7px;
}
.dashboard-card-body.scroll-body::-webkit-scrollbar-track {
    background: transparent;
}
.dashboard-card-body.scroll-body::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 4px;
}
.dashboard-card-body.scroll-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Setup card form fields use a slightly bigger gap */
#up-setup-card .dashboard-card-body {
    gap: 1.25rem;
}

/* Upgrade items inside dashboard columns
   Stacked vertical layout: name → stats → badges.
   This lets the name and stats take the full content width
   so larger type doesn't fight aside badges for horizontal space. */
.up-dashboard .upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.up-dashboard .upgrade-item {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.5rem;               /* 24px all around */
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    transition: border-color var(--dur-fast) var(--ease-out-expo), background var(--dur-fast) var(--ease-out-expo);
}

.up-dashboard .upgrade-item:hover {
    border-color: var(--border);
    background: var(--surface-3);
}

.up-dashboard .upgrade-item.is-current {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.up-dashboard .upgrade-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.up-dashboard .upgrade-item-name {
    margin: 0;
    font-size: 1.25rem;            /* 20px — bold, unmissable */
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.015em;
    /* Wrap long hardware names instead of truncating */
    word-break: break-word;
}

.up-dashboard .upgrade-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    font-size: 1.0625rem;          /* 17px — read at a glance */
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    line-height: 1.55;
    font-weight: 500;
}

.up-dashboard .upgrade-item-stats em {
    font-style: normal;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    margin-right: 0.3rem;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
}

/* Badges row — horizontal, wrap-aware, at the bottom of each item */
.up-dashboard .upgrade-item-aside {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.2rem;
}

/* Upgrade badges (perf delta / current / tier)
   Modern pill style: rounded-full, slightly transparent bg,
   solid text color, no borders. Large and prominent. */
.upgrade-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.15rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;               /* 16px — large and readable */
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: 0;
    line-height: 1;
}

.upgrade-badge.is-positive {
    background: var(--success-bg);
    color: var(--success);
}

.upgrade-badge.is-negative {
    background: var(--danger-bg);
    color: var(--danger);
}

.upgrade-badge.is-neutral {
    background: var(--surface-3);
    color: var(--text-muted);
}

.upgrade-badge.is-current {
    background: var(--accent);
    color: var(--accent-on);
}

.upgrade-badge.tier-high {
    background: var(--accent);
    color: var(--accent-on);
}

.upgrade-badge.tier-mid {
    background: var(--accent-soft);
    color: var(--accent);
}

.upgrade-badge.tier-budget {
    background: var(--surface-3);
    color: var(--text-muted);
}

/* Live bottleneck risk badges — clear pills with full-word labels.
   Slightly tighter than the perf-delta badges so "19% Bottleneck"
   fits inside narrow dashboard columns without forcing a line break. */
.up-bn {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: none;
    font-size: 0.8125rem;          /* 13px — compact but legible */
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1;
}

.up-bn.bn-green {
    background: var(--success-bg);
    color: var(--success);
}


.up-bn.bn-red {
    background: var(--danger-bg);
    color: var(--danger);
}

/* "Check Price" ghost button — affiliate-ready link inside upgrade items.
   Transparent bg, subtle border, off-white text. Blends with the Titanium
   theme without looking like an ad. */
.check-price {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #4B5563;
    border-radius: 999px;
    background: transparent;
    color: #E5E7EB;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    transition: background var(--dur-normal) var(--ease-out-expo), border-color var(--dur-normal) var(--ease-out-expo);
    cursor: pointer;
}

.check-price:hover {
    background: #374151;
    border-color: #6B7280;
}

.check-price:active {
    background: #4B5563;
}

/* Light theme override */
html[data-theme="light"] .check-price {
    border-color: #D1D5DB;
    color: #374151;
}

html[data-theme="light"] .check-price:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

/* Hint message when prerequisites aren't met */
.upgrade-hint {
    margin: 0;
    padding: 1.75rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    text-align: center;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

/* Dashboard responsive breakpoints.
   4 columns only when the viewport is genuinely wide enough
   (≥1440px). Below that, gracefully drop to a 2-column grid
   that keeps the same 320px column floor so cards stay roomy. */
@media (max-width: 1439px) {
    .up-dashboard {
        grid-template-columns: repeat(2, minmax(320px, 1fr));
    }
}

@media (max-width: 720px) {
    .up-dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .dashboard-card {
        max-height: none;
        padding: 1.5rem 1.25rem;
    }
    .dashboard-card-body.scroll-body {
        max-height: 60vh;
    }
}


/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.75rem 0 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-copy {
    margin: 0;
}

/* Page-level disclaimer at the bottom of each page */
.page-disclaimer {
    margin-top: 2rem;
}


/* ---------- Global Responsive ---------- */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    .header-inner {
        flex-wrap: wrap;
    }
    .logo-text {
        font-size: 1rem;
    }
    .card-panel {
        padding: 1.5rem 1.25rem;
    }
    .hero {
        padding: 2rem 0 1.5rem;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .header-controls {
        gap: 0.4rem;
    }
    .lang-select {
        max-width: 110px;
    }
}
