/* The game shell owns this parent document; game documents remain isolated in the iframe. */
html,
body {
  margin: 0;
  height: 100%;
  background: var(--anb-abyss);
  overflow: hidden;
}

.anb-game-shell-page {
  min-height: 100%;
}

.anb-game-shell-frame {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--anb-abyss);
}

.anb-game-shell-greybox {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: calc(var(--anb-z) - 2);
  display: flex;
  justify-content: center;
  padding: 4px 8px;
  pointer-events: none;
  color: var(--anb-gold-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--anb-base) 92%, transparent), transparent);
  font: 600 11px/1.3 var(--anb-font-mono);
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 1px 2px var(--anb-abyss);
}

/* Above the overlay, not below it. At `--anb-z` the open drawer covered the dock, so the button
   that opened the overlay could not close it — a toggle that only toggles one way. Verified by a
   real click being intercepted by `.anb-game-shell-panel`. */
.anb-game-shell-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: calc(var(--anb-z) + 2);
  display: grid;
  width: 46px;
  height: 46px;
  padding: 10px;
  place-items: center;
  border: 1px solid var(--anb-line);
  border-radius: var(--anb-r);
  color: var(--anb-gold);
  background: color-mix(in srgb, var(--anb-base) 88%, transparent);
  box-shadow: var(--anb-shadow-sm);
  cursor: pointer;
}

.anb-game-shell-dock:hover,
.anb-game-shell-dock:focus-visible {
  border-color: var(--anb-gold);
  background: var(--anb-raised);
  outline: none;
}

.anb-game-shell-mark {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--anb-gold);
  mask: url('/shell/anubis-mark.svg') center / contain no-repeat;
}

.anb-game-shell-overlay {
  position: fixed;
  z-index: calc(var(--anb-z) + 1);
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.anb-game-shell-overlay[data-open="true"] {
  visibility: visible;
}

.anb-game-shell-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  background: color-mix(in srgb, var(--anb-abyss) 62%, transparent);
  transition: opacity 140ms ease;
}

.anb-game-shell-overlay[data-open="true"] .anb-game-shell-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.anb-game-shell-drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 24px));
  padding: 16px;
  flex-direction: column;
  pointer-events: auto;
  transform: translateX(calc(100% + 24px));
  transition: transform 160ms ease;
}

.anb-game-shell-overlay[data-open="true"] .anb-game-shell-drawer {
  transform: translateX(0);
}

.anb-game-shell-overlay-header {
  display: flex;
  min-width: 0;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anb-game-shell-overlay-identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.anb-game-shell-overlay-tag {
  overflow: hidden;
  color: var(--anb-text);
  font: 700 15px/1.1 var(--anb-font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anb-game-shell-popout {
  flex: none;
}

.anb-game-shell-panel {
  min-height: 0;
  flex: 1;
}

.anb-game-shell-unavailable {
  margin: 4px 0 0;
  color: var(--anb-muted);
  font: 500 13px/1.5 var(--anb-font);
}

@media (max-width: 639px) {
  .anb-game-shell-dock {
    right: 12px;
    bottom: 12px;
  }

  .anb-game-shell-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(78vh, 640px);
    padding: 16px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--anb-r-lg) var(--anb-r-lg) 0 0;
    transform: translateY(calc(100% + 12px));
  }

  .anb-game-shell-overlay[data-open="true"] .anb-game-shell-drawer {
    transform: translateY(0);
  }
}
