/* Art comes from the game package; native buttons retain focus, names and hit areas. */
.site-header[data-graphic], .inventory-panel[data-graphic] {
  background: #101d29 var(--hud-rail) repeat-x center / auto 100%;
  border: 0;
}
.site-header[data-graphic] { padding: 0 14px; gap: 10px; }
.brand[data-graphic] { display: block; width: var(--hud-title-width, 170px); min-width: 0; flex-shrink: 1; }
.brand[data-graphic] img { display: block; width: 100%; max-height: calc(var(--toolbar-height) - 6px); object-fit: contain; }
.site-header .header-actions { gap: 4px; flex: none; }
.site-header .icon-button[data-graphic] { width: var(--hud-tool-size, 46px); height: var(--hud-tool-size, 46px); border: 0; border-radius: 50%; background: transparent; }
.hud-tool-art { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-position: center; background-size: contain; pointer-events: none; }
.site-header .icon-button[data-graphic]:hover:not(:disabled) { background: transparent; filter: brightness(1.25); }
.site-header .icon-button[data-graphic].active { filter: drop-shadow(0 0 3px #e8b96965); }
.inventory-panel[data-graphic] { padding: 6px 12px; }
.inventory[data-graphic] { gap: 8px; padding: 3px; justify-content: flex-start; }
.inventory[data-graphic] .inventory-slot, .inventory[data-graphic] .inventory-item {
  width: var(--hud-slot-size, 58px); height: var(--hud-slot-size, 58px);
  border: 0; border-radius: 8px; box-shadow: none;
  background: transparent var(--hud-slot) no-repeat center / 100% 100%;
}
.inventory[data-graphic] .inventory-item { padding: 9px; }
.inventory[data-graphic] .inventory-item:hover { filter: brightness(1.22); }
@media (max-width: 520px) {
  .site-header[data-graphic] { padding: 0 6px; gap: 6px; }
  .site-header .header-actions { gap: 0; }
  .site-header .icon-button[data-graphic] { width: 42px; height: 42px; }
  .inventory[data-graphic] { gap: 5px; }
  .inventory[data-graphic] .inventory-slot, .inventory[data-graphic] .inventory-item { width: 48px; height: 48px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-shell { --toolbar-height: 44px !important; --inventory-height: 50px !important; }
  .site-header .icon-button[data-graphic] { width: 40px; height: 40px; }
  .inventory-panel[data-graphic] { padding: 2px 10px; }
  .inventory[data-graphic] .inventory-slot, .inventory[data-graphic] .inventory-item { width: 40px; height: 40px; }
  .inventory[data-graphic] .inventory-item { padding: 6px; }
}

/* Optional overlay HUD (chrome.header.layout='overlay'): no title bar; tools float over the scene.
   Games restyle the medallions through --hud-medal-* variables in their theme. */
.game-shell[data-hud=overlay] { --toolbar-height: 0px !important; }
.game-shell[data-hud=overlay] .site-header {
  position: absolute; top: 0; right: 0; z-index: 25; height: auto; padding: var(--hud-inset, 14px);
  background: none !important; border: 0; pointer-events: none; transition: opacity .2s ease, visibility .2s;
}
.game-shell[data-hud=overlay] .brand { display: none; }
.game-shell[data-hud=overlay] .header-actions { gap: var(--hud-gap, 10px); pointer-events: auto; }
.game-shell[data-hud=overlay] .site-header .icon-button {
  width: var(--hud-tool-size, 50px); height: var(--hud-tool-size, 50px); border-radius: 50%;
  color: var(--hud-medal-ink, #f1e6cc); border: 2px solid var(--hud-medal-ring, #b9a37a);
  background: var(--hud-medal-face, radial-gradient(circle at 35% 30%, #3b403b, #191c1a 70%));
  box-shadow: 0 0 0 3px var(--hud-medal-rim, #1a1612aa), 0 6px 14px #000a, inset 0 2px 4px #ffffff22, inset 0 -3px 6px #0008;
  transition: color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.game-shell[data-hud=overlay] .site-header .icon-button:hover:not(:disabled) {
  color: var(--hud-medal-ink-hover, #fff6dc); border-color: var(--hud-medal-glow, #e3cc98);
  background: var(--hud-medal-face, radial-gradient(circle at 35% 30%, #3b403b, #191c1a 70%));
  box-shadow: 0 0 0 3px var(--hud-medal-rim, #1a1612aa), 0 0 14px color-mix(in srgb, var(--hud-medal-glow, #e3cc98) 40%, transparent), 0 6px 14px #000a, inset 0 2px 4px #ffffff22, inset 0 -3px 6px #0008;
}
.game-shell[data-hud=overlay] .site-header .icon-button:active:not(:disabled) { transform: none; }
.game-shell[data-hud=overlay] .site-header .icon-button[data-graphic] { padding: 6px; }
.hud-line-icon { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* Close-ups bring their own close button in the same corner. */
.game-shell[data-hud=overlay]:has(.stage.detail-active) .site-header { opacity: 0; visibility: hidden; }
@media (max-width: 600px) {
  .game-shell[data-hud=overlay] { --hud-tool-size: 40px; --hud-gap: 6px; --hud-inset: 8px; }
  .game-shell[data-hud=overlay] .site-header .icon-button { border-width: 1.5px; box-shadow: 0 0 0 2px var(--hud-medal-rim, #1a1612aa), 0 3px 8px #0009; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-shell[data-hud=overlay] { --hud-tool-size: 40px; --hud-gap: 6px; --hud-inset: 8px; }
}
@media (prefers-reduced-motion: reduce) { .game-shell[data-hud=overlay] .site-header .icon-button { transition: none; } }
.reduced-motion .game-shell[data-hud=overlay] .site-header .icon-button { transition: none; }
