/* Asteria Royal Crystal dashboard theme — approved 05 Nov 2026.
   The dashboard mock-up is the visual reference: slim steel with small gold
   details, dark obsidian, gemstone action buttons, and STATIC coloured headers.
   Painting only: panel ordering, dimensions, resource banner, drag handles,
   navigation, ARIA semantics and interaction behaviour stay with existing code. */

/* 1. Shared physical panel treatment on every Player/GM Panel component. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-react-panel.asteria-royal-relic {
  --royal-crystal-hue: var(--asteria-dashboard-tab,var(--asteria-accent,#117fba));
  --royal-header-hue: var(--asteria-panel-header-color,var(--royal-crystal-hue));
  position:relative;
  isolation:isolate;
  border:1px solid #87939e !important;
  border-radius:4px !important;
  background-color:#090e14 !important;
  background-image:
    linear-gradient(160deg,rgba(182,202,211,.065),transparent 35%,rgba(0,0,0,.16) 78%),
    url("../assets/ui/royal-relic-obsidian.svg") !important;
  background-position:center,center !important;
  background-size:cover,512px 512px !important;
  background-repeat:no-repeat,repeat !important;
  box-shadow:
    0 0 0 1px #111920,
    0 5px 13px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(244,248,249,.55),
    inset 1px 0 0 rgba(194,209,218,.26),
    inset -1px 0 0 rgba(10,19,25,.9),
    inset 0 -2px 0 rgba(0,0,0,.8) !important;
}
/* Perimeter is visually thin: steel light catches and a single fine gold trace. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-react-panel.asteria-royal-relic::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:1px;
  pointer-events:none;
  border:1px solid rgba(169,186,195,.29);
  border-radius:2px;
  background:
    linear-gradient(90deg,transparent 0%,#b39458 12%,#e5cc90 50%,#b39458 88%,transparent 100%) top 1px left 5px / calc(100% - 10px) 1px no-repeat,
    url("../assets/ui/royal-relic-brushed-steel.svg") top / 100% 2px no-repeat,
    linear-gradient(180deg,rgba(219,228,231,.34),transparent 70%) left / 1px 100% no-repeat,
    linear-gradient(180deg,rgba(219,228,231,.34),transparent 70%) right / 1px 100% no-repeat;
  box-shadow:inset 0 2px 1px rgba(0,0,0,.5);
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-react-panel.asteria-royal-relic::after {
  content:"";
  position:absolute;
  z-index:0;
  inset:3px;
  border:0;
  pointer-events:none;
  border-radius:2px;
  opacity:.91;
  background:
    linear-gradient(135deg,#b8c5cc 0 2px,transparent 3px) top left / 10px 10px no-repeat,
    linear-gradient(225deg,#b8c5cc 0 2px,transparent 3px) top right / 10px 10px no-repeat,
    linear-gradient(45deg,#b8c5cc 0 2px,transparent 3px) bottom left / 10px 10px no-repeat,
    linear-gradient(315deg,#b8c5cc 0 2px,transparent 3px) bottom right / 10px 10px no-repeat,
    radial-gradient(circle,#d5b777 0 1.1px,#39434b 1.3px 2.5px,transparent 2.8px) top left / 8px 8px no-repeat,
    radial-gradient(circle,#d5b777 0 1.1px,#39434b 1.3px 2.5px,transparent 2.8px) top right / 8px 8px no-repeat,
    radial-gradient(circle,#d5b777 0 1.1px,#39434b 1.3px 2.5px,transparent 2.8px) bottom left / 8px 8px no-repeat,
    radial-gradient(circle,#d5b777 0 1.1px,#39434b 1.3px 2.5px,transparent 2.8px) bottom right / 8px 8px no-repeat;
  box-shadow:none;
}
/* Hovering a panel must not make its static title bar behave like a button. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-react-panel.asteria-royal-relic:hover {
  border-color:#a9b5bd !important;
  box-shadow:0 0 0 1px #121b21,0 5px 13px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(244,248,249,.55),inset 1px 0 0 rgba(194,209,218,.26),
    inset -1px 0 0 rgba(10,19,25,.9),inset 0 -2px 0 rgba(0,0,0,.8) !important;
}

/* 2. Panel heading: STATIC enamel plaque, not crystal, not a link/button.
   ONE opaque hue, shaded DARK in the middle and LIGHT at both outer ends.
   No hover, shimmer, pulses, click, pressed state or animated highlights. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header {
  position:relative;
  z-index:1;
  background:transparent !important;
  border-bottom:1px solid rgba(139,151,159,.35) !important;
  box-shadow:0 1px 0 rgba(0,0,0,.7) !important;
  padding-inline:0;
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group {
  position:relative;
  isolation:isolate;
  display:flex;
  align-items:center;
  min-width:0;
  max-width:100%;
  min-height:34px;
  padding:4px 21px;
  gap:8px;
  color:#edf3f5;
  cursor:default;
  user-select:text;
  background:none !important;
  border:0 !important;
  box-shadow:none !important;
  transform:none !important;
  transition:none !important;
}
/* Silver steel + a hairline gold rim, mirroring the approved action buttons. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group::before,
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group::after {
  content:"";
  position:absolute;
  pointer-events:none;
  clip-path:polygon(0 50%,14px 0,calc(100% - 14px) 0,100% 50%,calc(100% - 14px) 100%,14px 100%);
  transition:none !important;
  animation:none !important;
  transform:none !important;
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group::before {
  z-index:-2;
  inset:0;
  background:
    linear-gradient(90deg,transparent,#b98f4b 12%,#d2b779 50%,#b98f4b 88%,transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg,transparent,#947244 12%,#d0b478 50%,#947244 88%,transparent) bottom / 100% 1px no-repeat,
    linear-gradient(180deg,#e3eaee 0%,#76858d 12%,#2c3840 26%,#0a1117 58%,#576671 88%,#d3dde0 100%);
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.7));
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group::after {
  z-index:-1;
  inset:2px 3px;
  background:linear-gradient(90deg,
    color-mix(in srgb,var(--royal-header-hue) 67%,#9cbbc8) 0%,
    color-mix(in srgb,var(--royal-header-hue) 72%,#243a4b) 17%,
    color-mix(in srgb,var(--royal-header-hue) 22%,#070e17) 50%,
    color-mix(in srgb,var(--royal-header-hue) 72%,#243a4b) 83%,
    color-mix(in srgb,var(--royal-header-hue) 67%,#9cbbc8) 100%);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.16),inset 0 -2px 1px rgba(0,0,0,.45);
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group :is(h2,.react-eyebrow,.asteria-icon) {
  position:relative;
  z-index:1;
  color:#ecf0f3 !important;
  text-shadow:0 1px 2px #000,0 0 2px rgba(224,229,232,.3);
}
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
  .asteria-royal-relic > .react-panel-header > .react-panel-title-group .asteria-icon {
  filter:drop-shadow(0 1px 1px #000);
}

/* 3. Shared gemstone menu buttons: real depth, thin gold lines, symmetrical
   non-ornate endcaps, NO gold stars at the centre. */
