:root {
  --bg: #100e0d;
  --ink: #ece2cd;
  --dim: #8c8272;
  --faint: #2a2622;
  --stripe: #8e1b2e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }

.stripes {
  position: fixed; top: 0; bottom: 0; left: 22px; width: 14px;
  background: linear-gradient(90deg, var(--stripe) 0 5px, transparent 5px 9px, var(--stripe) 9px 14px);
  transition: background 0.6s;
}

main {
  height: 100%; max-width: 760px; margin: 0 auto;
  padding: 0 40px 0 88px;
  display: flex; flex-direction: column;
}
header {
  display: flex; align-items: baseline;
  padding: 34px 0 24px;
  font-size: 13px; white-space: nowrap;
}
header .spacer { flex: 1; }
header button { color: var(--dim); background: none; border: none; cursor: pointer; }
header button:hover { color: var(--ink); }
.note { color: var(--dim); font-size: 13px; padding-bottom: 24px; }

.px { display: inline-block; shape-rendering: crispEdges; flex: none; }

/* Who's here */
#seats { display: flex; flex-wrap: wrap; gap: 12px 30px; padding-bottom: 24px; font-size: 13px; }
.seat { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.seat .name { font-weight: 600; }
.seat .status { color: var(--dim); }
.seat.waiting .name { animation: blink 1.05s steps(1) infinite; }
body.outside .seat:not(.with) { opacity: 0.2; pointer-events: none; }

/* The room */
#room {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; padding: 16px 0 12px;
  border-top: 1px solid var(--faint);
}
.line {
  display: grid; grid-template-columns: 160px 1fr; gap: 16px;
  padding: 3px 0;
  transition: opacity 1.2s ease;
}
.line .who {
  display: flex; justify-content: flex-end; align-items: center; gap: 7px;
  height: 1.6em; font-weight: 600; white-space: nowrap; min-width: 0;
}
/* The icon always shows; a very long name gets trimmed instead. */
.line .who span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.line .what { white-space: pre-wrap; word-break: break-word; }
.line.live .what { opacity: 0.8; }
.line.event { color: var(--dim); font-size: 13px; }
.line.event .who { font-weight: 400; }

.cursor {
  display: inline-block; width: 0.6em; height: 1.15em;
  transform: translateY(0.2em); margin-left: 1px;
  background: currentColor;
  animation: blink 1.05s steps(1) infinite;
}
.live .cursor, .cursor.hold { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

#mine { padding: 14px 0 34px; border-top: 1px solid var(--faint); }
#keys { position: fixed; left: -9999px; opacity: 0; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

/* Lost connection: the stripes go grey until it's back. */
body.offline .stripes { filter: grayscale(1); opacity: 0.35; }
body.offline #mine { opacity: 0.4; }


/* Joining */
#joinForm { display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
#joinName {
  width: 100%; max-width: 360px;
  background: none; border: none; border-bottom: 1px solid var(--faint);
  padding: 6px 0; font-size: 22px; outline: none;
}
#joinName:focus { border-bottom-color: var(--dim); }
#joinButton {
  background: var(--faint); border: none; border-radius: 6px;
  padding: 6px 16px; cursor: pointer;
}
#joinButton:hover { background: #3a342e; }

/* Icon and color picker */
.picker { display: flex; flex-direction: column; gap: 14px; }
.picker .row { display: flex; flex-wrap: wrap; gap: 6px; }
.picker .pick {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer;
}
.picker .pick:hover { background: var(--faint); }
.picker .pick.on { border-color: var(--dim); }
.picker .swatch { width: 18px; height: 18px; border-radius: 4px; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(8, 7, 6, 0.75);
}
.card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 14px 20px;
  background: #171412; border: 1px solid var(--faint); border-radius: 10px;
  font-size: 13px; max-width: calc(100vw - 40px);
}
.card.column { flex-direction: column; align-items: stretch; padding: 18px; gap: 16px; }
.card #link { overflow-wrap: anywhere; }
.card button { color: var(--ink); background: var(--faint); border: none; border-radius: 5px; padding: 4px 12px; cursor: pointer; }
#statusInput {
  background: none; border: none; border-bottom: 1px solid var(--faint);
  padding: 4px 0; outline: none; font-size: 13px;
}
