/* MAME ROM Database - Complete Unified Styles */

/* ==========================================================================
   DESIGN TOKENS - CSS Custom Properties
   ========================================================================== */
:root {
    /* Colors - Primary Palette */
    --color-primary: #667eea;
    --color-primary-dark: #1e3c72;
    --color-primary-light: #764ba2;
    --color-primary-lighter: #9b9bea;
    
    /* Colors - Semantic */
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-info: #2196f3;
    
    /* Colors - Accent */
    --color-accent-orange: #ff6f00;
    --color-accent-cyan: #00acc1;
    --color-accent-purple: #7b1fa2;
    --color-accent-yellow: #f57f17;
    
    /* Colors - Grayscale */
    --color-white: #ffffff;
    --color-gray-50: #fafbfc;
    --color-gray-100: #f5f7fa;
    --color-gray-200: #f0f0f0;
    --color-gray-300: #e1e8ed;
    --color-gray-400: #999999;
    --color-gray-600: #666666;
    --color-gray-900: #333333;
    
    /* Colors - Text */
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    --color-text-link: #667eea;
    
    /* Colors - Background */
    --color-bg-light: #fafbfc;
    --color-bg-lighter: #f5f7fa;
    --color-bg-lightest: #f8f9ff;
    --color-bg-white: #ffffff;
    
    /* Colors - Border */
    --color-border: #e1e8ed;
    --color-border-hover: #667eea;
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 6px;
    --space-md: 8px;
    --space-lg: 10px;
    --space-xl: 12px;
    --space-2xl: 14px;
    --space-3xl: 16px;
    --space-4xl: 18px;
    --space-5xl: 20px;
    --space-6xl: 25px;
    --space-7xl: 30px;
    --space-8xl: 35px;
    --space-9xl: 40px;
    --space-10xl: 50px;
    --space-11xl: 60px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 15px;
    --radius-2xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-base: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(102, 126, 234, 0.2);
    --shadow-lg: 0 4px 12px rgba(102, 126, 234, 0.15);
    --shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
    
    /* Typography */
    --font-mono: 'Courier New', monospace;
    --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-header: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --gradient-item: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    --gradient-success: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    --gradient-warning: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    --gradient-danger: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
}

/* ==========================================================================
   UTILITY BADGE CLASSES - Composable Badge System
   ========================================================================== */

/* Base badge class - provides structure */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-sm);
    /* font-size: uses .text-sm (0.8em) - close enough */
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

/* Badge color variants */
.badge-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.badge-success {
    background: #e8f5e9;
    color: #388e3c;
    border-color: #81c784;
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #90caf9;
}

.badge-warning {
    background: #fff9c4;
    color: var(--color-accent-yellow);
    border-color: #fdd835;
}

.badge-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.badge-secondary {
    background: #f3e5f5;
    color: var(--color-accent-purple);
    border-color: #ce93d8;
}

.badge-orange {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffb74d;
}

/* Status badge variant - pill shaped with gradient */
.badge-status {
    padding: var(--space-xs) var(--space-xl);
    border-radius: var(--radius-2xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    border: none;
}

.badge-status.status-good {
    background: var(--gradient-success);
    color: var(--color-white);
}

.badge-status.status-imperfect {
    background: var(--gradient-warning);
    color: var(--color-white);
}

.badge-status.status-preliminary {
    background: var(--gradient-danger);
    color: var(--color-white);
}

.badge-status.status-unknown {
    background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 100%);
    color: var(--color-white);
}

/* Machine type badge variant - solid color, white text */
.badge-machine {
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-md);
    /* font-size: uses .text-sm (0.85em) */
    color: var(--color-white);
    border: none;
}

.badge-machine.type-bios {
    background: var(--color-success);
}

.badge-machine.type-device {
    background: var(--color-info);
}

.badge-machine.type-mechanical {
    background: var(--color-warning);
}

.badge-machine.type-not-runnable {
    background: var(--color-danger);
}

/* Size modifiers */
.badge-sm {
    /* font-size: uses .text-xs (0.75em) */
    padding: var(--space-xs) var(--space-md);
}

.badge-lg {
    /* font-size: uses .text-base (0.9em) */
    padding: var(--space-sm) var(--space-xl);
}

/* ==========================================================================
   UTILITY BUTTON CLASSES - Composable Button System
   ========================================================================== */

/* Base button class - provides common structure */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    white-space: nowrap;
}

