@font-face {
  font-family: 'Creepster';
  src: url('/fonts/creepster-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* The centered menu overlays the actual WebGL scene; drag still orbits it. */
#startscreen {
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 44px;
  background: radial-gradient(ellipse 30% 72% at 50% 52%, #15132ad9, #15132a91 53%, #15132a26 86%, transparent),
    linear-gradient(0deg, #10112655, transparent 30%);
  backdrop-filter: none;
  cursor: grab;
  touch-action: pan-y;
}
#startscreen:active { cursor: grabbing; }
#startscreen .home-copy {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, max-content);
  justify-content: center;
  width: min(500px, 100%);
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}
#startscreen .forest-home-emblem { width: 67px; height: 63px; justify-self: center; margin-bottom: 24px; }
#startscreen h1 { font-family: 'Creepster', SlopeDisplay, sans-serif; font-weight: 400; font-size: clamp(63px, 6.5vw, 92px); line-height: 1.08; letter-spacing: .012em; margin-bottom: 19px; }
#startscreen .home-intro,
#startscreen .home-rules { color: #dfd4e9; }
/* Only the title sets the column width, including after the font loads. */
#startscreen .home-intro,
#startscreen .home-rules,
#startscreen #namerow,
#startscreen #loadingState {
  contain: inline-size;
  min-width: 0;
  width: 100%;
}
#startscreen .home-footer { color: #d3c9e0; opacity: .7; }
#startscreen button { cursor: pointer; }
#startscreen button:disabled { cursor: default; }

/* Control choice belongs to the first coachmark, without an extra start screen. */
#guidePanel .guide-input-picker {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  border: 1px solid #b49ac742;
  border-radius: 9px;
  background: #2a203e80;
  padding: 3px;
  margin: 0 0 17px;
}
#guidePanel .guide-input-picker[hidden] { display: none; }
#guidePanel .guide-input-picker button {
  min-height: 33px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  color: #c7b9d7;
  font: 500 11px/1.5 Poppins, sans-serif;
  transform: none;
}
#guidePanel .guide-input-picker button[aria-pressed='true'] {
  color: #ffe2b6;
  border-color: #d0a77e66;
  background: linear-gradient(#76566e, #5b3d57);
  box-shadow: inset 0 1px 0 #fff1c71a;
}
#guidePanel .guide-input-picker button:hover { filter: brightness(1.15); }
#guidePanel[data-input='camera'] .guide-input-picker { margin-inline: auto; }
@media(pointer: coarse) { #guidePanel .guide-input-picker button { min-height: 44px; } }

@media (min-width: 701px) and (max-height: 780px) {
  #startscreen { padding: 22px 24px 28px; }
  #startscreen .forest-home-emblem { width: 52px; height: 49px; }
  #startscreen h1 { font-size: 70px; margin-bottom: 14px; }
}
@media (max-width: 700px) {
  #startscreen {
    overflow-y: auto;
    justify-content: flex-end;
    padding: 28px 22px max(28px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, #15132ce8, #15132ca8 48%, #15132c22 75%, transparent);
  }
  #startscreen .home-copy { width: 100%; max-width: 390px; margin: 0 auto; }
  #startscreen .forest-home-emblem { width: 53px; height: 50px; margin-bottom: 20px; }
  #startscreen h1 { font-size: clamp(47px, 13.2vw, 68px); margin-bottom: 15px; }
  #startscreen .home-eyebrow { font-size: 8px; margin-bottom: 6px; }
  #startscreen .home-intro,
  #startscreen .home-rules { font-size: 11px; }
}
@media (max-width: 700px) and (max-height: 700px) {
  #startscreen { padding: 18px 22px 24px; justify-content: center; }
  #startscreen .home-copy { margin: auto; }
  #startscreen .forest-home-emblem { width: 42px; height: 40px; margin-bottom: 16px; }
  #startscreen h1 { font-size: 47px; margin-bottom: 12px; }
  #startscreen .home-eyebrow { font-size: 7px; }
  #startscreen .home-intro,
  #startscreen .home-rules { font-size: 10px; }
}
@media (max-width: 700px) and (min-height: 900px) {
  #startscreen { padding-bottom: 8dvh; }
}
