        
        :root {
            /* Theme Colors */
            --main-color: #1A48EE;
            --secondary-color: #008AFF;
            --tertiary-color: #2c20E6;
            --secondary-background: #f9f9f9;
            --main-background: #e5f3ff;
            --tertiary-background: #e6e5ea;
            --color-white: #ffffff;
            --color-error-dark: #c53030;
            --color-green: #16a34a;
            --color-green-dark: #047857;
            --color-light-green: #D1FAE5;
            --color-contrast-green: #065F46;
            --border-color: #e2e8f0;
            --color-gray: #4a5568;
            --color-light-gray: #ccc;
            --color-very-light-gray: #e0e0e0;
            
            /* Preserved Game Specific Variables */
            --game-bg: var(--main-background);
            --panel-bg: var(--color-white);
            --text-color: #1a202c;
            
            /* Original Game Colors for Header Restoration */
            --orig-primary: #2c3e50;
            --orig-accent: #3498db;
            --orig-success: #27ae60;
        }

        /* --- Accessibility Utils --- */
        .sr-only {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
        }

        /* Global High Contrast Focus State */
        *:focus-visible {
            outline: 3px solid var(--secondary-color);
            outline-offset: 2px;
        }

        /* --- Shared UI Components --- */
        .card {
            background-color: var(--color-white);
            border-radius: 8px;
            border: 1px solid var(--border-color);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
            padding: 2rem;
            margin-bottom: 2rem;
            height: 100%; 
        }

        label {
            display: block;
            font-size: 0.875rem;
            font-weight: bold;
            color: var(--color-gray);
            margin-bottom: 0.5rem;
        }

        /* Mobile-Friendly Inputs (Touch Targets) */
        input[type="number"], 
        input[type="text"], 
        input[type="date"], 
        select,
        .btn {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid #cbd5e0;
            border-radius: 0.375rem;
            box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            font-size: 1rem;
            font-family: Arial, Helvetica, sans-serif;
            background-color: var(--color-white);
            min-height: 44px; /* WCAG Touch Target Minimum */
        }

        select:focus, input:focus {
            outline: none;
            border-color: var(--main-color);
            box-shadow: 0 0 0 3px rgba(26, 72, 238, 0.4);
        }

        .btn {
            background-color: var(--main-color);
            color: var(--color-white);
            font-weight: bold;
            padding: 0.75rem 2rem;
            border: none;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            transition: background-color 0.3s;
            cursor: pointer;
            font-size: 1rem;
            text-align: center;
            display: inline-block;
            width: 100%;
        }

        .btn:hover {
            background-color: var(--secondary-color);
        }

        /* --- Game Specific Layout --- */
        
        /* Game Header (Using class instead of header tag) */
        .game-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 2px solid var(--orig-primary);
            padding-bottom: 10px;
            width: 100%;
            flex-wrap: wrap; /* Allow wrapping on small screens */
            gap: 15px;
        }

        .game-header h1 {
            margin: 0;
            color: var(--orig-primary);
            font-size: 1.8rem;
            text-align: left;
            width: auto;
            display: block;
        }
        
        .game-header small {
            display: block;
            color: #666;
            font-size: 0.85em;
        }

        .header-stats {
            font-weight: bold; 
            font-size: 1.1rem;
            text-align: right;
        }
        
        .funding { color: var(--color-contrast-green); }
        .level { color: var(--main-color); margin-left: 15px; }

        /* Game Grid */
        .game-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            align-items: start;
        }

        /* Lab Bench Controls */
        .control-group { margin-bottom: 1.5rem; }

        /* Specimen Preview Box */
        .preview-container {
            margin: 20px 0;
            text-align: center;
        }
        
        .preview-box {
            height: 180px;
            background: var(--secondary-background);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            border: 2px dashed var(--border-color);
        }
        
        .preview-label {
            font-size: 0.9rem;
            font-weight: bold;
            color: var(--color-gray);
            background: #fff;
            padding: 4px 8px;
            border-radius: 4px;
            border: 1px solid var(--border-color);
            display: inline-block;
        }

        /* Logbook */
        .log-container {
            max-height: 450px;
            overflow-y: auto;
            border: 1px solid var(--border-color);
            border-radius: 6px;
        }
        
        .log-container table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
        .log-container th, .log-container td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border-color); }
        .log-container th { background: var(--secondary-background); position: sticky; top: 0; color: var(--color-gray); font-weight: bold; }
        
        .result-positive { color: var(--color-contrast-green); font-weight: bold; }
        .result-negative { color: var(--color-error-dark); font-weight: bold; }

        /* Publication Desk */
        .publication-area {
            grid-column: 1 / -1;
            margin-top: 0;
        }

        .hypothesis-builder {
            background: var(--secondary-background);
            padding: 20px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            margin-top: 1rem;
        }

        .rule-row {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .rule-row span {
            font-weight: bold;
            color: var(--color-gray);
        }
        
        .rule-row select {
            width: auto;
            min-width: 150px;
        }
        
        .connector-row {
            margin: 15px 0;
            font-weight: bold;
            color: var(--main-color);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .connector-row select {
            width: 100px;
            background-color: var(--main-background);
            border-color: var(--main-color);
            color: var(--main-color);
            font-weight: bold;
            text-align: center;
        }

        .btn-submit { 
            background: var(--color-gray); 
            margin-top: 20px;
        }
        .btn-submit:hover { background: #2d3748; }

        /* --- MEDIA QUERIES FOR MOBILE --- */
        @media (max-width: 985px) {
            .game-grid { grid-template-columns: 1fr; gap: 1rem; }
            .game-header { justify-content: center; text-align: center; }
            .game-header h1 { text-align: center; width: 100%; }
            .header-stats { text-align: center; width: 100%; margin-top: 5px; }
            .card { padding: 1.5rem; }
        }

        @media (max-width: 600px) {
            .card { padding: 1.25rem; }
            
            /* Stack Publication Desk Logic vertically on small screens */
            .rule-row { 
                flex-direction: column; 
                align-items: stretch; 
                background: #fff;
                padding: 10px;
                border-radius: 6px;
                border: 1px dashed var(--border-color);
            }
            
            .rule-row span { margin-bottom: 2px; font-size: 0.85rem;}
            .rule-row select { width: 100%; margin-bottom: 10px; }
            
            /* Adjust preview box height */
            .preview-box { height: 150px; }
            
            /* Ensure buttons are large enough */
            .btn { padding: 1rem; }
        }

        /* --- PRESERVED GAME PIECE STYLES --- */
        .specimen {
            width: 80px;
            height: 80px;
            transition: all 0.3s ease;
            position: relative;
        }

        /* Shapes */
        .shape-circle { border-radius: 50%; }
        .shape-square { border-radius: 0; }
        .texture-hollow.shape-triangle {
            background-color: currentColor !important; 
            border: none !important; 
            opacity: 1 !important; /* Ensure fully opaque for the 'border' */
        }

        /* The Mask */
        .texture-hollow.shape-triangle::after {
            content: '';
            position: absolute;
            top: 10%; 
            left: 10%;
            width: 80%; 
            height: 80%;
            background-color: var(--secondary-background); /* Matches the preview box background */
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
            z-index: 1;
        }
        .shape-triangle {
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
            width: 80px; height: 80px; 
            position: relative;
        }
        .shape-diamond {
            transform: rotate(45deg) scale(0.8);
        }

        /* Textures */
        .texture-striped {
            background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.3) 10px, transparent 10px, transparent 20px);
        }
        .texture-dotted {
            background-image: radial-gradient(rgba(255,255,255,0.5) 20%, transparent 20%);
            background-size: 20px 20px;
        }
        .texture-hollow {
            background-color: transparent !important;
            border: 8px solid; 
            box-sizing: border-box;
        }
       

        /* Feedback Modal */
        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 100;
            backdrop-filter: blur(2px);
            padding: 20px; /* Prevent edge touching on mobile */
        }
        .modal {
            background: var(--color-white); 
            padding: 2rem; 
            border-radius: 8px;
            max-width: 500px; 
            width: 100%; 
            text-align: center;
            box-shadow: 0 10px 25px rgba(0,0,0,0.2);
            border: 1px solid var(--border-color);
            max-height: 90vh; /* Ensure it fits on small vertical screens */
            overflow-y: auto;
        }
        .modal h2 { color: var(--main-color); }
        .modal-btn { margin-top: 20px; }
        
        .info-grid {
             display: grid; 
             grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
             gap: 2rem;
             margin-top: 1rem;
        }
        
        @media (max-width: 600px) {
            .info-grid { grid-template-columns: 1fr; gap: 1rem; }
        }
