* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f3f5f7; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2937; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: #6b7280; }
.small { font-size: 12px; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#score { position: absolute; left: 14px; top: 12px; background: rgba(17,24,39,.55); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 18px; }
#lb { position: absolute; right: 12px; top: 12px; width: 200px; background: rgba(17,24,39,.55); color: #fff; border-radius: 10px; padding: 8px 12px; }
#lb h3 { margin: 0 0 6px; font-size: 16px; text-align: center; }
#lb ol { margin: 0; padding-left: 22px; font-size: 14px; }
#lb li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lb li.me { color: #fbbf24; font-weight: 600; }
#minimap { position: absolute; right: 12px; bottom: 12px; width: 160px; height: 160px; background: rgba(17,24,39,.35); border-radius: 8px; }

#chat { position: fixed; left: 12px; bottom: 12px; width: min(380px, 70vw); pointer-events: none; }
#chatLog { font-size: 14px; max-height: 200px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
#chatLog div { background: rgba(17,24,39,.45); color: #fff; padding: 2px 8px; border-radius: 6px; margin-top: 3px; width: fit-content; max-width: 100%; word-wrap: break-word; animation: fade 12s forwards; }
#chatLog div.admin { background: rgba(220,38,38,.8); font-weight: 600; animation-duration: 25s; }
#chatLog b { margin-right: 4px; }
@keyframes fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
#chatInput { pointer-events: auto; width: 100%; margin-top: 6px; padding: 7px 10px; border-radius: 8px; border: none; background: rgba(17,24,39,.6); color: #fff; outline: none; opacity: 0; font-size: 14px; }
#chatInput.open { opacity: 1; }

#touch { position: fixed; right: 16px; bottom: 190px; display: flex; flex-direction: column; gap: 10px; }
#touch button { width: 76px; height: 76px; border-radius: 50%; border: none; background: rgba(17,24,39,.5); color: #fff; font-weight: 600; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
.panel { background: #fff; border-radius: 16px; padding: 28px 30px; width: min(380px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.panel h1 { margin: 0 0 4px; font-size: 40px; letter-spacing: -1px; color: #059669; }
.panel h2 { margin: 6px 0 2px; color: #dc2626; font-size: 20px; }
.panel input#name { width: 100%; padding: 12px 14px; font-size: 18px; border-radius: 10px; border: 2px solid #e5e7eb; margin: 14px 0 10px; outline: none; }
.panel input#name:focus { border-color: #10b981; }
.hueRow { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #374151; margin-bottom: 14px; }
.hueRow input { flex: 1; accent-color: #10b981; }
#huePreview { width: 26px; height: 26px; border-radius: 50%; display: inline-block; border: 3px solid rgba(0,0,0,.15); }
#play { width: 100%; padding: 12px; font-size: 18px; font-weight: 700; border: none; border-radius: 10px; background: #10b981; color: #fff; cursor: pointer; }
#play:disabled { background: #9ca3af; cursor: default; }
#play:not(:disabled):hover { background: #059669; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 16px; font-size: 13px; color: #4b5563; text-align: left; }
kbd { background: #f3f4f6; border: 1px solid #d1d5db; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
