:root { --paper: #f6f2ea; --edge: #e7e1d5; --ink: #22252b; --soft: #8d8a83; --line: #d9d2c4; --red: #e5484d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--edge); color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; display: block; }
body.playing canvas { cursor: none; }
[hidden] { display: none !important; }

.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 300px; padding: 26px 24px 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(34, 37, 43, .12);
  display: flex; flex-direction: column; gap: 10px; }
h1 { margin: 0 0 10px; font-size: 44px; font-weight: 800; letter-spacing: -1.5px; text-align: center; line-height: 1; }
h1 i { display: inline-block; width: 11px; height: 11px; margin-left: 3px; border-radius: 50%; background: var(--red); }

input, button { font: inherit; color: inherit; border-radius: 9px; border: 1px solid var(--line); height: 40px; padding: 0 12px; outline: none; }
input { background: #fffdf8; width: 100%; -webkit-user-select: text; user-select: text; }
input:focus { border-color: var(--ink); }
button { background: #fffdf8; cursor: pointer; font-weight: 600; white-space: nowrap; }
button:hover { border-color: var(--ink); }
button.main { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.main:hover { background: #000; }
button.main:disabled { opacity: .35; cursor: default; }
button.quiet { background: none; border-color: transparent; color: var(--soft); font-weight: 500; }
button.quiet:hover { color: var(--ink); border-color: transparent; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
#code { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-weight: 700; }
#status { margin: 0; min-height: 20px; text-align: center; color: var(--red); font-size: 13px; }
.note { margin: 0; color: var(--soft); font-size: 13px; text-align: center; }

.code { display: flex; align-items: baseline; justify-content: space-between; }
#roomcode { font-size: 40px; font-weight: 800; letter-spacing: 6px; line-height: 1; }
#players { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
#players li { display: flex; align-items: center; gap: 10px; height: 28px; }
#players li i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#players li span { color: var(--soft); font-size: 12px; margin-left: auto; }

.bar { position: fixed; left: 50%; bottom: 9%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(34, 37, 43, .12); }
#who { font-size: 20px; font-weight: 800; margin-right: 8px; }

#help { width: 400px; }
#help table { border-collapse: collapse; }
#help td { padding: 4px 0; vertical-align: top; }
#help td:first-child { font-weight: 700; width: 130px; }

#q { position: fixed; right: 14px; bottom: 14px; width: 30px; height: 30px; padding: 0; border-radius: 50%; color: var(--soft); background: none; }

/* the room panel: docked in the corner of the waiting room, small and quiet */
.dock { position: fixed; left: 14px; top: 14px; width: 268px; padding: 14px 14px 10px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(34, 37, 43, .10); display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.dock input, .dock button { height: 32px; font-size: 13px; }
.dock #roomcode { font-size: 26px; letter-spacing: 4px; }
.dock #roomcode.plain { font-size: 20px; letter-spacing: 0; }
.dock .label { color: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.dock .note { font-size: 11.5px; line-height: 1.35; }
.left { text-align: left !important; padding-left: 0 !important; }
#colors { display: flex; gap: 4px; }
#colors button { width: 16px; height: 16px; flex: none; padding: 0; border-radius: 50%; border: 2px solid var(--paper); box-shadow: none; }
#colors button.on { box-shadow: 0 0 0 2px var(--ink); }
#colors button:disabled { opacity: .18; cursor: default; }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; padding: 0 4px; position: relative; font-weight: 600; }
.seg button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg button .dots { position: absolute; left: 0; right: 0; bottom: -4px; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.seg button .dots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--paper); }
#players { gap: 3px; margin: 0; }
#players li { height: auto; min-height: 26px; flex-wrap: wrap; gap: 8px; }
#players li .seg { flex: 1 0 calc(100% - 20px); margin: 0 0 7px 20px; }
#players li .seg button { height: 24px; font-size: 11.5px; font-weight: 500; }
#players li .x { margin-left: auto; width: 22px; height: 22px; padding: 0; color: var(--soft); background: none; border-color: transparent; }
#players li .x + span { margin-left: 0; }
#ver { position: fixed; left: 14px; bottom: 12px; color: var(--soft); font-size: 12px; pointer-events: none; }
