* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0a12; color: #f4ecd8;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.name-label, .bubble { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 700; text-shadow: 0 2px 4px #000; }
.name-label { font-size: 14px; }
.bubble { background: #fff8e6; color: #2a1e2e; padding: 4px 12px; border-radius: 14px; font-size: 20px; text-shadow: none;
  box-shadow: 0 3px 0 #0006; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud[hidden], .screen[hidden] { display: none; }
#top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; width: min(460px, 80vw); }
#status { font-size: 15px; opacity: 0.85; margin-bottom: 6px; text-shadow: 0 2px 4px #000; }
#wake { display: flex; align-items: center; gap: 10px; background: #15121fcc; padding: 8px 14px; border-radius: 18px; border: 2px solid #ffffff22; }
#wake.danger { animation: jitter 0.12s infinite; border-color: #ff6a5a; }
#wake.stir { border-color: #ffd27a; }
.wake-face { font-size: 26px; }
.wake-track { flex: 1; height: 14px; background: #ffffff1c; border-radius: 8px; overflow: hidden; }
#wake-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6fe08a, #ffd27a 60%, #ff5a4a); border-radius: 8px; transition: width 0.12s linear; }
#wake-label { font-size: 13px; width: 64px; text-align: right; opacity: 0.9; }
#lift { margin-top: 6px; font-size: 15px; font-weight: 700; text-shadow: 0 2px 4px #000; min-height: 20px; }
#lift.ok { color: #6fe08a; } #lift.short { color: #ffd27a; }
@keyframes jitter { 0% { transform: translate(1px, 0); } 50% { transform: translate(-1px, 1px); } 100% { transform: translate(0, -1px); } }

#roster { position: absolute; top: 12px; left: 14px; list-style: none; margin: 0; padding: 0; font-size: 15px; font-weight: 700; text-shadow: 0 2px 4px #000; }
#roster li::before { content: "●"; margin-right: 6px; }
#room-tag { position: absolute; top: 12px; right: 14px; font-size: 14px; background: #15121fcc; padding: 6px 12px; border-radius: 12px; pointer-events: auto; cursor: pointer; }
#hint { position: absolute; top: 142px; left: 50%; transform: translateX(-50%); font-size: 17px; text-align: center; text-shadow: 0 2px 6px #000; opacity: 0; transition: opacity 0.6s; max-width: 80vw; }
#hint.show { opacity: 1; }
#toast { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); font-size: 34px; font-weight: 800; text-align: center; text-shadow: 0 3px 0 #000a, 0 0 18px #000; opacity: 0; transition: opacity 0.35s; }
#toast.show { opacity: 1; }
#toast.big { font-size: 64px; color: #ff6a5a; animation: jitter 0.08s infinite; }
#dark { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; padding-bottom: 150px; font-size: 22px; font-weight: 800; color: #ff8a7a; text-shadow: 0 2px 6px #000;
  box-shadow: inset 0 0 180px 40px #b3201c88; animation: pulse 0.9s infinite alternate; }
#dark.show { display: flex; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

#breath { position: absolute; bottom: 92px; left: 50%; width: 92px; height: 92px; margin-left: -46px; display: none; align-items: center; justify-content: center; }
#breath.show { display: flex; }
#breath-target { position: absolute; inset: 0; border-radius: 50%; border: 4px solid #ffffff55; }
#breath-ball { position: absolute; inset: 0; border-radius: 50%; background: #9fd0ff55; transform: scale(0.3); }
#breath.now #breath-target { border-color: #6fe08a; box-shadow: 0 0 18px #6fe08a; }
#breath.now #breath-ball { background: #6fe08a88; }
#breath.good #breath-target { border-color: #fff; box-shadow: 0 0 30px #6fe08a; }
#breath.bad #breath-target { border-color: #ff5a4a; box-shadow: 0 0 30px #ff5a4a; }
#breath span { position: relative; font-weight: 800; font-size: 22px; text-shadow: 0 2px 4px #000; }
#prompt { position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 700; text-shadow: 0 2px 4px #000; white-space: nowrap; }
#help { position: absolute; bottom: 10px; left: 14px; font-size: 12.5px; line-height: 1.5; opacity: 0.8; text-shadow: 0 1px 3px #000; }
#help b { color: #ffd27a; }
#click { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; background: #0b0a1288; text-shadow: 0 2px 6px #000; }
#click.show { display: flex; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #2a2140cc, #0b0a12f2); user-select: text; }
#card.screen { background: #0b0a12aa; }
.card { width: min(480px, 92vw); background: #1b1728; border: 2px solid #ffffff1c; border-radius: 22px; padding: 28px 30px; box-shadow: 0 20px 60px #000a; text-align: center; }
h1 { margin: 0 0 4px; font-size: 44px; letter-spacing: -1px; }
h1 span { color: #9fd98a; }
h2 { margin: 0 0 6px; font-size: 32px; }
.tag { margin: 0 0 20px; opacity: 0.8; }
label { display: block; text-align: left; font-size: 13px; opacity: 0.9; margin-bottom: 12px; }
input { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-size: 18px; color: #f4ecd8; background: #0f0d18; border: 2px solid #ffffff22; border-radius: 12px; outline: none; }
input:focus { border-color: #9fd98a; }
#code { text-transform: uppercase; letter-spacing: 4px; }
.row { display: flex; gap: 10px; margin-top: 6px; }
button { flex: 1; padding: 12px; font: inherit; font-weight: 800; font-size: 17px; color: #14210f; background: #9fd98a; border: 0; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 0 #4f7a42; }
button:active { transform: translateY(2px); box-shadow: 0 2px 0 #4f7a42; }
button.alt { background: #ffd27a; box-shadow: 0 4px 0 #9a7532; }
#lobby-msg { min-height: 20px; color: #ff8a7a; margin: 12px 0 0; }
.small { font-size: 12.5px; opacity: 0.65; margin: 10px 0 0; }
#awards { list-style: none; padding: 0; margin: 16px 0; text-align: left; }
#awards li { padding: 8px 12px; background: #ffffff0d; border-radius: 10px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; }
#awards li b { color: #ffd27a; }
.hat-pick { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; font-size: 13px; }
.hat-pick span { opacity: 0.9; }
.hat-pick b { flex: 1; font-size: 17px; color: #ffd27a; }
button.mini { flex: 0 0 44px; padding: 8px 0; background: #2c2640; color: #f4ecd8; box-shadow: 0 3px 0 #0008; }
.say { position: absolute; left: 0; top: 0; max-width: 260px; background: #1b1728ee; color: #f4ecd8; border: 2px solid #ffffff2a;
  padding: 6px 12px 8px; border-radius: 14px; font-size: 15px; line-height: 1.3; text-align: center; box-shadow: 0 4px 0 #0007; }
.say b { display: block; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: #ffd27a; margin-bottom: 2px; }
