/* The tools stay in one row when a game takes the place of its world catalogue. */
[data-world-tools] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  gap: 8px;
  min-height: 44px;
  --world-control-fill: #243745;
  --world-control-ink: #f0dcb0;
  --world-control-line: #a8956a;
}
.tavern-interface [data-world-tools] {
  --world-control-fill: #f2dfb9;
  --world-control-ink: #5b3926;
  --world-control-line: #ad8452;
}
.gallery-interface [data-world-tools] {
  --world-control-fill: #eff4e8;
  --world-control-ink: #315f59;
  --world-control-line: #9bb8aa;
}
[data-world-tools] > [data-notifications-slot] { order: 1; }
[data-world-tools] > .world-player-badge { order: 2; }
[data-world-tools] > .display-fullscreen { order: 3; }
body [data-world-tools] :is(.world-player-badge.player-portrait, .display-fullscreen, .auberge-notifications > summary) {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  place-items: center;
  align-self: center;
  flex: 0 0 44px;
  box-sizing: border-box;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--world-control-line) !important;
  border-radius: 11px;
  background: var(--world-control-fill) !important;
  color: var(--world-control-ink) !important;
}
[data-world-tools] .auberge-notifications.in-header > summary::before { color: inherit; }
[data-world-tools] .world-player-badge .equipped-crown { top: -8px !important; font-size: 20px !important; }
[data-world-tools] .auberge-notifications.in-header .auberge-notifications-panel {
  position: fixed;
  top: max(12px, var(--world-notifications-top, 64px));
  right: 12px;
  bottom: auto;
  left: auto;
  box-sizing: border-box;
  width: min(360px, calc(100% - 24px));
  max-height: max(100px, calc(100dvh - var(--world-notifications-top, 64px) - 12px));
  overflow-y: auto;
}
.lab-tavern-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: clamp(12px, 3vw, 40px);
}
body[data-local-lab=true] .lab-tavern-topbar .retour-portail {
  position: static;
  inset: auto;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 7px 12px;
}
.lab-tavern-topbar [data-world-tools], .lab-world-header [data-world-tools] { margin-inline-start: auto; }
body[data-local-lab=true].tavern-interface:not(.lab-immersive) .lab-tavern-topbar .header-date {
  position: static;
  inset: auto;
  min-width: 0;
  max-width: none;
  transform: none;
}
body[data-local-lab=true].gallery-interface .site-header {
  display: flex;
  align-items: center;
  position: sticky;
  top: 8px;
  z-index: 125;
  backdrop-filter: none;
}
body[data-local-lab=true].gallery-interface .site-header #stats-button { min-width: 44px; min-height: 44px; margin: 0; }
body[data-local-lab=true] .lab-game-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  margin: 8px clamp(12px, 3.5vw, 56px) 0;
}
body[data-local-lab=true].lab-immersive:has(.lab-game-topbar) .lab-immersive-main { padding-top: 0; }
body[data-local-lab=true].lab-immersive:has(.lab-game-topbar) .lab-game-shell { padding-top: 8px; }
body[data-local-lab=true].lab-isolde-page:has(.lounge-panel:not([hidden])) [data-world-tools] .auberge-notifications { visibility: visible; pointer-events: auto; }
body[data-local-lab=true] .lab-header .account-zone { align-items: center; }
body[data-local-lab=true] .lab-header .account-zone .display-fullscreen { order: 5; align-self: center; margin: 0; }
.game-view > .game-toolbar[hidden] { display: none !important; }
#lab-coffres-isolde {
  --world-ink: #513521;
  --world-muted: #6d5034;
  --world-panel: #f8ecd2;
  --world-accent: #946436;
  --world-line: #ad845466;
}
#lab-coffres-isolde .lab-game-shell { padding: 0; }
#lab-coffres-isolde .lab-play-layout { display: block; }
#lab-coffres-isolde .lab-play-panel { border: 1px solid #ae895a; border-radius: 16px; background: #f8ecd2; }
#lab-coffres-isolde .lab-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.gallery-wiki-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid #9eb7aa;
  border-radius: 14px;
  background: #f4f5e9;
  color: #244c53;
}
.gallery-wiki-heading h1 { margin: 0; font: 600 clamp(22px, 3vw, 30px)/1.2 Georgia, serif; }
.gallery-wiki-heading .gallery-return { color: #315f59; background: #e7eee1; border-color: #9eb7aa; }
.gallery-return svg, .lab-result-actions a > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gallery-wiki-view iframe { display: block; width: 100%; height: 340px; border: 0; background: transparent; }
.gallery-wiki-view [hidden] { display: none !important; }
@media (max-width: 760px) {
  [data-world-tools] { gap: 6px; }
  body[data-local-lab=true].lab-world-scriptorium .lab-world-header { flex-wrap: wrap; gap: 10px; }
  .lab-world-scriptorium .lab-world-header > [data-world-tools] { order: 1; }
  .lab-world-scriptorium .lab-world-header > .lab-world-brand { order: 2; flex: 1 0 100%; }
  body[data-local-lab=true].gallery-interface .site-header #stats-button { width: 44px; padding: 8px; }
  body[data-local-lab=true].gallery-interface .site-header #stats-button :is(span, small) { display: none; }
}
@media (max-width: 540px) {
  body[data-local-lab=true].gallery-interface .site-header { justify-content: space-between; padding: 8px; gap: 8px; }
  body[data-local-lab=true].gallery-interface .site-header .brand { order: 5; flex: 1 0 100%; }
  body[data-local-lab=true].gallery-interface.game-active .site-header .brand { display: none; }
  body[data-local-lab=true].gallery-interface .site-header .retour-portail { min-width: 44px; padding: 6px; }
  body[data-local-lab=true].gallery-interface .site-header .retour-portail strong { display: none; }
}
