/* Static ink artwork. 32px source corners stay intact; edges repeat instead of
   stretching their grain. Existing border widths retain all layout dimensions.
   No fill slice: backgrounds, text and interaction states remain independent.
   The artwork centreline is inset 10 source pixels. Outset cancels that inset
   (10 * rendered width / 32); background corners follow its 20px source radius. */
/* Use element semantics as well as classes: dynamically created controls and
   radio-label buttons in the lobby must receive the same treatment. */
body :is(button,[role="button"],.primary,.quiet,.small-button,.ink-button,
  .size-choices label>span,select,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"])):not(.setup-colors button):not(.invocation-charge):not(.hall-logo-jump){
  border-image-source:url('./assets/ui/ink-button.png')!important;
  border-image-slice:32!important;
  border-image-width:12px!important;
  border-image-outset:3.75px!important;
  border-image-repeat:round!important;
  border-radius:7.5px!important;
}
body :is(dialog,[role="dialog"],[role="alertdialog"],[popover],.realm-panel,.diplomacy-panel,.minimap-panel,.dock,.welcome,
  .purchase-help,.upgrade-panel,.court-card,.conquest-card,.resource,
  #kingdom-setup,#lobby-start,.lobby-panel,.create-panel,.room-card,.ink-panel,
  .games-panel,.hall-intro,.hall-footer,.empty-state,.lobby-height-panel,
  .battle-notice,.realm-entry,.setup-preview,.lifestyle-card,
  .placement-tip,.command-hint,.journal,.chat-composer,#toast){
  border-image-source:url('./assets/ui/ink-panel.png')!important;
  border-image-slice:32!important;
  border-image-width:18px!important;
  border-image-outset:5.625px!important;
  border-image-repeat:round!important;
  border-radius:11.25px!important;
}
/* The animated lobby logo is artwork, not a framed control. Keep keyboard focus. */
body .hall-logo-jump{
  border:0!important;
  border-image:none!important;
  box-shadow:none!important;
}
/* The loading track is only 12px tall: use smaller nine-slice corners so the
   browser does not reduce the frame scale, which would shift it off the edge. */
body #loading progress{
  border-image-source:url('./assets/ui/ink-button.png')!important;
  border-image-slice:32!important;
  border-image-width:6px!important;
  border-image-outset:1.875px!important;
  border-image-repeat:round!important;
  border-radius:3.75px!important;
  overflow:visible;
}
body #loading progress::-webkit-progress-bar,
body #loading progress::-webkit-progress-value{border-radius:3.75px}
body #loading progress::-moz-progress-bar{border-radius:3.75px}
/* Circular controls keep their circular silhouette and selection ring. */
body :is(.setup-colors button,.invocation-charge){
  border-color:#191710!important;
  box-shadow:0 0 0 1.5px #191710;
}
/* Keep keyboard focus and selection visible independently of the black frame. */
/* Kingdom customization: warm grey-brown scrollbar with the same ink artwork. */
#kingdom-setup{scrollbar-gutter:stable}
#kingdom-setup::-webkit-scrollbar{width:18px;height:18px}
#kingdom-setup::-webkit-scrollbar-track{background:#c4b9a8;border:2px solid #191710;border-radius:8px;margin-block:12px}
#kingdom-setup::-webkit-scrollbar-thumb{background:#887b6b;border:2px solid #191710;border-image:url('./assets/ui/ink-button.png') 32 / 6px / 0 round;border-radius:7px;min-height:48px}
#kingdom-setup::-webkit-scrollbar-thumb:hover{background:#736657}
#kingdom-setup::-webkit-scrollbar-thumb:active{background:#605549}
#kingdom-setup::-webkit-scrollbar-corner{background:transparent}
@supports not selector(::-webkit-scrollbar){#kingdom-setup{scrollbar-color:#887b6b #c4b9a8;scrollbar-width:auto}}
body .command.active{outline:2px solid var(--gold,#c6a657);outline-offset:1px}
@media(forced-colors:active){
  body :is(button,dialog,.realm-panel,.diplomacy-panel,.dock,.resource,.ink-panel){border-image:none!important;border-color:ButtonText!important}
}
