/* Original Blizzard DialogBox and Tooltip atlas pieces; see wow-frame-sources.json. */
:root {
  --wow-window-frame: url('assets/ui/wow/dialog-nine-slice.png');
  --wow-active-frame: url('assets/ui/wow/gold-nine-slice.png');
  --wow-tooltip-frame: url('assets/ui/wow/tooltip-nine-slice.png');
  --wow-marble: url('assets/ui/wow/marble.png');
}

/* Frame overlays leave talent coordinates and click targets unchanged. */
body.reforged :is(.armory-panel,.gear-armory,#preraid,.respec-comparison,.macro-card,.class-quest-grid article,.preraid-dungeon),
body.reforged #questing .dungeon-stop,
body.reforged :is(.talent-tree,.calc-toolbar,.gear-levels,.stage-points,.talent-editor-toolbar,.gear-set-bonuses,.dungeon-one-run,.dungeon-filters),
body.reforged #gear-items .gear-slot-row,
body.reforged #preraid .preraid-slot {
  position: relative;
  border-color: transparent;
  border-radius: 0;
}
body.reforged :is(.armory-panel,.gear-armory,#preraid,.respec-comparison,.macro-card,.class-quest-grid article,.preraid-dungeon)::after,
body.reforged #questing .dungeon-stop::after,
body.reforged :is(.talent-tree,.calc-toolbar,.gear-levels,.stage-points,.talent-editor-toolbar,.gear-set-bonuses,.dungeon-one-run,.dungeon-filters)::after,
body.reforged #gear-items .gear-slot-row::after,
body.reforged #preraid .preraid-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border: 1px solid transparent;
  border-image: var(--wow-window-frame) 32 / 16px / 0 stretch;
  border-radius: 0;
}
body.reforged :is(.talent-tree,.calc-toolbar,.gear-levels,.stage-points,.talent-editor-toolbar,.gear-set-bonuses,.dungeon-one-run,.dungeon-filters)::after {
  border-image-width: 12px;
}
body.reforged #gear-items .gear-slot-row::after,
body.reforged #preraid .preraid-slot::after { border-image-width: 9px; opacity: .85; }
body.reforged :is(.armory-panel,.gear-armory,#preraid,.respec-comparison) { box-shadow: 0 10px 30px #0005; }
body.reforged :is(.armory-panel,.gear-armory,#preraid) { background-color: #151412c9; }
body.reforged :is(.macro-card,.class-quest-grid article,.preraid-dungeon) { background: linear-gradient(#0b0c0d77,#090a0bb8),var(--wow-marble); box-shadow: 0 4px 14px #0005; }
body.reforged #sidebar.guide-toc { background: linear-gradient(180deg,var(--faction-tint),transparent 72%),linear-gradient(#0a0909a6,#0b0b0ba6),var(--wow-marble); border: 1px solid transparent; border-image: var(--wow-window-frame) 32 / 12px / 0 stretch; }
body.reforged #sidebar .toc-brand { margin-bottom: 0; padding-bottom: 12px; border-bottom: 0; }
body.reforged #sidebar .all-guides-link { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 36px; margin: 0 0 18px; padding: 3px 8px; font-size: 12px; text-align: center; }
body.reforged .talent-tree > header,
body.reforged .tree-title { background: linear-gradient(#332b1b66,#08090b80),var(--wow-marble); }
body.reforged .talent-editor-toolbar { padding-inline: 14px; }
body.reforged #questing .dungeon-filters { padding: 16px 20px; }
body.reforged .gear-slot-row .slot-heading,
body.reforged .preraid-slot > h3 { background: linear-gradient(#07090980,#090a0b99),var(--wow-marble); border-right-color: #7d78634d; }
body.reforged .dungeon-stop .dungeon-art { inset: 5px; }

/* Original game tooltip chrome, including spell and item dialogs. */
body.reforged :is(.item-hover-card,.spell-hover-card,.wow-tooltip,.talent-selected-tooltip,.talent-hover-card,#gear-dialog,#image-dialog),
body.reforged #gear-dialog .game-item-tooltip {
  border: 5px solid transparent;
  border-image: var(--wow-tooltip-frame) 16 / 10px / 0 stretch;
  border-radius: 0;
  background-color: #050b20f7;
  box-shadow: 0 6px 24px #000a;
}
body.reforged .item-hover-card .game-item-tooltip { border: 0; border-image: none; background: none; box-shadow: none; }
body.reforged :is(.macro-code,.item-acquisition,.tooltip-acquisition,.dungeon-xp-summary,.dungeon-evidence) {
  border: 1px solid transparent;
  border-image: var(--wow-tooltip-frame) 16 / 7px / 0 stretch;
}
body.reforged :is(select,input[type='number']) { border-image: var(--wow-tooltip-frame) 16 / 7px / 0 stretch; }

/* Border images paint inward without reserving their visible width. */
body.reforged .tooltip-acquisition { padding: 12px 14px; overflow-wrap: anywhere; }
body.reforged .spell-reference-controls select { padding: 8px 10px; max-width: 100%; }
body.reforged .gear-set-bonuses:empty::after { content: none; }
body.reforged .gear-set-bonuses:not(:empty) { padding: 14px; }
body.reforged .gear-set-bonuses:not(:empty) > :last-child { margin-bottom: 0; }
body.reforged .gear-levels { padding: 16px; }
body.reforged .talent-editor-toolbar { padding: 16px; }
body.reforged #gear-items .slot-heading { padding-inline: 14px; overflow-wrap: anywhere; }
body.reforged #gear-items .gear-options > .slot-notice {
  order: 2;
  flex: 0 0 100%;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 8px 0 0;
}
body.reforged #preraid .preraid-slot > h3 { padding-inline: 14px; overflow-wrap: anywhere; }
body.reforged .talent-tree > header { padding-inline: 16px; }

/* A clean calculator: level, level-60 presets and the editable talent trees. */
body.reforged :is(#stage-brief,.talent-editor-toolbar,#endgame-detail,.calc-bottom) {
  display: none !important;
}

/* Compact inventory rows preserve the frame's safe text inset. */
body.reforged #gear-items .gear-options { padding-block: 12px; gap: 9px 12px; }
body.reforged #gear-items .slot-heading { padding-block: 18px; gap: 5px; }
body.reforged #gear-items .gear-choice { min-height: 130px; padding-block: 5px 7px; gap: 5px; }
body.reforged #gear-items .item-art { flex-basis: 58px; width: 58px; height: 58px; min-width: 58px; min-height: 58px; }
body.reforged #gear-items .item-art::after { width: 58px; height: 58px; background-size: 58px 58px; }
body.reforged #gear-items .item-art > img { top: 5px; left: 5px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
body.reforged #preraid { padding-block: 22px; }
body.reforged #preraid .preraid-specs { margin-block: 18px 12px; }
body.reforged #preraid .preraid-slots { margin-top: 16px; }
body.reforged #preraid .preraid-slot { min-height: 86px; }
body.reforged #preraid .preraid-slot > h3 { padding-block: 15px; }
body.reforged #preraid .preraid-options { gap: 9px; padding-block: 12px; }
body.reforged #preraid button.preraid-item { min-height: 68px; gap: 6px; padding-block: 4px; }
body.reforged #preraid button.preraid-item img { width: 40px; height: 40px; min-width: 40px; }

/* Only the chosen faction gets a frame; transparent borders preserve button geometry. */
body.reforged :is(#top,#questing) .faction-picker button[data-faction-choice][aria-pressed] {
  --faction-button-color: #f06a50;
  --faction-button-fill: #651d16;
  --faction-button-glow: #df402b66;
  border: 1px solid transparent;
  border-image: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #bfb093;
}
body.reforged :is(#top,#questing) .faction-picker button[data-faction-choice='Alliance'][aria-pressed] {
  --faction-button-color: #83c6ff;
  --faction-button-fill: #194a7c;
  --faction-button-glow: #388eea66;
}
body.reforged :is(#top,#questing) .faction-picker button[data-faction-choice][aria-pressed='true'] {
  border-color: var(--faction-button-color);
  background: linear-gradient(var(--faction-button-fill),#14100c);
  box-shadow: inset 0 0 16px var(--faction-button-glow),0 0 14px var(--faction-button-glow);
  color: #fff3d3;
}
body.reforged :is(#top,#questing) .faction-picker button[aria-pressed='false']:hover { color: #fff3d3; }
body.reforged :is(#top,#questing) .faction-picker button::before,
body.reforged :is(#top,#questing) .faction-picker button::after { content: none; }
body.reforged :is(#top,#questing) .faction-picker button[data-faction-choice][aria-pressed]:focus-visible {
  outline: 2px solid #f3df9b;
  outline-offset: 4px;
}

/* The class hall uses the same game windows with gold chrome on released classes. */
.class-card {
  border: 1px solid transparent;
  border-image: var(--wow-window-frame) 32 / 19px / 0 stretch;
  outline: none;
  background: linear-gradient(#15191db8,#080b0ed4),var(--wow-marble);
  box-shadow: 0 5px 20px #0007;
}
.class-card::before,.class-card::after { content: none; }
.class-card.is-available {
  border-image-source: var(--wow-active-frame);
  background: radial-gradient(ellipse at 50% 25%,#ad793e40,transparent 70%),linear-gradient(#19171388,#080809cc),var(--wow-marble);
  box-shadow: 0 0 18px #e7b44b22,0 5px 20px #0008;
}
.class-card.is-available:hover { border-color: transparent; box-shadow: 0 0 22px #e7b44b55,0 5px 20px #0008; }
.language-switch button,.wow-button {
  border: 6px solid transparent;
  border-left-width: 12px;
  border-right-width: 12px;
  border-image: url('assets/ui/v6/button-up.png') 6 12 fill / 6px 12px / 0 stretch;
  border-radius: 0;
  outline: 0;
  background: none;
  box-shadow: none;
  color: #ffdb79;
  text-shadow: 1px 1px 2px #000;
}
.language-switch button:hover,.is-available:hover .wow-button,.wow-button:hover { border-image-source: url('assets/ui/v6/button-hover.png'); background: none; }
.language-switch button[aria-pressed='true'] { outline: 1px solid #e5bd6a; outline-offset: 2px; background: none; }
.is-available:active .wow-button,.wow-button:active { border-image-source: url('assets/ui/v6/button-down.png'); background: none; }
@media (max-width: 650px) {
  body.reforged :is(.armory-panel,.gear-armory,#preraid,.respec-comparison,.macro-card,.class-quest-grid article,.preraid-dungeon)::after,
  body.reforged #questing .dungeon-stop::after { border-image-width: 12px; }
  body.reforged .talent-editor-toolbar { padding-inline: 16px; }
  .class-card { border-image-width: 15px; }
}
@media (max-width: 720px) {
  .class-card { padding: 20px 18px; }
}
@media print { body.reforged *::after { border-image: none!important; } body.reforged :is(.item-hover-card,.spell-hover-card) { display: none; } }
/* Leave room above every faction portrait, including its hair and headgear. */
body.reforged > .page-backdrop {
  background-position-y: 0px, 0px, clamp(24px, 3vw, 56px);
}

