/* Party lobbies share the Ritual Paint Win95 / Y2K chrome. */
:root {
  --face: #c0c0c0;
  --hi: #fff;
  --sh: #404040;
  --navy: #000080;
  --ink: #111;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  background: #c0c0c0;
  color: var(--ink);
  font: 12px/1.35 Tahoma, "MS Sans Serif", Arial, sans-serif;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 4px 6px 4px 8px;
  font-weight: 700;
}
.titlebar .t { flex: 1; }
.tb-btns { display: flex; gap: 2px; }
.tb-btns span {
  width: 18px;
  height: 16px;
  background: #c0c0c0;
  color: #111;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  text-align: center;
  line-height: 12px;
  font-size: 10px;
}
.menubar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 4px;
  min-height: 24px;
}
.menubar a, .menubar button.menu {
  color: #111;
  background: transparent;
  border: 0;
  text-decoration: none;
  padding: 2px 7px;
}
.menubar a:hover, .menubar button.menu:hover { background: #000080; color: #fff; }
.wordart {
  margin-left: auto;
  font: 700 14px "Arial Black", Arial, sans-serif;
  letter-spacing: 2px;
  color: #ff00a8;
  text-shadow: 2px 2px 0 #00ffff, -1px -1px #fff;
  padding: 0 8px;
}
.mode-tabs { display: flex; gap: 3px; padding: 4px 6px 0; }
.mode-tab {
  font-weight: 700;
  font-size: 10px;
  text-decoration: none;
  color: #111;
  background: #a8a8a8;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 4px 8px;
}
.mode-tab.on { background: #c0c0c0; border-color: #404040 #fff #fff #404040; }
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}
.stage { min-width: 0; min-height: 0; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.chat {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  background: #c0c0c0;
}
.chat h2 {
  margin: 0;
  padding: 6px 8px 2px;
  font-size: 11px;
  letter-spacing: 0.4px;
}
.chat-log {
  flex: 1;
  min-height: 120px;
  margin: 4px 8px;
  padding: 6px;
  list-style: none;
  overflow: auto;
  background: #fff;
  border: 2px solid;
  border-color: #404040 #fff #fff #404040;
}
.chat-log li { margin: 0 0 6px; overflow-wrap: anywhere; }
.chat-log .system { color: #000080; font-style: italic; }
.chat form { display: flex; gap: 4px; padding: 0 8px 8px; }
.chat input[type="text"] { flex: 1; min-width: 0; }
.chat-note { margin: 0 8px 8px; color: #333; }
.panel, .inset, dialog {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 8px;
}
.inset {
  border-color: #404040 #fff #fff #404040;
  background: #fff;
}
.hub-grid, .room-grid { display: grid; gap: 8px; }
@media (min-width: 860px) {
  .hub-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
}
fieldset { border: 2px solid; border-color: #fff #404040 #404040 #fff; margin: 0 0 8px; padding: 8px; }
legend { padding: 0 4px; font-weight: 700; }
label { display: grid; gap: 3px; margin-bottom: 8px; font-size: 11px; font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.choices label { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; }
input[type="text"], input[type="search"], textarea, input[type="color"], input[type="range"] {
  width: 100%;
  background: #fff;
  border: 2px solid;
  border-color: #404040 #fff #fff #404040;
  padding: 4px 6px;
  font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
.btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 4px 10px;
  color: #111;
}
.btn:hover:not(:disabled) { background: #d7d7d7; }
.btn:active:not(:disabled), .btn.on {
  border-color: #404040 #fff #fff #404040;
  box-shadow: inset 1px 1px #808080;
}
.btn:disabled { color: #808080; }
.btn.tiny { padding: 1px 6px; font-size: 11px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.key {
  font: 700 28px/1 "Arial Black", Tahoma, sans-serif;
  letter-spacing: 2px;
  color: #000080;
  margin: 0;
}
.meta { margin: 4px 0; }
.players, .public-list, .score-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.players li, .public-list li, .score-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #fff;
  border: 2px solid;
  border-color: #404040 #fff #fff #404040;
}
.public-list li { align-items: flex-start; flex-wrap: wrap; }
.public-list code { font-weight: 700; color: #000080; }
.players .away { color: #666; }
.playbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.playbar p { margin: 0; font-weight: 700; }
.clock { font: 700 22px/1 Tahoma, Arial, sans-serif; color: #000080; min-width: 3.4em; text-align: right; }
.live-board { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-board h2 { margin: 0; font-size: 11px; }
.live-board .score-list { display: flex; flex-wrap: wrap; gap: 4px; }
.live-board .score-list li { width: auto; min-width: 120px; }
.timer-track { height: 8px; background: #808080; border: 2px solid; border-color: #404040 #fff #fff #404040; }
.timer-track i { display: block; height: 100%; width: 0; background: #000080; }
.prompt {
  margin: 0;
  padding: 8px;
  background: #ffffc0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  font-weight: 700;
}
.board-wrap { display: grid; gap: 6px; }
.board-view {
  overflow: auto;
  touch-action: none;
  overscroll-behavior: contain;
  max-height: min(62dvh, 560px);
  background: #808080;
  border: 2px solid;
  border-color: #404040 #fff #fff #404040;
}
canvas#board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
canvas#board.pixels-crisp { image-rendering: pixelated; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches { display: flex; gap: 3px; }
.swatches button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
}
.size { display: flex; align-items: center; gap: 4px; min-width: 140px; font-weight: 400; }
.size input { font-size: 12px; }
.reveal-controls { display: flex; gap: 6px; align-items: center; }
.reveal-caption { min-height: 2.6em; margin: 0; font-size: 16px; }
.status {
  border-top: 2px solid #fff;
  padding: 3px 8px;
  font-size: 11px;
  background: #c0c0c0;
}
dialog { max-width: 420px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog h2 { margin: 0 0 8px; font-size: 14px; color: #000080; }
dialog p { margin: 0 0 8px; }
@media (max-width: 800px) {
  .shell { height: 100dvh; overflow: hidden; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(168px, 36dvh); min-height: 0; }
  .chat { border-left: 0; border-top: 2px solid #fff; }
  .wordart { display: none; }
  .stage { padding: 6px; min-height: 0; }
  .board-view { max-height: 46dvh; }
  .tools { position: sticky; bottom: 0; background: #c0c0c0; padding: 4px 0; z-index: 2; }
  .tools .btn { min-height: 44px; min-width: 44px; font-size: 12px; }
  .swatches button { width: 28px; height: 28px; }
  html, body { max-width: 100%; }
  .titlebar .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menubar { flex-wrap: wrap; overflow: hidden; }
  .mode-tabs { flex-wrap: wrap; }
  .size { min-width: 0; }
  .hub-grid, .panel, .stage, .chat, form, fieldset { min-width: 0; max-width: 100%; }
  .shell { padding-bottom: env(safe-area-inset-bottom); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; animation: none !important; }
}