/* Button style variants */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-bg-lighter);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-outline:active {
    transform: translateY(0);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-glass:active {
    transform: translateY(0);
}

.btn-glass-solid {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-glass-solid:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-glass-solid:active {
    transform: translateY(0);
}

.btn-glass-solid.secondary {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glass-solid.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Button size variants */
.btn-sm {
    padding: var(--space-lg) var(--space-3xl);
    /* font-size: uses .text-base (0.9em) */
}

.btn-md {
    padding: var(--space-2xl) var(--space-7xl);
    /* font-size: uses .text-lg (1.05em) */
}

.btn-lg {
    padding: var(--space-3xl) var(--space-8xl);
    /* font-size: uses .text-lg (1.05em) */
}

/* Button utilities */
.btn svg,
.btn img {
    flex-shrink: 0;
}

.btn.hidden {
    display: none;
}

/* ==========================================================================
   UTILITY LAYOUT CLASSES - Composable Layout System
   ========================================================================== */

/* Flexbox utilities */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

/* Flex direction */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

/* Flex wrap */
.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

/* Align items */
.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.items-stretch {
    align-items: stretch;
}

/* Justify content */
.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

/* Gap utilities - mapped to spacing tokens */
.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

.gap-2xl {
    gap: var(--space-2xl);
}

.gap-3xl {
    gap: var(--space-3xl);
}

.gap-4xl {
    gap: var(--space-4xl);
}

.gap-5xl {
    gap: var(--space-5xl);
}

.gap-6xl {
    gap: var(--space-6xl);
}

.gap-7xl {
    gap: var(--space-7xl);
}

/* ==========================================================================
   UTILITY TYPOGRAPHY CLASSES - Composable Text System
   ========================================================================== */

/* Font size utilities - based on actual usage patterns */
.text-xs {
    font-size: 0.75em; /* Extra small - badges, labels */
}

.text-sm {
    font-size: 0.85em; /* Small - metadata, secondary text */
}

.text-base {
    font-size: 0.9em; /* Base - body text, most UI elements */
}

.text-md {
    font-size: 0.95em; /* Medium - emphasized body text */
}

.text-lg {
    font-size: 1.05em; /* Large - buttons, prominent text */
}

.text-xl {
    font-size: 1.1em; /* Extra large - subheadings */
}

.text-2xl {
    font-size: 1.3em; /* 2X large - section headers */
}

.text-3xl {
    font-size: 1.6em; /* 3X large - page titles */
}

.text-4xl {
    font-size: 2em; /* 4X large - hero text */
}

.text-5xl {
    font-size: 2.5em; /* 5X large - major headings */
}

/* Font weight utilities */
.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Text transform utilities */
.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* Letter spacing utilities */
.tracking-tight {
    letter-spacing: -0.5px;
}

.tracking-normal {
    letter-spacing: 0;
}

.tracking-wide {
    letter-spacing: 0.5px;
}

.tracking-wider {
    letter-spacing: 1px;
}

/* ===== RESET & BASE STYLES ===== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-text-primary);
    padding: var(--space-5xl);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== HEADER STYLES ===== */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: var(--space-6xl) var(--space-7xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--space-5xl);
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: var(--space-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header .subtitle {
    font-size: 0.95em;
    opacity: 0.9;
}

/* ===== REPORT PAGE HEADER ===== */
.report-page-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: var(--space-6xl) var(--space-7xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--space-5xl);
}

.brand-title {
    font-size: 2em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-link {
    /* Now uses: .btn .btn-glass .btn-sm but with custom gap */
    gap: var(--space-sm); /* Override default */
}

/* Machine Details Card */
.machine-details-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    margin-bottom: var(--space-5xl);
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.machine-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-7xl);
    padding: var(--space-6xl) var(--space-7xl);
    align-items: center;
}

.machine-title {
    font-size: 1.8em;
    color: var(--color-primary-dark);
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
}

.meta-badge.machine-name-badge {
    /* Now uses: .inline-flex .items-center .gap-md + custom styles */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-md) var(--space-3xl);
    border-radius: var(--radius-lg);
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    transition: all var(--transition-base);
}

.meta-badge.machine-name-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.meta-badge.machine-name-badge img {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.meta-badge.machine-name-badge svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.meta-pill {
    /* Now uses: .inline-flex .items-center .gap-sm + custom styles */
    background: white;
    color: var(--color-primary-dark);
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-lg);
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-base);
}

.meta-pill:hover {
    background: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.2);
}

.meta-pill img {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.meta-pill svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.meta-separator {
    color: rgba(102, 126, 234, 0.3);
    font-size: 1em;
    font-weight: bold;
}

.machine-thumbnail {
    display: flex;
    justify-content: center;
    align-items: center;
}

.thumbnail-image {
    width: 240px;
    height: 180px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all var(--transition-base);
}

.thumbnail-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* Old report hero styles - can be removed if not needed */
.report-hero {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #764ba2 100%);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    position: relative;
}

.report-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* Navigation Bar */
.report-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5xl) var(--space-7xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    color: white;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    padding: var(--space-lg) var(--space-4xl);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition-base);
}

.nav-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-back svg {
    transition: transform 0.3s ease;
}

.nav-back:hover svg {
    transform: translateX(-3px);
}

.nav-actions {
    display: flex;
    gap: var(--space-lg);
}

/* Hero Content */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: var(--space-10xl);
    padding: var(--space-9xl) var(--space-9xl) var(--space-10xl);
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-6xl);
}

.hero-title-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
}

.hero-title {
    font-size: 3em;
    color: white;
    margin: 0;
    line-height: 1.1;
    font-weight: 700;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.hero-emoji {
    font-size: 2.5em;
    line-height: 1;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Metadata Badges */
.hero-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    align-items: center;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-lg);
    background: white;
    color: var(--color-primary-dark);
    padding: var(--space-2xl) var(--space-6xl);
    border-radius: var(--radius-xl);
    font-family: 'Courier New', monospace;
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.meta-badge:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.meta-badge svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-lg);
    color: white;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: var(--space-xl) var(--space-5xl);
    border-radius: var(--radius-lg);
    font-size: 1.1em;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

.meta-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.meta-item svg {
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.meta-divider {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Screenshot Display */
.hero-screenshot-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screenshot-frame {
    position: relative;
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-slow);
}

.screenshot-frame:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-screenshot {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-slow);
}

.screenshot-shine {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
    border-radius: var(--radius-lg);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.screenshot-frame:hover .screenshot-shine {
    opacity: 1;
}

/* Old header styles - keep for backward compatibility */
.header.report-header {
    text-align: center;
    padding: var(--space-7xl) var(--space-7xl) var(--space-8xl);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4xl);
    align-items: center;
    margin-bottom: var(--space-6xl);
}

.header.report-header h1 { 
    font-size: 2.5em;
    margin: 0;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    align-items: center;
    justify-content: center;
}

.header .machine-label {
    font-size: 1.05em;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.25);
    padding: var(--space-lg) var(--space-5xl);
    border-radius: var(--radius-lg);
    letter-spacing: 0.5px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header .meta {
    font-size: 1.15em;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    font-weight: 500;
}

.header .meta a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.header .meta a:hover {
    border-bottom-color: #ffd700;
}

.header-screenshot {
    max-width: 480px;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 5px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all var(--transition-base);
    margin: 0 auto;
    display: block;
}

.header-screenshot:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-actions {
    /* Now uses: .flex .gap-xl .flex-wrap .justify-center (on homepage hero) */
    justify-content: center;
}

/* ===== CARD STYLES ===== */
.search-card, .card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: var(--space-6xl) var(--space-7xl);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    margin-bottom: var(--space-5xl);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.search-card h2, .card h2 {
    color: var(--color-primary-dark);
    margin-bottom: var(--space-xl);
    font-size: 1.3em;
}