body .asteria-menu-button,
body #globalNavigation > .crystal-button {
  border-image:url("../assets/ui/asteria-royal-crystal-sidewall.svg") 0 20 fill / 0 var(--menu-tip,20px) / 0 stretch !important;
  text-shadow:0 1px 2px #000,0 0 5px rgba(255,255,255,.12);
}
body .asteria-menu-button::before {
  background:
    linear-gradient(90deg,transparent 3%,#a88447 13%,#e8ca8a 50%,#a88447 87%,transparent 97%) top 2px left / 100% 1px no-repeat,
    linear-gradient(90deg,transparent 3%,#76592f 13%,#d6b577 50%,#76592f 87%,transparent 97%) bottom 2px left / 100% 1px no-repeat,
    repeating-linear-gradient(176deg,rgba(230,240,245,.06) 0 1px,rgba(0,0,0,.09) 1px 2px,transparent 2px 5px),
    linear-gradient(180deg,#dae4e9 0%,#84939c 3%,#313e47 10%,#1d272f 32%,#080e13 58%,#35434c 85%,#91a0a8 97%,#131c23 100%) !important;
}
body .asteria-menu-button::after {
  /* Neutral optical planes retain shading in ANY selected crystal colour. */
  background-image:
    radial-gradient(ellipse 56% 29% at 49% 2%,rgba(238,252,255,.36),transparent 84%),
    url("../assets/ui/crystal-facets.svg"),
    radial-gradient(ellipse 82% 100% at 49% 110%,color-mix(in srgb,var(--button-crystal-color) 64%,#bceaff),transparent 74%),
    linear-gradient(180deg,#020c19bb 0%,transparent 24% 78%,#020913bb 100%),
    radial-gradient(ellipse 92% 130% at 51% 45%,
      color-mix(in srgb,var(--button-crystal-color) 72%,#5b7d91) 0%,
      color-mix(in srgb,var(--button-crystal-color) 55%,#071522) 65%,
      color-mix(in srgb,var(--button-crystal-color) 21%,#010811) 100%) !important;
  background-blend-mode:screen,soft-light,screen,normal,normal !important;
  background-size:100% 100% !important;
  background-repeat:no-repeat !important;
}
/* All colour modifications stay inside the existing --button-crystal-color. */
body .asteria-menu-button:not(:disabled):hover::after {
  filter:brightness(1.2);
}

/* 4. General controls have restrained metal edges. Full-size action buttons
   use the SAME pointed silhouette as top navigation, not a flat rectangle.
   Do not transform item slots, portrait controls, drag/resize handles or HUD steppers. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) button:not(.asteria-menu-button):not(.react-gallery-media-button):not(.react-icon-button) {
  border-color:color-mix(in srgb,#9caab2 72%,#c0a063 28%);
  box-shadow:inset 0 1px 0 rgba(232,240,244,.2),inset 0 -2px 2px rgba(0,0,0,.5),0 2px 4px rgba(0,0,0,.4);
}
/* Primary navigation/action buttons, including modal actions portal-mounted in
   document.body, share one painted surface. Their native button remains intact. */
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button) {
  --royal-action-hue:var(--asteria-dashboard-tab,var(--asteria-accent,#187bac));
  --royal-action-tip:clamp(8px,1.1em,14px);
  position:relative !important;
  isolation:isolate;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  color:#edf4f5 !important;
  text-shadow:0 1px 2px #000,0 0 3px rgba(224,240,247,.18);
  box-shadow:none !important;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.55));
  transition:filter 140ms ease;
}
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button)::before,
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button)::after {
  content:"";
  display:block;
  pointer-events:none;
  position:absolute;
  clip-path:polygon(0 50%,var(--royal-action-tip) 0,calc(100% - var(--royal-action-tip)) 0,100% 50%,calc(100% - var(--royal-action-tip)) 100%,var(--royal-action-tip) 100%);
}
/* Forged steel shoulder, micro-bevelled silver outer lip and two fine gold rails. */
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button)::before {
  z-index:-2;
  inset:0;
  background:
    linear-gradient(90deg,transparent 3%,#b98e50 16%,#d6b879 50%,#b98e50 84%,transparent 97%) top 2px / 100% 1px no-repeat,
    linear-gradient(90deg,transparent 3%,#a27b3d 16%,#d6b879 50%,#a27b3d 84%,transparent 97%) bottom 2px / 100% 1px no-repeat,
    linear-gradient(180deg,#e2e8ea 0%,#788894 6%,#2c353e 20%,#101a22 62%,#4c5c66 90%,#b7c1c6 100%);
  box-shadow:inset 0 1px 0 #fff4;
}
/* Separately coloured crystal: changing the theme never recolours the steel. */
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button)::after {
  z-index:-1;
  inset:3px 4px;
  background:
    radial-gradient(ellipse 60% 27% at 50% 0%,rgba(238,252,255,.35),transparent 80%),
    url("../assets/ui/crystal-facets.svg") center / 100% 100% no-repeat,
    linear-gradient(180deg,#020b18b0,transparent 23% 70%,#000713b0),
    radial-gradient(ellipse 95% 130% at 51% 54%,
      color-mix(in srgb,var(--royal-action-hue) 72%,#80b4d0),
      color-mix(in srgb,var(--royal-action-hue) 53%,#071625) 64%,
      color-mix(in srgb,var(--royal-action-hue) 22%,#02070c));
  background-size:100% 100%;
  box-shadow:inset 0 1px 1px #def4ff99,inset 0 -2px 4px #000b;
  transition:filter 150ms ease,transform 90ms ease;
}
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button):not(:disabled):hover::after {
  filter:brightness(1.17);
}
body :is(
  #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(button.primary,button.asteria-button,.react-action-row > button,.react-modal-actions > button,.react-quick-actions > button,.react-empty-action,.react-dashboard-reset-action),
  .react-modal :is(button.primary,button.asteria-button)
):not(.asteria-menu-button):not(:disabled):active::after {
  transform:translateY(2px);
  filter:brightness(1.24);
}
/* Destructive action faces remain recognisably red. */
body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard) button.danger,
body .react-modal button.danger {
  --royal-action-hue:var(--asteria-danger,#a83b4f);
}

/* 5. Narrow screens: same appearance, no excess ornament/width. */
@media (max-width:600px) {
  body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    .asteria-royal-relic > .react-panel-header > .react-panel-title-group {
    min-height:30px;
    padding:3px 14px;
  }
  body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    .asteria-royal-relic > .react-panel-header > .react-panel-title-group::before,
  body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    .asteria-royal-relic > .react-panel-header > .react-panel-title-group::after {
    clip-path:polygon(0 50%,10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%);
  }
}
@media (prefers-reduced-motion:reduce) {
  body #asteriaReactRoot :is(.react-character-dashboard,.react-gm-dashboard)
    :is(.asteria-royal-relic,.react-panel-title-group,button) {
    transition:none !important;
    animation:none !important;
  }
}
