.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: max-content max-content minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 10px clamp(12px, 3vw, 34px);
  color: white;
  background:
    radial-gradient(circle at 18% -30%, rgb(112 196 226 / 45%), transparent 18rem),
    rgb(23 75 105 / 96%);
  box-shadow: 0 3px 14px rgb(15 60 88 / 26%);
  backdrop-filter: blur(10px);
}

.app-header :focus-visible {
  outline-color: white;
}

.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 {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 3px solid rgb(255 255 255 / 82%);
  border-radius: 50%;
  background-color: #ccecf7;
  background-image: url("../assets/images/characters/benny/benny-character-sheet-style-test-01.png");
  background-position: 7% 82%;
  background-size: 590% auto;
  background-repeat: no-repeat;
  box-shadow: 0 3px 9px rgb(11 50 72 / 24%);
}

.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: flex-start;
}

.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);
}

#app[data-state="subscene"] .screen {
  width: min(100%, 1720px);
  padding-inline: clamp(12px, 2vw, 28px);
}

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

.prototype-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 8px 16px;
  color: rgb(23 54 47 / 78%);
  font-size: 0.76rem;
  text-align: center;
}

.footer-links {
  display: inline-flex;
  gap: 14px;
}

.footer-links a {
  color: inherit;
  font-weight: 800;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: var(--moss-dark);
}

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

.loading-screen,
.welcome-screen {
  margin: 0 auto;
}

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

.welcome-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: clamp(22px, 5vw, 72px);
  width: min(100%, 1180px);
  padding: clamp(28px, 5vw, 70px);
  overflow: hidden;
  border: 3px solid rgb(255 255 255 / 78%);
  border-radius: clamp(26px, 5vw, 52px);
  background:
    radial-gradient(circle at 88% 12%, rgb(255 255 255 / 80%), transparent 17rem),
    linear-gradient(145deg, rgb(247 253 255 / 96%), rgb(210 238 249 / 94%));
  box-shadow: var(--shadow);
}

.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-copy {
  position: relative;
  z-index: 2;
}

.welcome-screen h1 {
  margin-bottom: 18px;
  font-size: clamp(2.65rem, 7vw, 5.9rem);
}

.welcome-screen h1 span {
  display: block;
  color: var(--moss-dark);
}

.welcome-lead {
  max-width: 680px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: clamp(1.06rem, 2vw, 1.32rem);
}

.welcome-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.welcome-features li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid rgb(52 127 164 / 22%);
  border-radius: 999px;
  background: rgb(255 255 255 / 78%);
  font-weight: 900;
}

.welcome-features li span {
  color: var(--moss);
  font-size: 1.3rem;
}

.welcome-start {
  min-height: 60px;
  padding-inline: 28px;
  font-size: 1.08rem;
}

.welcome-visual {
  position: relative;
  align-self: stretch;
  min-height: 430px;
  border-radius: 46% 46% 34% 34%;
  overflow: hidden;
  background: #bde8f7;
}

.welcome-benny-frame {
  position: absolute;
  inset: 0;
}

.welcome-benny-frame img {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: none;
  height: 84.6%;
  animation: welcome-greeting 2.8s ease-in-out infinite;
}

@keyframes welcome-greeting {
  0%, 100% { transform: translate(-73%, -50%) rotate(0deg); }
  45% { transform: translate(-73%, calc(-50% - 6px)) rotate(-1.1deg); }
  60% { transform: translate(-73%, calc(-50% - 4px)) rotate(0.8deg); }
}

.welcome-cloud {
  position: absolute;
  width: 82px;
  height: 28px;
  border-radius: 999px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 22px -12px 0 4px rgb(255 255 255 / 78%), 46px 0 0 rgb(255 255 255 / 78%);
}

.welcome-cloud-one {
  top: 14%;
  left: 10%;
}

.welcome-cloud-two {
  top: 26%;
  right: 17%;
  transform: scale(0.72);
}

.welcome-ripple {
  position: absolute;
  bottom: 18%;
  height: 12px;
  border: 3px solid rgb(255 255 255 / 48%);
  border-block: 0;
  border-radius: 50%;
}

.welcome-ripple-one {
  right: 9%;
  width: 36%;
}

.welcome-ripple-two {
  bottom: 13%;
  left: 8%;
  width: 29%;
}

.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) {
  .brand-copy small {
    display: none;
  }
}

@media (max-width: 900px) {
  .brand-copy {
    display: none;
  }
}

@media (max-width: 1400px) {
  #profile-name {
    display: none;
  }

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

@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 8px;
    font-size: 0.72rem;
  }

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

  .welcome-screen {
    grid-template-columns: 1fr;
    padding: 26px 22px;
  }

  .welcome-visual {
    min-height: 260px;
  }

  .welcome-benny-frame {
    width: min(54%, 190px);
  }
}

@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);
  }
}