/* ===== FOOTER STYLES ===== */
.footer {
    text-align: center;
    padding: var(--space-5xl);
    margin-top: var(--space-7xl);
    opacity: 0.9;
    color: white;
}

.footer a {
    color: white;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease;
}

.footer a:hover {
    border-bottom-color: white;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: var(--space-7xl);
    right: var(--space-7xl);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ===== SEARCH PAGE STYLES ===== */

.search-type-selector {
    /* Now uses: .flex .gap-lg .flex-wrap .justify-center */
    margin-bottom: var(--space-5xl);
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-4xl);
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 600;
    color: var(--color-primary-dark);
    user-select: none;
    box-shadow: var(--shadow-base);
}

.radio-label:hover {
    background: var(--color-bg-lightest);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.15);
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.radio-label input[type="radio"]:checked + span {
    color: white;
}

.radio-label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.radio-label:has(input[type="radio"]:checked) span {
    color: white;
}

.search-form {
    margin-bottom: var(--space-5xl);
}

.search-input {
    flex: 1;
    padding: var(--space-3xl) var(--space-5xl);
    font-size: 1.1em;
    border: 3px solid #667eea;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    font-family: 'Courier New', monospace;
}

.search-input::placeholder {
    color: var(--color-primary-lighter);
    opacity: 0.8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-input:focus::placeholder {
    color: var(--color-primary-light);
    opacity: 0.6;
}

.results-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-7xl);
    margin-bottom: var(--space-6xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.results-header {
    border-bottom: 3px solid #667eea;
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-5xl);
}

.results-header h2 {
    color: var(--color-primary-dark);
    font-size: 1.6em;
}

.result-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    padding: var(--space-5xl) var(--space-6xl);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
    border-left: 5px solid #667eea;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: var(--shadow-base);
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-5xl);
    align-items: start;
    animation: fadeIn 0.4s ease forwards;
}

.result-item:hover {
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    border-left-color: var(--color-primary-light);
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }
.result-item:nth-child(n+6) { animation-delay: 0.3s; }

.result-thumbnail {
    width: 160px;
    height: 120px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all var(--transition-base);
}

.result-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-xl);
}

.result-metadata {
    /* Now uses: .flex .flex-wrap .gap-lg .items-center */
    margin-bottom: var(--space-xl);
}

.result-meta-badge {
    /* Now uses: .inline-flex .items-center .gap-md + custom gradient */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-md) var(--space-3xl);
    border-radius: var(--radius-lg);
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.result-meta-badge svg {
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.result-meta-pill {
    /* Now uses: .inline-flex .items-center .gap-sm + custom styles */
    background: white;
    color: var(--color-primary-dark);
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-lg);
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: var(--shadow-base);
}

.result-meta-pill svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.result-machine {
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    font-size: 1.05em;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.result-detail {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.95em;
}

.result-detail-label {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.result-detail-value {
    color: var(--color-text-primary);
}

.result-rom-info {
    /* Now uses: .flex .flex-wrap .gap-md .items-center */
    margin-top: var(--space-lg);
    padding: var(--space-3xl) var(--space-4xl);
    background: var(--color-bg-lighter);
    border-radius: var(--radius-lg);
    border: 1px solid #e1e8ed;
}

.rom-detail-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.9em;
    color: var(--color-primary-dark);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.rom-detail-item strong {
    color: var(--color-text-secondary);
    font-weight: 600;
    margin-right: var(--space-sm);
    font-family: 'Segoe UI', sans-serif;
}

.rom-detail-item:not(:last-child)::after {
    content: '•';
    margin-left: var(--space-xl);
    color: rgba(102, 126, 234, 0.4);
    font-family: 'Segoe UI', sans-serif;
}

.rom-detail-placeholder {
    font-size: 0.9em;
    color: var(--color-text-muted);
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
}

.result-rom-label {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.result-crc {
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    font-weight: bold;
    font-size: 0.95em;
}

.no-results {
    text-align: center;
    padding: var(--space-11xl) var(--space-5xl);
    color: var(--color-text-secondary);
}

.no-results-icon {
    font-size: 4em;
    margin-bottom: var(--space-5xl);
    opacity: 0.5;
}

.no-results h3 {
    color: var(--color-primary-dark);
    font-size: 1.5em;
    margin-bottom: var(--space-xl);
}

.no-results p {
    font-size: 1.1em;
    margin-bottom: var(--space-6xl);
}

.no-results-suggestions {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-bg-lighter);
    padding: var(--space-5xl) var(--space-6xl);
    border-radius: var(--radius-lg);
}

.no-results-suggestions h4 {
    color: var(--color-primary);
    margin-bottom: var(--space-xl);
}

.no-results-suggestions ul {
    list-style-position: inside;
    color: var(--color-text-secondary);
}

.no-results-suggestions li {
    margin-bottom: var(--space-md);
}

.welcome-content {
    display: block;
}

.welcome-content.hidden {
    display: none;
}

.help-text {
    color: var(--color-text-secondary);
    font-size: 0.9em;
    margin-top: var(--space-xl);
    line-height: 1.6;
}

.help-text code {
    background: var(--color-bg-lighter);
    padding: 2px var(--space-md);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    font-size: 0.95em;
}

.examples {
    background: white;
    padding: var(--space-6xl) var(--space-7xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--space-7xl);
}

.examples h3 {
    color: var(--color-primary-dark);
    margin-bottom: var(--space-xl);
    font-size: 1.3em;
}

.example-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-xl);
}

.example-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.example-item:hover {
    transform: translateX(5px);
    border-left-color: var(--color-primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.example-crc {
    font-family: 'Courier New', monospace;
    font-size: 1.05em;
    color: var(--color-primary);
    font-weight: bold;
}

.example-name {
    color: var(--color-text-secondary);
    font-size: 0.85em;
    margin-top: var(--space-xs);
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-6xl) var(--space-7xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    color: var(--color-text-primary);
}

.info-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-xl);
    font-size: 1.25em;
}

.info-card p {
    margin-bottom: var(--space-xl);
    line-height: 1.8;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-5xl);
}

.feature-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    padding: var(--space-4xl);
    border-radius: var(--radius-lg);
    border-left: 4px solid #667eea;
}

