html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---- Themeable colors (overridable from appsettings App:Colors) ---- */
:root {
  --app-primary: #0d6efd;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
}

.navbar-brand img { height: 28px; width: auto; }

/* While a POST is in flight its submit buttons gray out (site.js adds this). */
.btn-posting { pointer-events: none; opacity: .55; }

/* ---- The room -------------------------------------------------------------
   The canvas keeps its own fixed colours in both themes: it is a picture of a
   room, so it should not turn dark when the site does. The frame around it
   follows the theme. */
.room-frame {
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
  padding: .5rem;
  overflow: auto;
  text-align: center;
}
#room-canvas {
  display: inline-block;
  border-radius: .25rem;
  image-rendering: auto;
  touch-action: manipulation;
  max-width: none;
}
#room-canvas[data-mode="player"] { cursor: pointer; }

.room-select { min-width: 12rem; max-width: 18rem; }

.room-side .list-group-item { padding: .4rem .75rem; }
.room-chat {
  height: 20rem;
  overflow-y: auto;
  font-size: .9rem;
  padding: .5rem .75rem;
}
.chat-line { margin-bottom: .3rem; overflow-wrap: anywhere; }
.chat-time { color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; margin-right: .35rem; font-size: .8rem; }
.chat-name { font-weight: 600; margin-right: .35rem; }
.chat-name.is-ai { color: var(--bs-info-text-emphasis); }
.chat-name.is-me { color: var(--app-primary); }
.person-status { color: var(--bs-secondary-color); font-size: .8rem; }

/* ---- Character selection ------------------------------------------------- */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.character-card {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  border: 2px solid var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  padding: .75rem .5rem;
  transition: border-color .12s, transform .12s;
}
.character-card:hover, .character-card:focus-visible {
  border-color: var(--app-primary);
  transform: translateY(-2px);
  outline: none;
}
.character-current { border-color: var(--app-primary); background: var(--bs-primary-bg-subtle); }
.character-canvas { background: var(--bs-tertiary-bg); border-radius: .5rem; }
.character-name { font-weight: 600; }
