/* Shared hub-style shell for game boot pages */

.hub-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.4rem;
  background: rgba(10, 18, 30, 0.88);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #cbd5e1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, 0.08);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.hub-back-link:hover {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, 0.14),
    0 0 12px rgba(56, 189, 248, 0.28);
}

#hubBackLink {
  text-align: center;
}

.hub-game-shell,
#game-container.hub-game-shell {
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.5rem;
  background: rgba(8, 14, 22, 0.82);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, 0.1),
    0 10px 28px rgba(0, 0, 0, 0.48);
}

.hub-game-shell > header,
#game-container.hub-game-shell > header,
.hub-game-shell > .relics-header {
  margin: 0;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.5rem 0.5rem 0 0;
  background: rgba(12, 24, 38, 0.92);
}

.hub-game-shell #game-view,
#game-container.hub-game-shell #game-view {
  padding: 1rem 1.1rem 1.25rem;
}

/* Single in-game header — hide duplicate landing chrome */
body:has(#game-container.hub-game-shell) .landing-header {
  display: none;
}

body:has(.game-header-hub-link) #hubBackLink {
  display: none !important;
}

.game-shell-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.game-shell-title-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.game-header-hub-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.4rem;
  background: rgba(10, 18, 30, 0.88);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #cbd5e1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, 0.08);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.game-header-hub-link:hover {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 26, 42, 0.95);
}

@media (max-width: 640px) {
  .relics-hud .hud-secondary,
  .echoes-stats .hud-secondary {
    display: none;
  }
}

/* Shared game dialog + hub toast (vanilla games) */
body.game-dialog-open {
  overflow: hidden;
}

.game-dialog {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.game-dialog[hidden] {
  display: none !important;
}

.game-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.82);
  backdrop-filter: blur(4px);
}

.game-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(24rem, 100%);
  padding: 1.15rem 1.2rem 1.05rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(14, 24, 36, 0.98), rgba(8, 14, 22, 0.98));
  color: #e8eef4;
  font-family: system-ui, sans-serif;
}

.game-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0f2fe;
}

.game-dialog-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #b8c8d8;
  white-space: pre-line;
}

.game-dialog-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.45rem;
}

@media (min-width: 420px) {
  .game-dialog-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.game-dialog-btn {
  padding: 0.55rem 1rem;
  border-radius: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.game-dialog-btn--ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.game-dialog-btn--primary {
  background: linear-gradient(180deg, rgba(74, 103, 65, 0.95), rgba(54, 78, 48, 0.95));
  border-color: rgba(127, 176, 105, 0.45);
  color: #f0fdf4;
}

.game-dialog-btn--danger {
  background: linear-gradient(180deg, rgba(160, 58, 42, 0.95), rgba(120, 40, 30, 0.95));
  border-color: rgba(224, 122, 95, 0.55);
  color: #fff5f2;
}

.game-dialog-toast,
.hub-chrome-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(0.75rem);
  z-index: 10060;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.55rem 0.85rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(127, 176, 105, 0.45);
  background: rgba(12, 22, 18, 0.94);
  color: #d8ead0;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hub-chrome-toast strong {
  display: block;
  font-size: 0.78rem;
  color: #a7f3d0;
  margin-bottom: 0.15rem;
}

.game-dialog-toast.is-visible,
.hub-chrome-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-dialog-toast[hidden],
.hub-chrome-toast[hidden] {
  display: block !important;
  opacity: 0;
}
