/* Base styles. Every .css under app/assets is linked by stylesheet_link_tag :app, in
   alphabetical order: this file, then design_system/*, then pages/*. Rules in different
   files never target the same selector, so the order doesn't matter. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--void);
  color: var(--text);
  font: 400 1rem/1.625rem var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Text for screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Flash notice: floating pill at the top of the viewport. */
.flash {
  position: fixed;
  top: calc(var(--space-md) + env(safe-area-inset-top));
  left: 50%;
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 2 * var(--margin));
  margin: 0;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--glass-3-line);
  border-radius: var(--radius-lg);
  background: var(--glass-3);
  box-shadow: var(--glass-3-shadow);
  color: var(--text-strong);
  font: 600 0.875rem/1.375rem var(--font-ui);
  text-align: center;
  transform: translateX(-50%);
  animation: flash-out 0.4s ease-in 5s forwards;
}

@keyframes flash-out {
  to { opacity: 0; visibility: hidden; }
}

/* Page shell shared by the map and the settings. */
.page {
  width: min(64rem, 100%);
  margin: 0 auto;
  padding: calc(var(--margin) + env(safe-area-inset-top)) var(--margin) calc(var(--margin) + env(safe-area-inset-bottom));
}

/* Wider shell for the level map. */
.page--wide {
  width: min(76rem, 100%);
}

.page__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.page__heading {
  flex: 1;
  min-width: 0;
}

.page__title {
  margin: 0;
  color: var(--text-strong);
  font: 600 2.5rem/3rem var(--font-display);
  letter-spacing: -0.01em;
}

@media (max-width: 767px) {
  .page__title {
    font-size: 1.75rem;
    line-height: 2.25rem;
  }

  .page__header {
    margin-bottom: var(--space-lg);
  }
}