.feature-item h4 {
    color: var(--color-primary-dark);
    margin-bottom: var(--space-md);
    font-size: 1.05em;
}

.feature-item p {
    color: var(--color-text-secondary);
    font-size: 0.9em;
    margin: 0;
    line-height: 1.5;
}

.feature-item code {
    font-size: 0.9em;
    background: rgba(102, 126, 234, 0.1);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-sm);
    display: block;
    margin-top: var(--space-md);
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* ===== REPORT PAGE STYLES ===== */

.match {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-7xl);
    margin-bottom: var(--space-6xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid rgba(102, 126, 234, 0.1);
    animation: fadeIn 0.5s ease;
}

.match:hover { 
    transform: translateY(-3px);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.2);
}

.match-header {
    border-bottom: 3px solid #667eea;
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-5xl);
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: var(--space-6xl);
    align-items: start;
}

.match-header-text {
    flex: 1;
}

.match-header h2 { 
    color: var(--color-primary-dark);
    font-size: 1.6em;
    margin-bottom: var(--space-xs);
    word-wrap: break-word;
}

.match-header .machine-name {
    font-family: 'Courier New', monospace;
    color: var(--color-primary-light);
    font-size: 1.1em;
    font-weight: bold;
}

.machine-name a {
    color: var(--color-primary-light);
    text-decoration: none;
    border-bottom: 2px solid var(--color-primary-light);
    transition: all var(--transition-base);
}

.machine-name a:hover {
    opacity: 0.8;
}

.game-screenshot {
    width: 240px;
    height: 180px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all var(--transition-base);
}

.game-screenshot:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.section { 
    margin-bottom: var(--space-5xl); 
}

.section-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-2xl) var(--space-5xl);
    border-radius: var(--radius-lg);
    font-size: 1.15em;
    font-weight: 600;
    margin-bottom: var(--space-3xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.3px;
    list-style: none;
}

/* Hide default disclosure markers for section-title when used as summary */
.section-title::-webkit-details-marker {
    display: none;
}

.section-title::marker {
    display: none;
    content: '';
}

.section-title::before { 
    content: '▶'; 
    font-size: 0.8em;
    opacity: 0.9;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.info-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    padding: var(--space-3xl) var(--space-4xl);
    border-radius: var(--radius-lg);
    border-left: 4px solid #667eea;
    overflow: hidden;
    box-shadow: var(--shadow-base);
    transition: all var(--transition-base);
}

.info-item:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.info-item label {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item value {
    display: block;
    color: var(--color-primary-dark);
    font-family: 'Courier New', monospace;
    font-size: 1em;
    font-weight: 500;
    word-break: break-all;
}

.info-item value a {
    color: var(--color-primary-dark);
    text-decoration: none;
    border-bottom: 2px solid var(--color-primary);
    transition: all var(--transition-base);
    display: inline;
}

.info-item value a:hover {
    border-bottom-color: var(--color-primary-light);
    color: var(--color-primary-light);
}

.sha1-value {
    cursor: pointer;
    position: relative;
}

.sha1-full {
    display: none;
}

.sha1-truncated {
    display: inline;
}

.sha1-value.expanded .sha1-full {
    display: inline;
}

.sha1-value.expanded .sha1-truncated {
    display: none;
}

.sha1-value::after {
    content: ' [tap to expand]';
    font-size: 0.8em;
    color: var(--color-primary);
    font-family: 'Segoe UI', sans-serif;
}

.sha1-value.expanded::after {
    content: ' [tap to collapse]';
}

.rom-list { 
    background: transparent;
    border-radius: var(--radius-md);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rom-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr;
    gap: var(--space-xl);
    padding: var(--space-3xl) var(--space-4xl);
    background: var(--color-bg-lighter);
    border-radius: var(--radius-lg);
    border: 1px solid #e1e8ed;
    transition: all var(--transition-base);
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rom-item:hover {
    background: #eef2f7;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.rom-item.highlighted {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-color: #ff9800;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.25);
}

.rom-item.highlighted:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.35);
}

.rom-marker { 
    font-size: 1.4em;
    text-align: center;
    color: var(--color-primary);
    opacity: 0.7;
}

.rom-item:hover .rom-marker {
    opacity: 1;
}

.rom-name { 
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    word-break: break-all;
    text-align: left;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.rom-crc { 
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9em;
    text-align: left;
}

.rom-crc a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    background: rgba(102, 126, 234, 0.08);
}

.rom-crc a:hover {
    background: rgba(102, 126, 234, 0.2);
    text-decoration: underline;
    transform: translateY(-1px);
}

.rom-sha1 {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    text-align: left;
}

.rom-sha1-link {
    color: #00acc1;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    background: rgba(0, 172, 193, 0.08);
    font-weight: 600;
}

.rom-sha1-link:hover {
    background: rgba(0, 172, 193, 0.2);
    text-decoration: underline;
    transform: translateY(-1px);
}

.rom-size { 
    color: var(--color-text-secondary);
    text-align: right;
    font-size: 0.9em;
    font-weight: 600;
}

