/* Cosmetic rainbow frames do not grant Rainbow progression or alter portrait selection. */
html body img.character-portrait,
html body .portrait-fallback {
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 5px !important;
  border-image-source: url('../assets/portraits/rainbow-avatar-frame.png') !important;
  border-image-slice: 130 !important;
  border-image-width: 7px !important;
  border-image-outset: 0 !important;
  border-image-repeat: stretch !important;
}
html body .special-cast-intro-portrait { border-image-width: 14px !important; }
.rainbow-library-actions { margin: 12px 0; }
.rainbow-library-actions button,
.rainbow-character-library { border-color: #cc9dff; box-shadow: 0 0 14px #ba7bff35; }
#rainbow-library-dialog {
  width: min(1440px, 98vw); height: 94dvh; max-width: 98vw; max-height: 96dvh;
  padding: 0; border: 1px solid #9684c8; border-radius: 16px;
  background: #0b0c12; color: #f1edf9; overflow: hidden;
}
#rainbow-library-dialog::backdrop { background: #040810d9; backdrop-filter: blur(5px); }
#rainbow-library-dialog[open] { display: flex; flex-direction: column; }
.rainbow-library-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #343144; flex-shrink: 0; }
.rainbow-library-header h2 { font-size: 16px; margin: 0; }
#rainbow-library-frame { width: 100%; flex: 1; min-height: 0; border: 0; background: #0b0c12; }
body.rainbow-library-open { overflow: hidden; }
@media (max-width: 600px) {
  #rainbow-library-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; }
  .rainbow-library-header { padding: 10px; }
  .rainbow-library-header h2 { font-size: 13px; }
  .rainbow-library-header button { font-size: 12px; }
}
