@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Inter:wght@400;500;600&display=swap");

:root {
  --dusk-deep: #1b2340;
  --dusk-mid: #2c3457;
  --lantern: #e8a33d;
  --lantern-soft: #f0c374;
  --sage: #5b7a63;
  --clay: #a85c3f;
  --parchment: #f2ead9;
  --parchment-dim: #cfc6b3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--dusk-deep);
  color: var(--parchment);
  font-family: "Inter", sans-serif;
  overflow: hidden;
}

/* ---------- Start screen ---------- */

.start-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 20%, #3a3f66 0%, var(--dusk-deep) 60%);
}

.sky-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(232, 163, 61, 0.18), transparent 55%);
  pointer-events: none;
}

.hills {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 42%;
}

.hill {
  position: absolute;
  bottom: -10%;
  width: 70%;
  height: 100%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
}

.hill--back {
  left: -15%;
  background: var(--dusk-mid);
  opacity: 0.7;
}

.hill--front {
  left: 25%;
  background: #232a4a;
}

.lantern {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lantern-soft);
  box-shadow: 0 0 10px 4px rgba(232, 163, 61, 0.55);
  animation: flicker 2.4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  45% { opacity: 1; transform: scale(1.15); }
  60% { opacity: 0.7; transform: scale(0.95); }
}

.content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lantern-soft);
  margin-bottom: 18px;
  opacity: 0.9;
}

h1.title {
  font-family: "Fraunces", serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.tagline {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: var(--parchment-dim);
  margin: 0 0 44px 0;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 14px 42px;
  border-radius: 4px;
  border: 1px solid rgba(242, 234, 217, 0.25);
  background: transparent;
  color: var(--parchment);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: var(--lantern);
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--lantern);
  border-color: var(--lantern);
  color: var(--dusk-deep);
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--lantern-soft);
}

.footnote {
  margin-top: 40px;
  font-size: 12px;
  color: var(--parchment-dim);
  opacity: 0.6;
}

/* ---------- Game screen ---------- */

#game-root {
  width: 100vw;
  height: 100vh;
  position: relative;
  background: var(--dusk-deep);
}

#phaser-container {
  width: 100%;
  height: 100%;
}

.dialogue-box {
  position: absolute;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  width: min(90vw, 560px);
  background: rgba(27, 35, 64, 0.94);
  border: 1px solid rgba(232, 163, 61, 0.4);
  border-radius: 8px;
  padding: 20px 24px;
  color: var(--parchment);
  font-family: "Inter", sans-serif;
  display: none;
  z-index: 10;
}

.dialogue-box.visible {
  display: block;
}

.dialogue-box p {
  margin: 0 0 16px 0;
  font-size: 15px;
  line-height: 1.5;
}

.dialogue-choices {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialogue-choices button {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 4px;
  border: 1px solid rgba(242, 234, 217, 0.3);
  background: transparent;
  color: var(--parchment);
  cursor: pointer;
}

.dialogue-choices button:hover {
  border-color: var(--lantern);
}

.dialogue-choices button.dismiss {
  background: var(--lantern);
  border-color: var(--lantern);
  color: var(--dusk-deep);
  font-weight: 600;
}

.prompt-hint {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--parchment);
  background: rgba(27, 35, 64, 0.85);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(232, 163, 61, 0.35);
  display: none;
  z-index: 9;
}

.prompt-hint.visible {
  display: block;
}

/* Touch controls - only shown on touch devices via JS toggling .touch-active */
.touch-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: none;
  z-index: 8;
}

.touch-active .touch-controls {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
}

.touch-btn {
  background: rgba(242, 234, 217, 0.12);
  border: 1px solid rgba(242, 234, 217, 0.3);
  border-radius: 8px;
  color: var(--parchment);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.touch-talk {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--lantern);
  color: var(--dusk-deep);
  font-weight: 600;
  font-size: 13px;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 8;
}

.touch-active .touch-talk {
  display: flex;
}
