/* Ad containers + site legal footer (matches Last War Tools theme) */

/* Keep Auto ads from causing horizontal page shift */
html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

/* Bottom host: Auto ads relocated out of headers/nav/tools land here */
.lw-ad-host {
  display: none;
  width: 100%;
  max-width: 980px;
  margin: 16px auto 8px;
  padding: 8px 16px;
  box-sizing: border-box;
  text-align: center;
}

.lw-ad-host.has-ads {
  display: block;
}

.lw-ad-host__item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 728px;
  margin: 0 auto 12px;
  overflow: hidden;
}

.lw-ad-host__item:last-child {
  margin-bottom: 0;
}

.lw-ad-host .google-auto-placed,
.lw-ad-host ins.adsbygoogle,
.lw-ad-host iframe {
  max-width: 100% !important;
}

.lw-ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 980px;
  margin: 12px auto 8px;
  padding: 8px 16px;
  min-height: 90px;
  box-sizing: border-box;
}

.lw-ad-slot--banner {
  min-height: 100px;
}

.lw-ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

.lw-ad-slot:empty {
  display: none;
  min-height: 0;
  padding: 0;
  margin: 0;
}

/*
 * Hide Auto ads that Google injects into critical UI until/unless JS moves them
 * to #lw-ad-host. Prevents covering Language / nav / train conductor controls.
 */
.page-top-stack .google-auto-placed,
.page-top-stack ins.adsbygoogle,
.page-top-controls .google-auto-placed,
.page-top-controls ins.adsbygoogle,
.account-promo-strip .google-auto-placed,
.account-promo-strip ins.adsbygoogle,
.page-nav .google-auto-placed,
.page-nav ins.adsbygoogle,
.hero .google-auto-placed,
.hero ins.adsbygoogle,
.conductor-layout .google-auto-placed,
.conductor-layout ins.adsbygoogle,
.schedule-header .google-auto-placed,
.schedule-header ins.adsbygoogle {
  display: none !important;
}

/* Align bottom chrome with .page width */
.site-legal-bar,
.support-bar {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

.site-legal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 14px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-soft, #37506a);
  background: linear-gradient(
    135deg,
    rgba(116, 192, 252, 0.1) 0%,
    rgba(8, 16, 25, 0.72) 100%
  );
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  color: var(--muted, #91a4b8);
}

.site-legal-bar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Standalone support bar / Buy Me a Coffee — hidden */
.support-bar,
.support-link,
.site-legal-bar nav .page-link--support,
a[href*="buymeacoffee.com"] {
  display: none !important;
}

/* Pill links (also used when main site CSS is not loaded) */
.site-legal-bar nav .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--line, #2b3d51);
  border-radius: 999px;
  background: rgba(8, 16, 25, 0.66);
  color: var(--muted, #91a4b8);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.site-legal-bar nav .page-link:hover,
.site-legal-bar nav .page-link:focus-visible {
  color: var(--text, #e4edf7);
  border-color: rgba(116, 192, 252, 0.42);
  outline: none;
}

/* Cookie / ads consent — same panel + buttons as the rest of the site */
.lw-cookie-notice {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  width: calc(100% - 32px);
  max-width: 520px;
  margin: 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-soft, #37506a);
  background: linear-gradient(180deg, var(--panel, #111c28) 0%, var(--panel-2, #162434) 100%);
  color: var(--text, #e4edf7);
  font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.lw-cookie-notice p {
  margin: 0 0 12px;
  color: var(--muted, #91a4b8);
}

.lw-cookie-notice__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.lw-cookie-notice__actions .action-button {
  margin: 0;
}

.lw-cookie-notice__actions .action-button--quiet {
  background: transparent;
  border-color: var(--line-soft, #37506a);
  color: var(--muted, #91a4b8);
  text-decoration: none;
}

.lw-cookie-notice__actions .action-button--quiet:hover,
.lw-cookie-notice__actions .action-button--quiet:focus-visible {
  border-color: rgba(116, 192, 252, 0.55);
  color: var(--text, #e4edf7);
  text-decoration: none;
}

.lw-cookie-notice.is-hidden {
  display: none;
}

/* Back to top — injected by site-legal-footer.js */
.lw-back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 16px));
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft, #37506a);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--panel, #111c28) 0%, var(--panel-2, #162434) 100%);
  color: var(--text, #e4edf7);
  font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    visibility 160ms ease,
    transform 160ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.lw-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lw-back-to-top:hover,
.lw-back-to-top:focus-visible {
  border-color: rgba(116, 192, 252, 0.55);
  color: var(--accent, #74c0fc);
  outline: none;
}

@media (max-width: 600px) {
  .site-legal-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .site-legal-bar nav {
    width: 100%;
  }

  .lw-cookie-notice {
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    width: calc(100% - 24px);
  }

  .lw-back-to-top {
    right: max(12px, env(safe-area-inset-right, 12px));
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }

  /* Sit above the cookie notice while it is visible */
  body:has(.lw-cookie-notice:not(.is-hidden)) .lw-back-to-top {
    bottom: calc(max(12px, env(safe-area-inset-bottom, 12px)) + 140px);
  }
}
