html,
body,
#xxivchat-standalone {
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

body {
  background: var(--surface);
  color: var(--text);
  font-family: system-ui, sans-serif;
}

#xxivchat-standalone {
  display: flex;
}

#xxivchat-standalone > #xxivchat-container {
  border: 0;
  flex: 1 1 auto;
  height: 100%;
}

#xxivchat-standalone > #xxivchat-container .xxivchat__collapse-button {
  display: none;
}

.xxivchat-standalone__error {
  margin: auto;
  padding: 16px;
  text-align: center;
}

body.xxivchat-standalone--overlay {
  background: transparent;
}

body.xxivchat-standalone--overlay #xxivchat-container {
  --xxiv-accent: #fff;
  --xxiv-bg: transparent;
  --xxiv-bg-soft: transparent;
  --xxiv-border: transparent;
  --xxiv-fg: #fff;
  --xxiv-muted: #e5e5e5;
  background: transparent;
  color-scheme: dark;
  pointer-events: none;
}

body.xxivchat-standalone--overlay .xxivchat__content,
body.xxivchat-standalone--overlay .xxivchat__messages {
  background: transparent;
}

body.xxivchat-standalone--overlay .xxivchat__messages {
  justify-content: flex-end;
  overflow: hidden;
  padding: 8px;
}

body.xxivchat-standalone--overlay .xxivchat__message,
body.xxivchat-standalone--overlay .xxivchat__system-message {
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}

/* Chromium paints an opaque canvas if the iframe and its document negotiate
   different color schemes. The host player uses the same explicit scheme. */
html:has(body:is(.xxivchat-framed-overlay, .xxivchat-standalone--overlay)),
body:is(.xxivchat-framed-overlay, .xxivchat-standalone--overlay) {
  background: transparent;
  color-scheme: dark;
}
#xxivchat-standalone.video-js > #xxivchat-container.xxivchat--player-overlay {
  inset: 0; width: 100% !important; height: 100% !important;
}
@media (pointer: fine) {
  #xxivchat-standalone > #xxivchat-container .xxivchat__panel-resize { display: block; }
}
