:root {
  --bg: #140d06;
  --bg-2: #241608;
  --parch: #e8d6ad;
  --parch-deep: #d8c08a;
  --ink: #3a2410;
  --ink-soft: #5e4322;
  --brass: #b98a3c;
  --brass-lt: #e7c578;
  --ember: #c2451f;
  --ember-lt: #ff7a44;
  --line: rgba(123, 92, 40, 0.45);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
}
body {
  min-height: 100dvh;
  color: var(--parch);
  font-family: "IM Fell English", Georgia, serif;
  background: radial-gradient(120% 80% at 50% -10%, #3a2611 0%, var(--bg-2) 38%, var(--bg) 100%), #140d06;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
/* atmosphere */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(115% 90% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.66) 100%);
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  width: 100%;
  max-width: 520px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 32px;
  gap: 14px;
}

/* masthead */
.masthead {
  text-align: center;
  animation: rise 0.9s ease both;
}
.flourish {
  color: var(--brass);
  font-size: 22px;
  line-height: 1;
  opacity: 0.85;
}
.flourish.big {
  font-size: 40px;
  margin-bottom: 8px;
}
h1 {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  font-size: clamp(34px, 11vw, 54px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--brass-lt);
  text-shadow:
    0 1px 0 #3a2610,
    0 0 26px rgba(231, 197, 120, 0.18);
  margin-top: 2px;
}
.tag {
  font-style: italic;
  color: #c9b487;
  opacity: 0.78;
  letter-spacing: 0.04em;
  font-size: 14px;
  margin-top: 6px;
}

/* compass */
.compass-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: rise 1s 0.1s ease both;
  width: 100%;
}
.compass {
  width: min(82vw, 360px);
  aspect-ratio: 1;
  position: relative;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 60px rgba(255, 150, 60, 0.06));
}
.compass svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
#rose,
#needle {
  will-change: transform;
}
#rose {
  transition: transform 0.14s linear;
}
#needle {
  transition: transform 0.14s linear;
}
#needle.casting {
  transition: transform 1.9s cubic-bezier(0.16, 0.84, 0.2, 1);
}
.compass.casting {
  animation: shimmer 1.9s ease;
}
@keyframes shimmer {
  0%,
  100% {
    filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6));
  }
  40% {
    filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 40px rgba(255, 150, 60, 0.5));
  }
}

/* readout */
.readout {
  text-align: center;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.seek-emoji {
  font-size: 26px;
  line-height: 1;
  height: 28px;
}
.seek-name {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--parch);
  letter-spacing: 0.02em;
  max-width: 92vw;
}
.seek-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--brass-lt);
  font-size: 15px;
}
.dist {
  font-size: 24px;
  font-weight: 700;
  font-family: "Cinzel", serif;
}
.sep {
  opacity: 0.5;
}
.cardinal {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  color: #c9b487;
}
.seek-hint {
  font-style: italic;
  color: #a98f63;
  font-size: 13px;
  opacity: 0.8;
  max-width: 280px;
}

/* console */
.console {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: rise 1s 0.2s ease both;
}
.ask {
  width: 100%;
  display: flex;
  gap: 0;
  align-items: stretch;
  background: linear-gradient(180deg, #efe0bd, #dcc794);
  border: 2px solid #6e4f24;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ask input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: "IM Fell English", serif;
  font-size: 17px;
  color: #3a2410;
  padding: 15px 16px;
  letter-spacing: 0.01em;
}
.ask input::placeholder {
  color: #8a6c3c;
  opacity: 0.8;
  font-style: italic;
}
.seal {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
  border: none;
  color: #2a1a08;
  background: radial-gradient(120% 120% at 40% 30%, var(--brass-lt), var(--brass) 55%, #7c531f 100%);
  padding: 0 22px;
  transition:
    filter 0.2s,
    transform 0.1s;
  border-left: 2px solid #6e4f24;
}
.seal:hover {
  filter: brightness(1.08);
}
.seal:active {
  transform: scale(0.97);
}
.seal.lg {
  padding: 15px 30px;
  border-radius: 5px;
  border: 2px solid #6e4f24;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 13px;
  color: var(--brass-lt);
  background: rgba(123, 92, 40, 0.16);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 13px;
  cursor: pointer;
  transition: 0.2s;
}
.chip:hover {
  background: rgba(185, 138, 60, 0.28);
  color: #fbe7b6;
}

.status {
  font-size: 13px;
  color: #b89a68;
  letter-spacing: 0.06em;
  min-height: 18px;
  text-align: center;
  font-style: italic;
}
.status .spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
.extras a,
.extras button {
  font-family: "Cinzel", serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-lt);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  padding: 9px 14px;
  transition: 0.2s;
}
.extras a:hover,
.extras button:hover {
  background: rgba(185, 138, 60, 0.18);
  border-color: var(--brass);
}

/* gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: radial-gradient(120% 90% at 50% 10%, #2a1b0c 0%, #0e0904 80%);
  transition: opacity 0.5s ease;
}
.gate.hide {
  opacity: 0;
  pointer-events: none;
}
.gate-card {
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.gate-card h2 {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  font-size: 42px;
  color: var(--brass-lt);
}
.gate-card p {
  color: #c2aa7c;
  line-height: 1.7;
  font-size: 15px;
}
.gate-card .fine {
  font-size: 12px;
  opacity: 0.7;
  color: #917650;
}

/* install hint */
.install-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
  background: linear-gradient(180deg, #efe0bd, #d8c08a);
  color: #3a2410;
  border: 2px solid #6e4f24;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
}
.install-hint .ghost {
  background: #7c531f;
  color: #fbe7b6;
  border: none;
  border-radius: 5px;
  padding: 7px 12px;
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-size: 12px;
}
.install-hint .x {
  background: none;
  border: none;
  color: #6e4f24;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

[hidden] {
  display: none !important;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 380px) {
  .seek-name {
    font-size: 19px;
  }
  h1 {
    font-size: 42px;
  }
}
