:host {
  display: block;
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9999;
}

/* ── Anonymous viewer: desaturated lantern, no ticker ── */
.anon-panel {
  width: 290px;
  height: 56px;
  background: var(--fog-bg);
  display: flex;
  align-items: center;
  padding: 0 12px 0 8px;
}
.lantern-desaturated {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1c20;
  border: 2.5px solid #3a3e48;
  flex-shrink: 0;
}
.anon-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fog-text-faint);
  margin-left: 10px;
  font-style: italic;
}

/* ── First-time / onboarding panel ── */
.onboarding-panel {
  width: 290px;
  min-height: 56px;
  background: var(--fog-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 16px;
  gap: 8px;
  border-left: 2px solid var(--fog-amber);
}
.onboarding-glyph {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--fog-amber);
  opacity: 0.6;
  flex-shrink: 0;
}
.onboarding-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fog-text-dim);
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}
.onboarding-outcome {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fog-text-faint);
  font-style: italic;
  margin: 0 0 4px;
}
.onboarding-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fog-red);
  margin: 4px 0 0;
}
.onboarding-glyph--pulse {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
.difficulty-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.diff-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--fog-amber-dim);
  color: var(--fog-text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: border-color 0.15s, color 0.15s;
}
.diff-btn:hover, .diff-btn:focus-visible {
  border-color: var(--fog-amber);
  color: var(--fog-amber);
  outline: none;
}
.diff-pips {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--fog-amber);
  opacity: 0.7;
}
.diff-btn:hover .diff-pips, .diff-btn:focus-visible .diff-pips {
  opacity: 1;
}
.diff-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.back-btn {
  background: none;
  border: none;
  color: var(--fog-text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px 0 0;
  align-self: flex-start;
  transition: color 0.15s;
}
.back-btn:hover, .back-btn:focus-visible {
  color: var(--fog-text-dim);
  outline: none;
}
.onboarding-panel--loading {
  flex-direction: row;
  align-items: center;
}

/* ── Character picker ── */
.character-search-row {
  width: 100%;
}
.character-filter {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid var(--fog-amber-dim);
  color: var(--fog-text);
  font-family: Verdana, Helvetica, Arial, sans-serif;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
}
.character-filter::placeholder {
  color: var(--fog-text-dim);
  font-style: italic;
}
.character-filter:focus {
  border-color: var(--fog-amber);
}
.character-list {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--fog-amber-dim) transparent;
}
.character-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  color: var(--fog-text-dim);
  font-family: Verdana, Helvetica, Arial, sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  text-align: left;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.character-thumb {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  opacity: 0.7;
  transition: opacity 0.12s;
}

.character-btn:hover .character-thumb,
.character-btn:focus-visible .character-thumb {
  opacity: 1;
}
.character-btn:hover,
.character-btn:focus-visible {
  color: var(--fog-text);
  border-left-color: var(--fog-amber);
  outline: none;
}
.character-btn--random {
  color: var(--fog-amber);
  opacity: 0.75;
  font-style: italic;
  border-bottom: 1px solid var(--fog-amber-dim);
  margin-bottom: 4px;
  padding-bottom: 6px;
}
.character-btn--random:hover,
.character-btn--random:focus-visible {
  opacity: 1;
  border-left-color: transparent;
}
.character-chosen {
  color: var(--fog-amber);
}

/* ── Backdrop dim when expanded ── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
  animation: fade-in 0.15s ease;
  border: none;
  cursor: default;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
