@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&display=swap');

:root {
  color-scheme: dark;
  font-family: 'DM Sans', sans-serif;
  color: #f3f0e8;
  background: #172321;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body,
#world {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 320px;
}

#scene,
#scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#scene canvas {
  touch-action: none;
  cursor: crosshair;
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.location {
  position: absolute;
  top: 26px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(248, 245, 235, 0.88);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-shadow: 0 1px 10px #121c1c;
}

.location__marker {
  width: 8px;
  height: 8px;
  border: 1px solid #e4a35f;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(228, 163, 95, 0.7);
}

.location__divider {
  margin: 0 5px;
  color: #e4a35f;
}

.hud__hint {
  position: absolute;
  right: 28px;
  top: 25px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(15, 24, 23, 0.55);
  color: rgba(248, 245, 235, 0.8);
  font-size: 11px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.hud__hint.is-visible {
  opacity: 1;
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 248, 228, 0.85);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.welcome {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(90deg, rgba(13, 23, 22, 0.78), rgba(13, 23, 22, 0.22));
  transition: opacity 450ms ease, visibility 450ms ease;
}

.welcome.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.welcome__card {
  width: min(440px, 100%);
  padding: 38px 42px 28px;
  border: 1px solid rgba(244, 237, 218, 0.15);
  border-radius: 9px;
  background: rgba(19, 31, 29, 0.87);
  box-shadow: 0 28px 90px rgba(7, 13, 12, 0.44);
  backdrop-filter: blur(14px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: #d7ad7c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #df9f61;
}

h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(54px, 10vw, 76px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h1 em {
  color: #dda16b;
  font-weight: 600;
}

.welcome__copy {
  max-width: 335px;
  margin: 21px 0 25px;
  color: rgba(242, 239, 229, 0.72);
  font-size: 13px;
  line-height: 1.75;
}

.start-button {
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 4px;
  background: #df9f61;
  color: #19221f;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.start-button:hover {
  transform: translateY(-1px);
  background: #efb375;
}

.start-button span:last-child {
  font-size: 18px;
}

.welcome__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 18px;
  margin-top: 24px;
  color: rgba(242, 239, 229, 0.64);
  font-size: 10px;
}

kbd {
  display: inline-grid;
  min-width: 17px;
  height: 18px;
  margin-right: 2px;
  padding: 0 3px;
  place-items: center;
  border: 1px solid rgba(242, 239, 229, 0.25);
  border-radius: 3px;
  color: rgba(250, 246, 232, 0.9);
  font: inherit;
  font-size: 9px;
}

.welcome__note {
  margin: 23px 0 0;
  padding-top: 13px;
  border-top: 1px solid rgba(244, 237, 218, 0.12);
  color: rgba(242, 239, 229, 0.44);
  font-size: 10px;
}

.touch-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 1;
  display: none;
  grid-template: repeat(2, 48px) / repeat(3, 48px);
  gap: 5px;
  touch-action: none;
}

.touch-controls__key {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(19, 31, 29, 0.7);
  color: #f3f0e8;
  font: inherit;
  font-size: 18px;
  touch-action: none;
  user-select: none;
}

.touch-controls__key[data-key='KeyW'] {
  grid-area: 1 / 2;
}

.touch-controls__key[data-key='KeyA'] {
  grid-area: 2 / 1;
}

.touch-controls__key[data-key='KeyS'] {
  grid-area: 2 / 2;
}

.touch-controls__key[data-key='KeyD'] {
  grid-area: 2 / 3;
}

.touch-controls__key.is-pressed {
  background: rgba(223, 159, 97, 0.78);
}

@media (pointer: coarse) {
  .touch-controls {
    display: grid;
  }

  .welcome__footer span:nth-child(2) {
    display: none;
  }

  .location {
    top: 17px;
    left: 17px;
  }

  .hud__hint {
    top: 15px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .welcome {
    padding: 16px;
    background: rgba(13, 23, 22, 0.48);
  }

  .welcome__card {
    padding: 30px 26px 23px;
  }
}
