        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #1a202c;
            overflow: hidden;
        }

        .app-container {
            display: grid;
            grid-template-columns: 320px 1fr 350px;
            grid-template-rows: 80px 1fr;
            height: 100vh;
            max-width: 1800px;
            margin: 0 auto;
            gap: 15px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.15);
            overflow: hidden;
        }

        .header {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
        }

        .header h1 {
            font-size: 2em;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #48bb78;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.7; transform: scale(1.1); }
        }

        .controls-panel {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow-y: auto;
            overflow-x: visible;
            height: calc(100vh - 110px);
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .controls-panel::-webkit-scrollbar {
            width: 6px;
        }

        .controls-panel::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .controls-panel::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 3px;
        }

        .experiment-area {
            position: relative;
            overflow: hidden;
            border-radius: 15px;
            background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #e2e8f0 100%);
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
        }

        .info-button {
            position: absolute;
            top: 15px;
            left: 15px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            border: none;
            font-size: 18px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
            transition: all 0.3s ease;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .info-button:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(66, 153, 225, 0.5);
        }

        .info-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .info-modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

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

        .info-modal-content {
            background: white;
            border-radius: 20px;
            max-width: 800px;
            max-height: 90vh;
            width: 90%;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            animation: slideIn 0.3s ease;
        }

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

        .info-modal-header {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            padding: 20px 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .info-modal-header h2 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 600;
        }

        .close-button {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease;
        }

        .close-button:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .info-modal-body {
            padding: 0;
            max-height: calc(90vh - 80px);
            overflow-y: auto;
        }

        .info-modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .info-modal-body::-webkit-scrollbar-track {
            background: #f1f5f9;
        }

        .info-modal-body::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 4px;
        }

        .feature-section {
            padding: 20px 25px;
            border-bottom: 1px solid #e2e8f0;
        }

        .feature-section:last-child {
            border-bottom: none;
        }

        .feature-section h3 {
            color: #2d3748;
            margin: 0 0 15px 0;
            font-size: 1.2rem;
            font-weight: 600;
        }

        .feature-section ul,
        .feature-section ol {
            margin: 0;
            padding-left: 20px;
        }

        .feature-section li {
            margin: 8px 0;
            line-height: 1.5;
            color: #4a5568;
        }

        .feature-section strong {
            color: #2d3748;
            font-weight: 600;
        }

        .observations-panel {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow-y: auto;
            height: calc(100vh - 110px);
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .observations-panel::-webkit-scrollbar {
            width: 6px;
        }

        .observations-panel::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .observations-panel::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 3px;
        }

        .control-section {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            overflow: visible;
            position: relative;
        }

        .control-section h3 {
            color: #2d3748;
            margin-bottom: 15px;
            font-size: 1.1em;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .control-section h3::before {
            content: '⚙️';
            font-size: 1.2em;
        }

        .input-group {
            margin-bottom: 20px;
            padding: 15px;
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            position: relative;
            overflow: visible;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            color: #374151;
        }

        .input-group input, .input-group select {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background: white;
            color: #374151;
            font-size: 0.9rem;
            transition: all 0.2s ease;
            position: relative;
            z-index: 10;
            min-height: 44px;
            box-sizing: border-box;
        }

        .input-group select {
            cursor: pointer;
            height: 44px;
            line-height: 1.2;
            font-family: inherit;
        }

        .input-group select option {
            padding: 8px 12px;
            background: white;
            color: #374151;
            font-size: 0.9rem;
        }

        .input-group select:focus, .input-group select:active {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            z-index: 20;
        }

        /* Force dropdown to display properly - Debug version */
        .input-group select:focus {
            position: relative;
            z-index: 1000;
        }

        /* Ensure dropdown options are visible */
        select option {
            background: white !important;
            color: #374151 !important;
            padding: 8px 12px !important;
            font-size: 0.9rem !important;
        }

        /* Debug: Force objectCount dropdown to work */
        #objectCount {
            position: relative !important;
            z-index: 999 !important;
            pointer-events: auto !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        #objectCount:focus,
        #objectCount:hover {
            outline: 2px solid red !important;
        }

        .btn {
            width: 100%;
            padding: 12px 16px;
            border: none;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .btn-primary {
            background: linear-gradient(135deg, #3b82f6, #1e40af);
            color: white;
        }

        .btn-secondary {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
        }

        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
        }

        .btn-warning {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
        }

        .simulation-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 20px;
            overflow: hidden;
            position: relative;
        }

        .chord-ring {
            width: 100%;
            height: 100%;
            min-height: 500px;
        }

        .node {
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
        }

        .node:hover {
            transform: scale(1.15);
            filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
        }

        .node-circle {
            fill: url(#nodeGradient);
            stroke: rgba(59, 130, 246, 0.8);
            stroke-width: 3px;
            transition: all 0.3s ease;
        }

        .node-active {
            fill: url(#activeGradient);
            animation: nodePulse 2s infinite;
        }

        .node-highlight {
            fill: url(#highlightGradient);
            stroke: #dc2626;
            stroke-width: 4px;
            animation: glow 1s ease-in-out infinite alternate;
        }

        @keyframes nodePulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.7; transform: scale(1.05); }
        }

        @keyframes glow {
            from { filter: drop-shadow(0 0 10px #dc2626); }
            to { filter: drop-shadow(0 0 20px #ff6b6b); }
        }

        .finger-table {
            stroke: url(#fingerGradient);
            stroke-width: 2px;
            opacity: 0.8;
            stroke-dasharray: 8, 4;
            animation: dashflow 3s linear infinite;
        }

        .successor-link {
            stroke: url(#successorGradient);
            stroke-width: 4px;
            opacity: 0.9;
            filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.4));
        }

        @keyframes dash {
            to { stroke-dashoffset: -23; }
        }

        @keyframes dashflow {
            to { stroke-dashoffset: -12; }
        }

        @keyframes pathglow {
            from { opacity: 0.8; }
            to { opacity: 1; }
        }

        .status-section {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-radius: 12px;
            padding: 15px;
            border: 1px solid #e2e8f0;
        }

        .status-section h4 {
            color: #2d3748;
            margin-bottom: 12px;
            font-size: 1em;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .status-section h4::before {
            content: '📊';
            font-size: 1.1em;
        }

        .stat-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            border: 1px solid #e2e8f0;
            transition: all 0.3s ease;
            margin-bottom: 15px;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        }

        .stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 0.9rem;
            color: #64748b;
            font-weight: 500;
        }

        .stat-description {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-top: 5px;
        }

        #nodeCount { color: #3b82f6; }
        #ringSize { color: #10b981; }
        #objectCount { color: #8b5cf6; }
        #currentRound { color: #059669; }
        #lookupHops { color: #f59e0b; }
        #avgHops { color: #8b5cf6; }
        #totalMessages { color: #dc2626; }
        #roundMessages { color: #f59e0b; }
        #coordinator { color: #d97706; }
        #faultCount { color: #ef4444; }

        .challenge-box {
            background: linear-gradient(135deg, #fef3c7, #fbbf24);
            border: 2px solid #f59e0b;
            border-radius: 15px;
            padding: 20px;
            margin: 20px 0;
            text-align: center;
            animation: challengeGlow 3s ease-in-out infinite alternate;
        }

        @keyframes challengeGlow {
            from { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2); }
            to { box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4); }
        }

        .challenge-box h4 {
            color: #92400e;
            margin-bottom: 12px;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .challenge-box p {
            color: #451a03;
            font-size: 14px;
            line-height: 1.5;
        }

        .info-box {
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 12px;
            padding: 15px;
            margin: 15px 0;
            font-size: 13px;
            color: #1e40af;
            backdrop-filter: blur(10px);
        }

        .node-info {
            background: rgba(16, 185, 129, 0.1);
            border: 2px solid rgba(16, 185, 129, 0.3);
            border-radius: 12px;
            padding: 15px;
            margin: 8px 0;
            font-size: 13px;
            color: #065f46;
            backdrop-filter: blur(10px);
        }

        .lookup-result {
            background: rgba(245, 158, 11, 0.1);
            border: 2px solid rgba(245, 158, 11, 0.3);
            border-radius: 12px;
            padding: 15px;
            margin: 8px 0;
            font-size: 13px;
            color: #92400e;
        }

        .legend {
            position: absolute;
            top: 25px;
            right: 25px;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(15px);
            padding: 20px;
            border-radius: 16px;
            border: 1px solid rgba(0, 0, 0, 0.1);
            font-size: 13px;
            color: #374151;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .legend-item {
            display: flex;
            align-items: center;
            margin: 8px 0;
        }

        .legend-color {
            width: 24px;
            height: 4px;
            margin-right: 12px;
            border-radius: 2px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .logs {
            height: 300px;
            overflow-y: auto;
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 0.8rem;
            line-height: 1.4;
            background: white;
            border-radius: 8px;
            padding: 15px;
            border: 1px solid #e2e8f0;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
        }

        .log-entry {
            margin: 4px 0;
            padding: 6px 10px;
            border-radius: 6px;
            background: #f8fafc;
            border-left: 3px solid #94a3b8;
        }

        .log-entry.node {
            border-left-color: #3b82f6;
            background: #eff6ff;
            color: #2563eb;
        }

        .log-entry.success {
            border-left-color: #10b981;
            background: #f0fdf4;
            color: #059669;
        }

        .log-entry.lookup {
            border-left-color: #f59e0b;
            background: #fffbeb;
            color: #d97706;
        }

        .log-entry.message {
            border-left-color: #8b5cf6;
            background: #f3f4f6;
            color: #6b7280;
        }

        @media (max-width: 1200px) {
            .app-container {
                grid-template-columns: 1fr;
                grid-template-rows: 80px 1fr auto auto;
                height: 100vh;
                gap: 10px;
                padding: 10px;
            }
            
            .controls-panel {
                height: 300px;
                order: 2;
            }
            
            .experiment-area {
                order: 1;
                min-height: 400px;
            }
            
            .observations-panel {
                height: 250px;
                order: 3;
            }
        }
        
        @media (max-width: 768px) {
            .header h1 {
                font-size: 1.5em;
            }
            
            .input-group {
                padding: 12px;
            }
            
            .btn {
                padding: 8px 12px;
                font-size: 12px;
            }
        }
        
        /* Mobile Landscape Support - Desktop-like Experience */
        @media screen and (max-width: 968px) and (orientation: landscape) {
            .app-container {
                grid-template-columns: 280px 1fr 300px;
                grid-template-rows: 60px 1fr;
                gap: 10px;
                padding: 10px;
            }
            
            .header {
                padding: 0 15px;
            }
            
            .header h1 {
                font-size: 1.4em;
            }
            
            .controls-panel {
                padding: 15px;
                height: calc(100vh - 80px);
            }
            
            .observations-panel {
                padding: 15px;
                height: calc(100vh - 80px);
            }
            
            .control-section {
                padding: 15px;
                margin-bottom: 15px;
            }
            
            .control-section h3 {
                font-size: 1em;
                margin-bottom: 12px;
            }
            
            .input-group {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .input-group label {
                font-size: 0.8rem;
                margin-bottom: 6px;
            }
            
            .input-group input,
            .input-group select {
                padding: 10px 12px;
                font-size: 0.8rem;
            }
            
            .btn {
                padding: 10px 14px;
                font-size: 0.8rem;
                margin-bottom: 6px;
            }
            
            .experiment-area {
                padding: 0;
                height: calc(100vh - 80px);
            }
            
            .simulation-area {
                padding: 15px;
                height: 100%;
            }
            
            .chord-ring {
                min-height: 400px;
                width: 100%;
                height: calc(100vh - 120px);
            }
            
            /* Legend optimization for mobile */
            .legend {
                top: 15px;
                right: 15px;
                padding: 15px;
                font-size: 0.75rem;
                max-width: 180px;
            }
            
            .legend-item {
                margin: 6px 0;
                font-size: 0.75rem;
            }
            
            .legend-color {
                width: 20px;
                height: 3px;
                margin-right: 10px;
            }
            
            .status-section {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .status-section h4 {
                font-size: 0.9em;
                margin-bottom: 10px;
            }
            
            .stat-card {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .stat-value {
                font-size: 1.2rem;
                margin-bottom: 4px;
            }
            
            .stat-label {
                font-size: 0.75rem;
            }
            
            .stat-description {
                font-size: 0.7rem;
                margin-top: 2px;
            }
            
            .logs {
                height: 200px;
                font-size: 0.75rem;
                padding: 12px;
            }
            
            .log-entry {
                font-size: 0.75rem;
                padding: 4px 0;
                margin: 2px 0;
            }
            
            .info-box,
            .node-info,
            .lookup-result {
                padding: 12px;
                font-size: 0.75rem;
                margin: 6px 0;
            }
            
            /* Node and visualization optimizations */
            .node {
                transform-origin: center;
            }
            
            .node:hover {
                transform: scale(1.1);
            }
            
            /* Responsive font sizing for node labels */
            .node text {
                font-size: 12px;
            }
        }
        
        /* Tablet Landscape - Slightly different layout */
        @media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
            .app-container {
                grid-template-columns: 300px 1fr 320px;
                grid-template-rows: 70px 1fr;
                gap: 12px;
                padding: 12px;
            }
            
            .header h1 {
                font-size: 1.6em;
            }
            
            .controls-panel,
            .observations-panel {
                height: calc(100vh - 90px);
            }
            
            .chord-ring {
                min-height: 450px;
                height: calc(100vh - 130px);
            }
            
            .legend {
                top: 20px;
                right: 20px;
                padding: 18px;
                font-size: 0.8rem;
                max-width: 200px;
            }
            
            .logs {
                height: 220px;
            }
        }
        
        /* Mobile Portrait Orientation Overlay */
        .rotate-device-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 10000;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            text-align: center;
            padding: 20px;
        }

        .rotate-device-overlay .rotate-icon {
            font-size: 4rem;
            margin-bottom: 20px;
            animation: rotateAnimation 2s ease-in-out infinite;
        }

        .rotate-device-overlay h2 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .rotate-device-overlay p {
            font-size: 1rem;
            opacity: 0.9;
            line-height: 1.5;
            max-width: 300px;
        }

        @keyframes rotateAnimation {
            0%, 100% { transform: rotate(0deg); }
            25% { transform: rotate(-15deg); }
            75% { transform: rotate(15deg); }
        }

        @media screen and (max-width: 768px) and (orientation: portrait) {
            .rotate-device-overlay {
                display: flex !important;
            }
            
            .app-container {
                display: none !important;
            }
        }