*{margin:0;padding:0;box-sizing:border-box}body{font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;background:linear-gradient(135deg,#667eea,#764ba2);min-height:100vh;padding:20px;color:#333}.container{max-width:1400px;margin:0 auto;background:#fff;border-radius:12px;box-shadow:0 10px 40px #0003;padding:30px}.title-container{display:flex;align-items:center;justify-content:center;gap:15px;margin-bottom:30px}h1{text-align:center;color:#667eea;margin:0;font-size:2.5em;text-shadow:2px 2px 4px rgba(0,0,0,.1)}.header-buttons{display:flex;gap:10px;align-items:center}.help-button{background:transparent;color:#667eea;border:solid 2px #667eea;border-radius:50%;width:32px;height:32px;padding:0;font-size:1em;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .3s ease;box-shadow:0 2px 8px #0003}.help-button:hover{background:#5568d3;transform:scale(1.1);box-shadow:0 4px 12px #0000004d}.github-link{color:#667eea;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:solid 2px #667eea;border-radius:50%;transition:all .3s ease;text-decoration:none;box-shadow:0 2px 8px #0003}.github-link:hover{background:#5568d3;color:#fff;transform:scale(1.1);box-shadow:0 4px 12px #0000004d}.github-link svg{width:18px;height:18px}.modal{display:none;position:fixed;z-index:1000;left:0;top:0;width:100%;height:100%;background-color:#00000080;animation:fadeIn .3s}.modal.active{display:flex;align-items:center;justify-content:center}.modal-content{background:#fff;padding:30px;border-radius:12px;max-width:800px;max-height:80vh;overflow-y:auto;box-shadow:0 10px 40px #0000004d;position:relative;animation:slideIn .3s}.modal-close{position:absolute;top:15px;right:20px;font-size:2em;color:#999;cursor:pointer;background:none;border:none;transition:color .3s}.modal-close:hover{color:#333;box-shadow:none!important}.modal-content h2{color:#667eea;margin-top:0;margin-bottom:20px}.modal-content h3{color:#667eea;margin-top:25px;margin-bottom:15px}.modal-content h4{color:#764ba2;margin-top:20px;margin-bottom:10px}.modal-content ul,.modal-content ol{margin-left:20px;margin-bottom:15px}.modal-content li{margin-bottom:8px;line-height:1.6}.modal-content p{line-height:1.6;margin-bottom:15px}.modal-content code{background:#f8f9fa;padding:2px 6px;border-radius:4px;font-family:Courier New,monospace;font-size:.9em}.modal-content pre{background:#f8f9fa;padding:15px;border-radius:8px;overflow-x:auto;margin-bottom:15px}.modal-content pre code{background:none;padding:0}.modal-body{line-height:1.6}.modal-body>*:first-child{margin-top:0!important}.footer{text-align:center;padding:20px;color:#fff;font-size:.9em;margin-top:20px}.footer p{margin:0}.footer a{color:#fff;text-decoration:none;font-weight:700;border-bottom:2px solid rgba(255,255,255,.3);transition:border-color .3s ease}.footer a:hover{border-bottom-color:#fff}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}.controls{background:#f8f9fa;border-radius:8px;padding:25px;margin-bottom:30px;border:2px solid #e9ecef}.input-group{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:20px;margin-bottom:25px}.input-field{display:flex;flex-direction:column}.input-field label{margin-bottom:8px;font-weight:600;color:#495057;font-size:.95em}.input-field input[type=number]{padding:10px 15px;border:2px solid #ced4da;border-radius:6px;font-size:1em;transition:all .3s ease}.input-field input[type=number]:focus{outline:none;border-color:#667eea;box-shadow:0 0 0 3px #667eea1a}.input-field.checkbox{flex-direction:row;align-items:center;gap:10px}.input-field.checkbox input[type=checkbox]{width:20px;height:20px;cursor:pointer;accent-color:#667eea}.input-field.checkbox label{margin-bottom:0;cursor:pointer}.button-group{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}button{padding:12px 24px;font-size:1em;font-weight:600;border:none;border-radius:6px;cursor:pointer;transition:all .3s ease;text-transform:uppercase;letter-spacing:.5px}button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 5px 15px #0003}button:disabled{opacity:.5;cursor:not-allowed}#init-btn{background:#667eea;color:#fff}#init-btn:hover:not(:disabled){background:#5568d3}#step-btn{background:#48bb78;color:#fff}#step-btn:hover:not(:disabled){background:#38a169}#start-btn{background:#4299e1;color:#fff}#start-btn:hover:not(:disabled){background:#3182ce}#stop-btn{background:#f56565;color:#fff}#stop-btn:hover:not(:disabled){background:#e53e3e}#restart-btn{background:#ed8936;color:#fff}#restart-btn:hover:not(:disabled){background:#dd6b20}.info-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding:15px;background:#f8f9fa;border-radius:8px;border:2px solid #e9ecef}.info-stats{display:flex;gap:20px;align-items:center}#tick-counter,#food-counter,#cell-counter{font-size:1.1em;font-weight:700;color:#667eea}.status-message{padding:8px 16px;border-radius:6px;font-weight:600;min-height:20px}.status-message.success{background:#c6f6d5;color:#22543d;border:1px solid #9ae6b4}.status-message.error{background:#fed7d7;color:#742a2a;border:1px solid #fc8181}.status-message.info{background:#bee3f8;color:#2c5282;border:1px solid #90cdf4}.grid-wrapper{margin-top:10px;display:flex;justify-content:center;align-items:center;overflow-x:auto;max-width:100vw}#grid-container{display:grid;gap:2px;background:#dee2e6;padding:2px;border-radius:8px;box-shadow:0 4px 6px #0000001a}.grid-cell{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.8em;border-radius:4px;min-width:30px;min-height:30px;transition:all .2s ease}.grid-cell.empty{background:#fff;border:1px solid #e9ecef}.grid-cell.food{background:#48bb78;color:#fff;box-shadow:inset 0 2px 4px #0000001a}.grid-cell.cell{background:#f56565;color:#fff;box-shadow:inset 0 2px 4px #0000001a}.legend{display:flex;justify-content:center;gap:30px;margin-top:20px;padding:15px;background:#f8f9fa;border-radius:8px}.legend-item{display:flex;align-items:center;gap:10px;font-weight:600}.legend-box{width:30px;height:30px;border-radius:4px;box-shadow:0 2px 4px #0000001a}.legend-box.food{background:#48bb78}.legend-box.cell{background:#f56565}@media (max-width: 768px){.container{padding:15px}h1{font-size:1.8em}.input-group{grid-template-columns:1fr}.button-group{flex-direction:column}button{width:100%}.grid-cell{min-width:30px;min-height:30px;font-size:1em}}
