/* Raster material layer. Nine-slice metal preserves corner proportions at every
   width; all decorative layers are non-interactive. Admin is not opted in. */
.launcher-theme {
  --nm-brocade: url('/static/img/launcher-theme/brocade-dark.webp');
  --nm-frame: url('/static/img/launcher-theme/frame-gold.webp');
  --nm-button: url('/static/img/launcher-theme/button-crimson.webp');
  --nm-weave-opacity: .38;
  --nm-metal-filter: none;
  position: relative;
  isolation: isolate;
  background-image: none;
}
html[data-nanami-theme=light] .launcher-theme {
  --nm-brocade: url('/static/img/launcher-theme/brocade-light.webp');
  --nm-weave-opacity: .19;
  --nm-metal-filter: grayscale(1) brightness(.83);
  background-image: none;
}
.launcher-theme::before {
  content: ''; display: block; position: absolute; inset: 0;
  width: auto; height: auto; z-index: -1; pointer-events: none;
  background: var(--nm-brocade) repeat top left / 480px;
  opacity: var(--nm-weave-opacity); transform: none; filter: none;
}
.launcher-theme :is(.nm-header, .nm-realm-bar, .nm-feature, .nm-panel,
  .paper-panel, .tavern-tile, .addon-empty, .addon-card, .quest-book,
  .launcher-choice-dialog, .nm-hero, .nm-tavern-hero, .site-footer) {
  position: relative; isolation: isolate;
}
.launcher-theme :is(.quest-header, .quest-detail, .quest-list) {
  position: relative; isolation: isolate;
}
.launcher-theme :is(#quest-ceremony, #character-picker) { isolation: isolate; }
.launcher-theme .charlk-dialog{isolation:isolate;background:var(--nm-panel);color:var(--nm-text);border-color:var(--nm-line);border-radius:2px;box-shadow:0 20px 60px #0006;max-height:calc(100dvh - 32px);overflow:auto}
.launcher-theme .charlk-dialog :is(h3,.charlk-result .v){color:var(--nm-text)}
.launcher-theme .charlk-dialog :is(.charlk-eye,.charlk-note,.charlk-msg,.charlk-foot,.charlk-result .k){color:var(--nm-muted)}
.launcher-theme .charlk-dialog .charlk-msg.error{color:var(--nm-text);font-weight:600}
.launcher-theme .charlk-dialog :is(input,.charlk-result){background:var(--nm-bg);border-color:var(--nm-line);color:var(--nm-text);min-width:0}
.launcher-theme .charlk-dialog .charlk-close{background:var(--nm-raised);border-color:var(--nm-line);color:var(--nm-text);width:36px;height:36px}
.launcher-theme .charlk-dialog .charlk-form input:focus-visible{outline:2px solid var(--nm-accent);outline-offset:2px}
.launcher-theme :is(.nm-header, .nm-realm-bar, .nm-feature, .nm-panel,
  .paper-panel, .tavern-tile, .addon-empty, .addon-card,
  .launcher-choice-dialog, .site-footer, .quest-header, .quest-detail, .quest-list,
  #quest-ceremony, #character-picker, .charlk-dialog)::before {
  content: ''; display: block; position: absolute; inset: 0;
  width: auto; height: auto; z-index: -1; pointer-events: none;
  background: var(--nm-brocade) repeat top left / 480px;
  opacity: var(--nm-weave-opacity); transform: none; filter: none;
  border: 0; box-shadow: none;
}
.launcher-theme :is(.nm-header, .nm-realm-bar, .nm-feature, .nm-panel,
  .paper-panel, .tavern-tile, .addon-empty, .addon-card, .quest-book,
  .launcher-choice-dialog, .nm-hero, .nm-tavern-hero, .site-footer,
  #quest-ceremony, #character-picker, .charlk-dialog)::after {
  content: ''; display: block; position: absolute; inset: 0;
  width: auto; height: auto; z-index: 2; pointer-events: none;
  border: 1px solid transparent;
  border-image: var(--nm-frame) 100 / 30px / 0 stretch;
  background: none; opacity: .84; transform: none;
  filter: var(--nm-metal-filter); box-shadow: none;
}
.launcher-theme .nm-header::after { border-image-width: 22px; opacity: .88; }
.launcher-theme .nm-hero::after { border-image-width: 38px; }
.launcher-theme .nm-realm-bar::after { border-image-width: 22px; }
.launcher-theme .tavern-tile::after { border-image-width: 21px; }
.launcher-theme .site-footer::after { border-image-width: 28px; opacity: .55; }
.launcher-theme :is(.nm-feature, .nm-panel, .nm-realm-bar, .addon-empty,
  .addon-card, .quest-book, .launcher-choice-dialog) {
  border-color: transparent;
  box-shadow: inset 0 0 22px #00000012, 0 2px 7px #0000000c;
}
.launcher-theme :is(.paper-panel, .tavern-tile) { border-color: transparent !important; }
.launcher-theme .nm-header { background-color: var(--nm-bg); }
.launcher-theme .nm-feature:hover { background-color: var(--nm-raised); }
.launcher-theme .nm-feature:hover::after { opacity: 1; }

/* Primary controls carry a genuine crimson damask skin and bevelled metal rim.
   Center fill is part of the same image; no stretched corner illustrations. */
.launcher-theme .btn,
.launcher-theme .quest-book .quest-primary,
.launcher-theme .site-header nav.main-nav>a.active,
.launcher-theme .main-nav .nm-account-menu.active>summary,
.launcher-theme .nm-account-tabs .active,
.launcher-theme .launcher-choice-card.primary,
.launcher-theme #quest-ceremony #ceremony-confirm,
.launcher-theme .charlk-dialog .charlk-form button {
  border: 1px solid transparent;
  border-image: var(--nm-button) 56 fill / 12px / 0 stretch;
  background: var(--nm-red);
  color: #fff3df;
  box-shadow: 0 2px 5px #0004;
  text-shadow: 0 1px 2px #210308;
  border-radius: 0;
}
.launcher-theme .btn { font-weight: 600; }
.launcher-theme .btn:hover,
.launcher-theme .quest-book .quest-primary:hover:not(:disabled) {
  background-color: var(--nm-red); color: #fff8ed; filter: brightness(1.14);
}
.launcher-theme .btn:active,
.launcher-theme .quest-book .quest-primary:active:not(:disabled) {
  filter: brightness(.88); box-shadow: none;
}
.launcher-theme :is(.btn-ghost, .btn-paper, .nm-secondary) {
  border-image: var(--nm-frame) 100 / 13px / 0 stretch;
  background: var(--nm-panel) var(--nm-brocade) center / 480px;
  color: var(--nm-text); text-shadow: none; font-weight: 500;
}
.launcher-theme .quest-book .quest-primary:disabled {
  filter: saturate(.3); opacity: .52; cursor: not-allowed; box-shadow: none;
}
.launcher-theme :is(.quest-header, .quest-toolbar, .quest-footer) {
  background-image: var(--nm-brocade);
  background-size: 480px;
  background-blend-mode: soft-light;
}
.launcher-theme .quest-header { padding-inline: 24px; }
.launcher-theme .quest-book .quest-blessing button:not(:disabled) {
  background: var(--nm-raised);
  color: var(--nm-text);
  border-color: var(--nm-line);
  box-shadow: none;
}
.launcher-theme .quest-book #phase1-selection>span,
.launcher-theme .quest-book #character-open .character-selection-copy small {
  color: var(--nm-muted) !important;
}
.launcher-theme .quest-book :is(#quest-week, #quest-offers) button[aria-pressed=true] {
  border-image: var(--nm-button) 56 fill / 9px / 0 stretch;
  border-color: transparent;
  background: var(--nm-red);
  color: #fff3df;
  text-shadow: 0 1px 2px #210308;
}
.launcher-theme :is(.nm-account-tabs a, .main-nav>a, .main-nav summary):hover {
  text-decoration-color: var(--nm-accent);
}
@media (max-width: 640px) {
  .launcher-theme .nm-hero::after { border-image-width: 24px; }
  .launcher-theme :is(.nm-feature, .nm-panel, .paper-panel, .addon-empty,
    .quest-book, .nm-tavern-hero)::after { border-image-width: 24px; }
  .launcher-theme .nm-header::after { border-image-width: 18px; }
  .launcher-theme .nm-account-tabs .active { border-image-width: 9px; }
}
