* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #0a0d13; color: #e5e9f0;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI', monospace; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
.hidden { display: none !important; }

.panel { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; background: rgba(10, 13, 19, .55); backdrop-filter: blur(3px); z-index: 10; }
h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); letter-spacing: .12em; font-weight: 800; color: #fff;
  text-shadow: 0 0 34px rgba(74, 222, 128, .5); }
h1 span { color: #4ade80; }
.tag { color: #8b93a5; margin-top: -8px; font-size: .95rem; text-align: center; padding: 0 20px; }
.hint { color: #5b6373; font-size: .78rem; margin-top: 6px; }

input, select { background: #151a24; border: 1px solid #2a3142; color: #e5e9f0;
  padding: 12px 14px; border-radius: 10px; font: inherit; outline: none; text-align: center; }
input:focus, select:focus { border-color: #4ade80; }
#nick { width: 260px; text-transform: none; }
#joinCode { width: 130px; text-transform: uppercase; letter-spacing: .3em; }
.joinrow { display: flex; gap: 8px; }
.solobox { display: flex; gap: 8px; align-items: center; color: #8b93a5; font-size: .85rem; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.solobox select { padding: 8px 10px; font-size: .85rem; }

button { background: #4ade80; color: #06210f; border: 0; padding: 12px 22px; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer; transition: transform .06s; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }
.ghostbtn { background: #1c2230; color: #aab3c5; }
.err { color: #fb7185; min-height: 1.2em; font-size: .9rem; }

.codebox { background: #151a24; padding: 10px 18px; border-radius: 10px; letter-spacing: .15em; }
.codebox b { color: #4ade80; font-size: 1.2em; }
#plist { list-style: none; min-width: 300px; display: flex; flex-direction: column; gap: 6px; }
#plist li { background: #151a24; padding: 10px 14px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
#plist .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#plist .nm { flex: 1; }
#plist .host { color: #fbbf24; }
#plist .st { color: #8b93a5; font-size: .8em; }
#plist .st.rdy { color: #4ade80; }
#plist li.off { opacity: .45; }
.row { display: flex; gap: 8px; }

#hud { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px;
  justify-content: space-between; z-index: 5; pointer-events: none; }
.chip { background: rgba(21, 26, 36, .85); border: 1px solid #2a3142; border-radius: 10px;
  padding: 8px 14px; font-size: .9rem; backdrop-filter: blur(4px); }
#timerChip { font-variant-numeric: tabular-nums; }
#lb { font-size: .8rem; text-align: right; line-height: 1.5; min-width: 150px; }
#lb .me { color: #4ade80; font-weight: 700; }

.leavebtn { position: fixed; bottom: 14px; left: 14px; z-index: 6; width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.sfxbtn { position: fixed; bottom: 14px; right: 14px; z-index: 6; width: 40px; height: 40px; padding: 0; border-radius: 10px; }
#touchBtns { position: fixed; bottom: 70px; right: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 6; }
#touchBtns button { width: 56px; height: 56px; border-radius: 50%; background: #1c2230; color: #4ade80;
  font-size: 1.2rem; font-weight: 800; border: 1px solid #2a3142; }

#count { position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%); font-size: 6rem;
  font-weight: 800; color: #4ade80; text-shadow: 0 0 40px rgba(74, 222, 128, .6); z-index: 8; }
#note { position: fixed; top: 60%; left: 50%; transform: translateX(-50%); color: #fbbf24;
  background: rgba(21, 26, 36, .9); padding: 10px 20px; border-radius: 10px; z-index: 8; font-size: .95rem; }
#overlay table { border-collapse: collapse; min-width: 300px; }
#overlay td, #overlay th { padding: 6px 14px; text-align: left; }
#overlay th { color: #8b93a5; font-size: .75rem; text-transform: uppercase; }
#overlay .row { margin-top: 14px; }
#overlay h2 { margin-bottom: 10px; }
