.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 10px clamp(12px, 3vw, 34px);
  color: white;
  background: rgb(22 63 54 / 95%);
  box-shadow: 0 3px 14px rgb(15 47 40 / 24%);
  backdrop-filter: blur(10px);
}

.brand-button,
.profile-button,
.icon-button {
  border: 0;
  color: inherit;
  background: transparent;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 3px;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50% 50% 46% 46%;
  color: var(--moss-dark);
  background: var(--sun);
  font-weight: 1000;
  box-shadow: inset 0 -5px 0 rgb(142 87 22 / 22%);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy small {
  opacity: 0.78;
}

.progress-strip,
.tool-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-strip {
  justify-content: center;
}

.progress-pill {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.tool-strip {
  justify-content: flex-end;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 15px;
  background: rgb(255 255 255 / 10%);
  font-size: 1.35rem;
  font-weight: 900;
}

.icon-button:hover,
.profile-button:hover {
  background: rgb(255 255 255 / 18%);
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 92px;
  max-width: 180px;
  padding: 5px 12px;
  border-radius: 15px;
  font-weight: 800;
}

.icon-button,
.profile-button {
  flex: 0 0 auto;
}

#profile-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--sun);
}

#profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: clamp(18px, 3.5vw, 48px);
}

.screen:focus-visible {
  outline: none;
}

.prototype-note {
  padding: 8px 16px;
  color: rgb(23 54 47 / 78%);
  font-size: 0.76rem;
  text-align: center;
}

.loading-screen,
.welcome-screen,
.profile-screen,
.map-screen,
.area-screen {
  min-height: min(72dvh, 780px);
}

.loading-screen,
.welcome-screen {
  display: grid;
  align-content: center;
  justify-items: center;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.loading-beaver,
.welcome-mark {
  display: grid;
  width: clamp(112px, 20vw, 170px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 24px;
  border: 8px solid rgb(255 255 255 / 68%);
  border-radius: 48% 48% 43% 43%;
  color: white;
  background: linear-gradient(145deg, #986245, #5f3928);
  box-shadow: var(--shadow);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 1000;
}

.welcome-screen h1,
.profile-screen h1,
.map-screen h1,
.area-screen h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2rem, 6vw, 4.8rem);
  letter-spacing: -0.04em;
}

.welcome-screen > p {
  max-width: 620px;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-heading p {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

@media (max-width: 1150px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .progress-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
  }
}

@media (max-width: 680px) {
  .app-header {
    gap: 8px;
    padding: 8px 10px;
  }

  .brand-copy,
  #profile-name {
    display: none;
  }

  .tool-strip {
    gap: 5px;
  }

  .icon-button,
  .profile-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 4px;
    justify-content: center;
  }

  .progress-pill {
    padding: 6px 9px;
    font-size: 0.75rem;
  }

  .screen {
    padding: 18px 12px 28px;
  }
}

@media (orientation: landscape) and (min-width: 700px) and (max-height: 900px) {
  .app-header {
    min-height: 66px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .brand-mark,
  .icon-button,
  .profile-button {
    width: 48px;
    height: 48px;
  }

  .screen {
    padding-top: 14px;
    padding-bottom: 16px;
  }

  .section-heading {
    margin-bottom: 16px;
  }

  .map-screen h1,
  .area-screen h1,
  .profile-screen h1 {
    font-size: clamp(2rem, 5vw, 3.7rem);
  }
}
