* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1020; font-family: system-ui, sans-serif; color: #fff; }
#three, #three2, #three4 { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; display: none; }
#video, #stage { position: fixed; inset: 0; width: 100%; height: 100%; }
#video { object-fit: fill; transform: scaleX(-1); opacity: 0; }
#video.on { opacity: 1; }
#video { z-index: 0; }
#stage { touch-action: none; z-index: 2; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
#menu { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: rgba(10,14,30,.65); padding: 8px; border-radius: 14px; backdrop-filter: blur(8px); max-width: 96vw; }
button { font: inherit; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
button:hover { background: rgba(255,255,255,.22); }
button.active { background: #3b82f6; border-color: #3b82f6; }
button.primary { background: #16a34a; border-color: #16a34a; }
.sep { width: 1px; background: rgba(255,255,255,.25); margin: 0 4px; }
#wordTools { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
#wordTools[hidden] { display: none; }
input { font: inherit; padding: 7px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,.3); background: rgba(10,14,30,.7); color: #fff; }
#hint { display: none; position: absolute; left: 14px; bottom: 14px; max-width: 360px; font-size: 13px; line-height: 1.4; background: rgba(10,14,30,.65); padding: 8px 12px; border-radius: 10px; }
#status { position: absolute; right: 14px; bottom: 14px; font-size: 13px; background: rgba(10,14,30,.65); padding: 8px 12px; border-radius: 10px; }
#players { position: absolute; top: 64px; right: 10px; font-size: 13px; font-weight: 700; line-height: 1.6; text-align: right; background: rgba(10,14,30,.65); padding: 6px 12px; border-radius: 10px; pointer-events: none; }
#players:empty { display: none; }
#join { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #0f172a, #1e1b4b); }
#join[hidden] { display: none; }
#join form { display: flex; flex-direction: column; gap: 12px; width: 340px; max-width: 100%; }
#join form h1 { margin: 0; }
#join form[hidden] { display: none; }
#join form p, #joinWait { margin: 0; font-size: 13px; color: #cbd5e1; }
#join form label { font-size: 14px; color: #e2e8f0; line-height: 1.4; }
#join form .msg { min-height: 1.2em; color: #fca5a5; }
#join form .row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
button.link { background: none; border: 0; padding: 4px 0; color: #93c5fd; text-decoration: underline; font-size: 13px; }
button.link:hover { background: none; color: #bfdbfe; }
button:disabled { opacity: .55; cursor: default; }
