:root {
  color-scheme: light;
  --paper: #f3e6c8;
  --paper-deep: #d6c092;
  --ink: #342c23;
  --rust: #a65336;
  --clay: #7f5b43;
  --shadow: rgba(44, 28, 13, 0.22);
  --cream: #fbf4e5;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.62), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(180, 141, 87, 0.2), transparent 26%),
    linear-gradient(180deg, #f7ecd3 0%, #efe0be 52%, #e4d0a3 100%);
  font-family: "Iowan Old Style", "Book Antiqua", Georgia, serif;
}

body {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#game:active {
  cursor: grabbing;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--ink);
}

#title {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  padding: 7px 11px 5px;
  border: 1px solid rgba(52, 44, 35, 0.12);
  border-radius: 999px;
  background: rgba(252, 246, 232, 0.75);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

#stageLine {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  top: calc(max(14px, env(safe-area-inset-top)) + 36px);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.88;
}

#hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 12px);
  transform: translateX(-50%);
  max-width: min(88vw, 720px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(248, 239, 218, 0.88);
  border: 1px solid rgba(52, 44, 35, 0.1);
  box-shadow: 0 12px 30px rgba(53, 34, 17, 0.08);
  font-size: 14px;
  text-align: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#hint.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

#replay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px 11px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--cream);
  background: linear-gradient(180deg, #a24d34, #7f3826);
  box-shadow: 0 18px 40px rgba(84, 30, 11, 0.25);
}

#replay:hover {
  filter: brightness(1.04);
}

@media (prefers-reduced-motion: reduce) {
  #hint {
    transition: none;
  }
}