.chip-list, .bios-list, .control-list { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.chip-item, .bios-item {
    background: linear-gradient(135deg, var(--color-gray-100) 0%, #e8eaf6 100%);
    padding: var(--space-2xl) var(--space-3xl);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.control-item {
    background: linear-gradient(135deg, var(--color-gray-100) 0%, #e8eaf6 100%);
    padding: var(--space-2xl) var(--space-3xl);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.chip-item:hover, .bios-item:hover {
    background: #f8f9ff;
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.control-item:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.chip-item.cpu { 
    border-left-color: var(--color-accent-orange); 
    background: linear-gradient(135deg, var(--color-white) 0%, #fff3e0 100%); 
}

.chip-item.audio { 
    border-left-color: var(--color-accent-cyan); 
    background: linear-gradient(135deg, var(--color-white) 0%, #e0f7fa 100%); 
}

.chip-name { 
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
    font-size: 1em;
}

.chip-clock { 
    color: var(--color-text-secondary);
    font-size: 0.9em;
    font-family: var(--font-mono);
}

.display-specs { 
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.display-spec {
    background: white;
    padding: var(--space-xl) var(--space-3xl);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 100px;
    border-bottom: 3px solid #667eea;
}

.display-spec-label {
    font-size: 0.75em;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.display-spec-value { 
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-primary-dark);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 1024px) {
    .machine-content {
        grid-template-columns: 1fr;
        gap: var(--space-5xl);
        padding: var(--space-5xl) var(--space-6xl);
    }
    
    .machine-thumbnail {
        order: -1;
    }
    
    .thumbnail-image {
        width: 240px;
        height: 180px;
    }
}

@media (max-width: 768px) {
    body { 
        padding: var(--space-xl); 
    }
    
    .report-page-header {
        padding: var(--space-5xl);
        border-radius: var(--radius-lg);
    }
    
    .header-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xl);
    }
    
    .brand-title {
        font-size: 1.5em;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .header-link {
        flex: 1;
        justify-content: center;
        font-size: 0.85em;
        padding: var(--space-lg) var(--space-2xl);
    }
    
    .machine-details-card {
        border-radius: var(--radius-lg);
    }
    
    .machine-content {
        padding: var(--space-5xl);
        gap: var(--space-5xl);
    }
    
    .machine-title {
        font-size: 1.5em;
    }
    
    .machine-metadata {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-lg);
    }
    
    .meta-badge.machine-name-badge,
    .meta-pill {
        justify-content: center;
        width: 100%;
    }
    
    .meta-separator {
        display: none;
    }
    
    .thumbnail-image {
        width: 100%;
        max-width: 240px;
        height: auto;
    }
    
    .header {
        padding: var(--space-5xl) var(--space-xl);
    }
    
    .header h1 { 
        font-size: 1.6em !important;
        margin-bottom: var(--space-md);
    }
    
    .header .subtitle {
        font-size: 0.9em;
    }
    
    .json-button {
        flex: 1;
        min-width: 140px;
        justify-content: center;
        padding: var(--space-xl) var(--space-5xl); /* Override .btn-md for tablet */
        font-size: 0.95em;
    }
    
    .search-card, .card {
        padding: var(--space-5xl);
    }
    
    .search-card h2, .card h2 {
        font-size: 1.2em;
    }
    
    .search-type-selector {
        gap: var(--space-md);
    }
    
    .radio-label {
        padding: var(--space-md) var(--space-2xl);
        font-size: 0.9em;
    }
    
    .search-input-group { 
        flex-direction: column;
        gap: var(--space-xl);
    }
    
    .search-input { 
        font-size: 1em;
        padding: var(--space-2xl) var(--space-3xl);
    }
    
    .search-button, .clear-button { 
        padding: var(--space-2xl) var(--space-6xl); /* Override .btn-lg for tablet */
        width: 100%;
    }
    
    .results-container {
        padding: var(--space-5xl) var(--space-xl);
    }
    
    .results-header h2 {
        font-size: 1.3em;
    }
    
    .result-item {
        padding: var(--space-xl) var(--space-4xl);
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .result-thumbnail {
        width: 100%;
        max-width: 160px;
        height: 120px;
        margin: 0 auto;
        display: block;
    }
    
    .result-title {
        font-size: 1.15em;
    }
    
    .result-metadata {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .result-meta-badge,
    .result-meta-pill {
        justify-content: center;
        width: 100%;
    }
    
    .result-details {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .no-results {
        padding: var(--space-9xl) var(--space-xl);
    }
    
    .no-results-icon {
        font-size: 3em;
    }
    
    .no-results h3 {
        font-size: 1.25em;
    }
    
    .examples {
        padding: var(--space-5xl);
    }
    
    .example-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--space-lg);
    }
    
    .example-item {
        padding: var(--space-xl);
    }
    
    .example-crc {
        font-size: 0.95em;
    }
    
    .info-card {
        padding: var(--space-5xl);
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .match {
        padding: var(--space-xl);
    }
    
    .match-header {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .game-screenshot {
        width: 100%;
        max-width: 240px;
        height: 180px;
        margin: 0 auto;
        display: block;
    }
    
    .match-header h2 {
        font-size: 1.3em;
    }
    
    .match-header .machine-name {
        font-size: 1em;
    }
    
    .section-title {
        font-size: 1em;
        padding: var(--space-md) var(--space-xl);
    }
    
    .info-grid { 
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .info-item {
        padding: var(--space-lg);
    }
    
    .info-item value {
        font-size: 0.9em;
    }
    
    .rom-item { 
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        gap: var(--space-lg);
        padding: var(--space-2xl);
        align-items: flex-start;
    }
    
    .rom-marker {
        display: none !important;
    }
    
    .rom-name {
        font-size: 0.95em;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: normal;
    }
    
    .rom-name::before {
        content: 'File: ';
        font-weight: 400;
        color: var(--color-text-secondary);
        font-family: 'Segoe UI', sans-serif;
    }
    
    .rom-crc {
        font-size: 0.85em;
        text-align: left !important;
        width: 100%;
        max-width: 100%;
    }
    
    .rom-crc::before {
        content: 'CRC32: ';
        font-weight: 400;
        color: var(--color-text-secondary);
        font-family: 'Segoe UI', sans-serif;
    }
    
    .rom-crc a {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .rom-sha1 {
        font-size: 0.85em;
        text-align: left !important;
        width: 100%;
        max-width: 100%;
    }
    
    .rom-sha1::before {
        content: 'SHA1: ';
        font-weight: 400;
        color: var(--color-text-secondary);
        font-family: 'Segoe UI', sans-serif;
    }
    
    .rom-sha1-link {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .rom-size {
        text-align: left !important;
        font-size: 0.85em;
        color: #888;
        width: 100%;
    }
    
    .rom-size::before {
        content: 'Size: ';
        font-weight: 600;
        color: var(--color-text-secondary);
    }
    
    .display-specs { 
        justify-content: space-between;
        gap: var(--space-lg);
    }
    
    .display-spec {
        flex: 1;
        min-width: 80px;
        padding: var(--space-lg) var(--space-md);
    }
    
    .display-spec-value {
        font-size: 1em;
    }
    
    .chip-item, .bios-item, .control-item {
        padding: var(--space-md) var(--space-lg);
    }
    
    .back-to-top {
        bottom: var(--space-5xl);
        right: var(--space-5xl);
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
    
    .result-rom-info {
        flex-direction: column;
        gap: var(--space-lg);
        align-items: stretch;
        padding: var(--space-2xl);
    }
    
    .rom-detail-item {
        display: block;
        width: 100%;
        font-size: 0.85em;
        word-break: break-all;
    }
    
    .rom-detail-item strong {
        display: block;
        font-family: 'Segoe UI', sans-serif;
        color: var(--color-text-secondary);
        font-weight: 400;
        font-size: 0.95em;
        margin-bottom: var(--space-xs);
    }
    
    .rom-detail-item a {
        display: block;
        word-break: break-all;
    }
    
    .rom-detail-item:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .header h1 { 
        font-size: 1.3em !important; 
    }
    
    .header .machine-label { 
        font-size: 0.85em;
        padding: var(--space-xs) var(--space-xl);
    }
    
    .header .meta {
        font-size: 0.9em;
    }
    
    .json-button {
        font-size: 0.9em;
        padding: var(--space-lg) var(--space-4xl); /* Override .btn-md for mobile */
    }
    
    .example-list {
        grid-template-columns: 1fr;
    }
    
    .display-spec {
        min-width: 70px;
    }
    
    .rom-item-enhanced {
        padding: var(--space-lg) var(--space-xl);
    }
    
    .rom-name-col .rom-name {
        font-size: 0.9em;
    }
    
    .rom-size {
        font-size: 0.85em;
    }
    
    .rom-badge {
        font-size: 0.7em;
        padding: 2px var(--space-sm);
    }
    
    .rom-detail a[href*="/search/crc"],
    .rom-detail a[href*="/search/sha1"],
    .rom-detail .rom-sha1-link {
        font-size: 0.75em;
        padding: 2px var(--space-xs);
    }
}

/* ===== COLLAPSIBLE SECTIONS ===== */
.collapsible-section {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3xl);
    box-shadow: var(--shadow-base);
    border: 1px solid #e1e8ed;
    overflow: hidden;
    transition: all var(--transition-base);
}

/* Hide all default disclosure markers in collapsible sections */
.collapsible-section summary {
    list-style: none;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary::marker {
    display: none;
    content: '';
}

.collapsible-section:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
    border-color: var(--color-primary);
}

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-3xl) var(--space-5xl);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
    transition: all var(--transition-base);
}

.section-header::-webkit-details-marker {
    display: none;
}

.section-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.section-title-text {
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.section-toggle {
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

details[open] .section-toggle {
    transform: rotate(180deg);
}

.section-content {
    padding: var(--space-5xl);
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ENHANCED ROM LIST ===== */
.rom-list-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.rom-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rom-group-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95em;
    border-left: 4px solid var(--color-primary);
}

.rom-item-enhanced {
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    border: 1px solid #e1e8ed;
    border-radius: var(--radius-md);
    padding: var(--space-2xl) var(--space-3xl);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.rom-item-enhanced:hover {
    background: #fff;
    border-color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.15);
}

.rom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
}

.rom-name-col {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.rom-name-col .rom-name {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.05em;
    word-break: break-all;
}

.rom-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.rom-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.rom-detail-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* CRC32 links in ROM details */
.rom-detail a[href*="/search/crc"] {
    color: var(--color-primary);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.95em;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    background: rgba(102, 126, 234, 0.08);
    word-break: break-all;
}

.rom-detail a[href*="/search/crc"]:hover {
    background: rgba(102, 126, 234, 0.2);
    text-decoration: underline;
    transform: translateY(-1px);
}

/* SHA1 links in ROM details */
.rom-detail a[href*="/search/sha1"],
.rom-detail .rom-sha1-link {
    color: #00acc1;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.85em;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    background: rgba(0, 172, 193, 0.08);
    word-break: break-all;
}

.rom-detail a[href*="/search/sha1"]:hover,
.rom-detail .rom-sha1-link:hover {
    background: rgba(0, 172, 193, 0.2);
    text-decoration: underline;
    transform: translateY(-1px);
}

.rom-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}

.rom-no-value {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ===== CLEAN ROM LIST STYLES (ADVANCED VIEW) ===== */
.rom-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xl);
}

.rom-region-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.rom-region-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-2xl);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: var(--shadow-md);
}

.rom-region-name {
    flex: 1;
}

.rom-region-count {
    opacity: 0.9;
    font-size: 0.9em;
}

.rom-region-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-left: 0;
}

.rom-item-advanced {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: var(--radius-md);
    padding: var(--space-xl) var(--space-3xl);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rom-item-advanced:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.rom-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
}

.rom-item-name-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.rom-item-name {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: 0.95em;
    word-break: break-all;
}

.rom-item-size {
    color: var(--color-text-secondary);
    font-size: 0.85em;
    white-space: nowrap;
    font-weight: 500;
}

.rom-item-hashes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5xl);
    padding: var(--space-md) 0;
    border-top: 1px solid #f0f0f0;
}

.rom-hash-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.rom-hash-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.rom-hash-link {
    color: var(--color-primary);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.85em;
    transition: all var(--transition-fast);
    display: inline-block;
    word-break: break-all;
}

.rom-hash-link:hover {
    text-decoration: underline;
}

.rom-hash-sha1 {
    color: #00acc1;
}

.rom-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-top: var(--space-xs);
}

/* ===== ENHANCED CHIP & BIOS LISTS ===== */
.chip-list-enhanced,
.bios-list-enhanced,
.controls-list-enhanced {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.chip-item-enhanced,
.bios-item-enhanced,
.control-item-enhanced {
    background: var(--gradient-item);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2xl) var(--space-3xl);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.chip-item-enhanced:hover,
.bios-item-enhanced:hover,
.control-item-enhanced:hover {
    background: var(--color-bg-white);
    border-color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.chip-item-enhanced.chip-cpu {
    border-left: 4px solid var(--color-accent-orange);
}

.chip-item-enhanced.chip-audio {
    border-left: 4px solid var(--color-accent-cyan);
}

.control-item-enhanced {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.controls-list-container {
    margin-top: var(--space-xl);
}

/* ===== LINK STYLES ===== */
.search-link {
    color: var(--color-primary-dark);
    text-decoration: none;
    border-bottom: 2px solid var(--color-primary);
    transition: all var(--transition-base);
}

.search-link:hover {
    border-bottom-color: var(--color-primary-light);
}

.crc-link {
    color: var(--color-primary);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* ===== CHIP ITEM LAYOUTS ===== */
.chip-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chip-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.chip-details {
    flex: 1;
}

.chip-name {
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.05em;
}

.chip-meta {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ===== BIOS ITEM LAYOUTS ===== */
.bios-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bios-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.bios-details {
    flex: 1;
}

.bios-name-row {
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.05em;
}

.bios-description {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ===== SOURCE FILE CODE STYLE ===== */
.source-file-code {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

/* ===== DISPLAY SUBTITLE ===== */
.display-subtitle {
    font-size: 1.05em;
    color: var(--color-text-secondary);
    margin: 15px 0 10px 0;
}

.display-subtitle-strong {
    font-weight: 600;
    color: var(--color-primary);
}

/* ===== CONTROL PLAYER TITLE ===== */
.control-player-title {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ===== ROM CRC AND SHA1 BADGES (Homepage) ===== */
.rom-crc-badge {
    font-family: 'Courier New', Courier, monospace;
    color: var(--color-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(102, 126, 234, 0.08);
}

.rom-sha1-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    color: #00acc1;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(0, 172, 193, 0.08);
}

/* ===== ERROR PAGE INLINE STYLES ===== */
.error-card {
    text-align: center;
}

.error-title {
    color: #f44336;
    margin-bottom: var(--space-xl);
}

.suggestions-card {
    margin-top: var(--space-6xl);
}

.suggestions-title {
    color: var(--color-primary-dark);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.error-actions {
    display: flex;
    gap: var(--space-xl);
    margin-top: var(--space-7xl);
    justify-content: center;
    flex-wrap: wrap;
}

.error-icon-container {
    text-align: center;
    margin-bottom: var(--space-7xl);
}

.error-icon {
    width: 120px;
    height: 120px;
}

.error-message {
    font-size: 1.2em;
    color: #555;
    line-height: 1.8;
    margin-bottom: var(--space-7xl);
}

.error-suggestions-list {
    text-align: left;
    max-width: 500px;
    margin: 0 auto var(--space-7xl);
    padding-left: 0;
    list-style-type: none;
}

.error-suggestion-item {
    padding: var(--space-xl) var(--space-xl) var(--space-xl) var(--space-8xl);
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    color: #555;
    line-height: 1.6;
}

.error-suggestion-arrow {
    position: absolute;
    left: var(--space-xl);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    font-weight: bold;
}

.error-home-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-2xl) var(--space-7xl);
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.error-home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.error-home-icon {
    width: 20px;
    height: 20px;
}

.footer-links {
    margin-top: 5px;
}

/* ===== INDEX PAGE BUTTON STYLES ===== */
.search-button-icon,
.clear-button-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.output-formats-title {
    margin-top: var(--space-7xl);
}

.output-formats-description {
    margin-bottom: var(--space-xl);
}

/* ===== FOOTER INLINE STYLES ===== */
.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

/* ===== RESPONSIVE COLLAPSIBLE SECTIONS ===== */
@media (max-width: 768px) {
    .section-content {
        padding: 15px;
    }
    
    .rom-details-row {
        grid-template-columns: 1fr;
    }
    
    .rom-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rom-size {
        align-self: flex-start;
        font-size: 0.9em;
    }
    
    .rom-name-col .rom-name {
        font-size: 0.95em;
    }
    
    .rom-badges {
        gap: 4px;
    }
    
    .rom-detail-label {
        font-size: 0.7em;
    }
    
    .rom-detail a[href*="/search/crc"],
    .rom-detail a[href*="/search/sha1"],
    .rom-detail .rom-sha1-link {
        font-size: 0.8em;
        padding: 3px 6px;
    }
    
    .section-header {
        padding: 14px 16px;
    }
    
    .section-title-text {
        font-size: 1em;
    }
    
    .rom-item-enhanced {
        padding: 12px 14px;
    }
    
    /* Advanced ROM list mobile adjustments */
    .rom-item-advanced {
        padding: 10px 12px;
    }
    
    .rom-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rom-item-name-section {
        width: 100%;
    }
    
    .rom-item-size {
        width: 100%;
        font-size: 0.8em;
    }
    
    .rom-item-hashes {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rom-hash-label {
        font-size: 0.65em;
    }
    
    .rom-hash-link {
        font-size: 0.8em;
    }
}

/* ===== ADVANCED REPORT STYLES ===== */

/* Advanced mode badge */
.advanced-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, #ff6f00 0%, #ff8f00 100%);
    color: white;
    padding: var(--space-md) var(--space-3xl);
    border-radius: var(--radius-lg);
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    box-shadow: 0 3px 10px rgba(255, 111, 0, 0.3);
    letter-spacing: 0.3px;
}

.advanced-badge svg {
    flex-shrink: 0;
}

/* Advanced mode machine details card */
.machine-details-card.advanced-mode {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d6 100%);
    border: 2px solid rgba(255, 111, 0, 0.2);
}

/* Advanced controls */
.advanced-controls {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-5xl);
    flex-wrap: wrap;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-lg) var(--space-4xl);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.control-btn img,
.control-btn svg {
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* Advanced ROM list */
.advanced-rom-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.advanced-rom-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-lg);
    padding: var(--space-4xl);
    transition: all var(--transition-base);
}

.advanced-rom-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.advanced-rom-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 2px solid #667eea;
}

.advanced-rom-name {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.1em;
}

.advanced-rom-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
}

.advanced-rom-detail {
    background: white;
    padding: var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.advanced-rom-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    font-weight: 600;
}

.advanced-rom-value {
    font-family: 'Courier New', monospace;
    color: var(--color-primary-dark);
    font-size: 0.95em;
    font-weight: 600;
    word-break: break-all;
}

.advanced-rom-value a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.advanced-rom-value a:hover {
    text-decoration: underline;
}

/* Advanced subsections */
.advanced-subsection {
    margin-bottom: 25px;
}

.advanced-subsection-title {
    color: var(--color-primary);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

/* Advanced control items */
.advanced-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.advanced-control-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-base);
}

.advanced-control-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.advanced-control-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid #667eea;
}

.advanced-control-player {
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1em;
}

.advanced-control-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.advanced-control-detail {
    background: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.advanced-control-label {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.advanced-control-value {
    font-family: 'Courier New', monospace;
    color: var(--color-primary-dark);
    font-weight: 600;
}

/* Advanced display enhancements */
.info-grid .info-item {
    position: relative;
}

.info-grid .info-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width var(--transition-base);
}

.info-grid .info-item:hover::after {
    width: 100%;
}

/* Responsive advanced styles */
@media (max-width: 768px) {
    .advanced-badge {
        font-size: 0.85em;
        padding: 6px 12px;
    }
    
    .advanced-controls {
        gap: 8px;
    }
    
    .control-btn {
        font-size: 0.85em;
        padding: 8px 14px;
        flex: 1;
        justify-content: center;
    }
    
    .advanced-rom-details {
        grid-template-columns: 1fr;
    }
    
    .advanced-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .advanced-rom-item {
        padding: 14px;
    }
    
    .advanced-rom-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .advanced-rom-name {
        font-size: 1em;
    }
    
    .advanced-subsection-title {
        font-size: 1em;
    }
    
    .advanced-control-item {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .advanced-badge {
        font-size: 0.8em;
        padding: 6px 10px;
        gap: 6px;
    }
    
    .advanced-badge svg {
        width: 16px;
        height: 16px;
    }
    
    .control-btn {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    
    .advanced-rom-detail {
        padding: 8px 10px;
    }
    
    .advanced-rom-label {
        font-size: 0.7em;
    }
    
    .advanced-rom-value {
        font-size: 0.85em;
    }
}

/* ===== DIP SWITCH & CONFIGURATION STYLES ===== */
.dip-switch-item {
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    background: white;
}

.dip-switch-item:not(:last-child) {
    margin-bottom: var(--space-xl);
}

.dip-switch-item .section-content {
    padding: 0;
}

.dip-switch-summary {
    cursor: pointer;
    padding: var(--space-xl);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-base);
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
    list-style: none;
}

/* Hide ALL default disclosure triangles */
.dip-switch-summary::-webkit-details-marker {
    display: none;
}

.dip-switch-summary::marker {
    display: none;
    content: '';
}

.dip-switch-summary::before {
    display: none !important;
}

.dip-switch-summary:hover {
    background: linear-gradient(135deg, #e8ebf0 0%, #b8c5d9 100%);
}

.dip-switch-item[open] .dip-switch-summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid #ddd;
}

.dip-switch-summary .chevron {
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.dip-switch-item[open] .dip-switch-summary .chevron {
    transform: rotate(180deg);
}

/* Legacy selectors - keeping for backwards compatibility */
.dip-switch-item summary {
    list-style: none;
}

.dip-switch-item summary::-webkit-details-marker {
    display: none;
}

.dip-switch-item summary::marker {
    display: none;
    content: '';
}

/* Also target any nested details elements */
.dip-switch-item details summary {
    list-style: none;
}

.dip-switch-item details summary::-webkit-details-marker {
    display: none;
}

.dip-switch-item details summary::marker {
    display: none;
    content: '';
}

.dip-tag-mask {
    margin-left: auto;
    font-size: 0.85em;
    color: #495057;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.7);
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-sm);
}

.dip-locations {
    padding: var(--space-xl);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}

.dip-locations strong {
    color: #495057;
    margin-right: var(--space-md);
}

.dip-values {
    padding: var(--space-xl);
}

.dip-value {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    border-left: 3px solid #667eea;
}

.dip-value:last-child {
    margin-bottom: 0;
}

.dip-value-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-text-primary);
}

.dip-value-hex {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: #495057;
}

@media (max-width: 768px) {
    .dip-tag-mask {
        display: block;
        margin-left: 0;
        margin-top: var(--space-md);
    }
    
    .dip-value {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dip-value-hex {
        align-self: flex-start;
    }
}

/* ===== ICON COLOR FILTERS ===== */
/* These filters convert black SVG icons to specific colors */

/* White - for header icons on dark backgrounds */
.filter-white,
.header-link img,
.header-link svg,
.meta-badge.machine-name-badge img,
.meta-badge.machine-name-badge svg {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(7500%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* Purple/Blue (#667eea) - primary brand color for most icons */
.filter-purple,
.icon-folder,
.icon-layers,
.icon-chevron,
.bios-icon,
.chip-icon-bios,
.meta-pill img,
.meta-pill svg {
    filter: brightness(0) saturate(100%) invert(52%) sepia(79%) saturate(2476%) hue-rotate(216deg) brightness(95%) contrast(91%);
}

/* Orange (#ff6f00) - for CPU chips */
.filter-orange,
.chip-icon-cpu {
    filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(2299%) hue-rotate(1deg) brightness(104%) contrast(107%);
}

/* Cyan (#00acc1) - for audio/speaker chips */
.filter-cyan,
.chip-icon-audio {
    filter: brightness(0) saturate(100%) invert(59%) sepia(82%) saturate(1234%) hue-rotate(145deg) brightness(94%) contrast(101%);
}

/* Deep Purple (#764ba2) - for error icons */
.filter-deep-purple,
.error-icon {
    filter: brightness(0) saturate(100%) invert(35%) sepia(59%) saturate(949%) hue-rotate(238deg) brightness(88%) contrast(87%);
}

/* Green - example utility class (can be used for success states) */
.filter-green {
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(86deg) brightness(118%) contrast(119%);
}

/* Additional utility filters for potential use */
.filter-red {
    filter: brightness(0) saturate(100%) invert(27%) sepia(98%) saturate(4490%) hue-rotate(349deg) brightness(95%) contrast(97%);
}

.filter-yellow {
    filter: brightness(0) saturate(100%) invert(87%) sepia(61%) saturate(1621%) hue-rotate(359deg) brightness(102%) contrast(104%);
}






