:root { --bg-sand: #f8e5a6; --wall-color: #d35400; --snake-head: #2980b9; --snake-body: #3498db; --food-glow: #9b59b6; --ui-text: #fff; }
* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
body { margin: 0; padding: 0; background-color: #2c3e50; font-family: 'Fredoka One', cursive; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; overflow: hidden; }
#game-wrapper { position: relative; width: 100%; max-width: 500px; height: 100%; max-height: 800px; background: var(--bg-sand); border: 8px solid var(--wall-color); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden; display: flex; flex-direction: column; }
.ui-bar { padding: 10px 15px; background: rgba(211, 84, 0, 0.1); display: flex; justify-content: space-between; align-items: center; z-index: 10; border-bottom: 2px solid rgba(211, 84, 0, 0.2); }
.score-box { font-size: 20px; color: #d35400; text-shadow: 1px 1px 0 #fff; background: rgba(255,255,255,0.6); padding: 5px 12px; border-radius: 20px; min-width: 100px; text-align: center; }
.controls-group { display: flex; align-items: center; gap: 10px; }
.speed-control { display: flex; align-items: center; background: rgba(255,255,255,0.6); padding: 5px 10px; border-radius: 20px; }
.speed-label { font-size: 12px; color: #d35400; margin-right: 5px; }
input[type=range] { -webkit-appearance: none; width: 80px; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: #16a085; cursor: pointer; margin-top: -6px; box-shadow: 0 2px 0 #0e6655; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #d35400; border-radius: 2px; }
.btn-pause { width: 36px; height: 36px; background: #e74c3c; border: none; border-radius: 8px; color: white; font-size: 14px; cursor: pointer; box-shadow: 0 3px 0 #c0392b; display: flex; align-items: center; justify-content: center; }
.btn-pause:active { transform: translateY(3px); box-shadow: none; }
canvas { display: block; margin: auto; flex-grow: 1; background-image: radial-gradient(#e0cba0 15%, transparent 16%), radial-gradient(#e0cba0 15%, transparent 16%); background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 20; transition: opacity 0.3s; }
.hidden { display: none !important; }
h1 { color: #f1c40f; font-size: 48px; margin: 0 0 10px 0; text-shadow: 4px 4px 0 #c0392b; text-align: center; line-height: 1; }
h2 { color: white; font-size: 24px; margin-bottom: 30px; }
.btn-main { padding: 15px 40px; font-family: 'Fredoka One', cursive; font-size: 24px; color: white; background: linear-gradient(to bottom, #2ecc71, #27ae60); border: none; border-radius: 12px; box-shadow: 0 6px 0 #1e8449, 0 10px 10px rgba(0,0,0,0.3); cursor: pointer; transition: all 0.1s; }
.btn-main:active { transform: translateY(6px); box-shadow: 0 0 0 #1e8449, inset 0 2px 5px rgba(0,0,0,0.2); }
.controls-hint { margin-top: 20px; color: #ddd; font-size: 14px; opacity: 0.8; text-align: center; line-height: 1.5; }
@media (max-width: 768px) { h1 { font-size: 40px; } #game-wrapper { border-width: 0; border-radius: 0; } }