:root {
  --gold: #e8b33e;
  --gold-soft: #f3d38a;
  --ink: #0d0f14;
  --muted: #b9b3a6;
  --panel-text: #f4efe4;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--panel-text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  overflow: hidden;
}

.stage {
  inset: 0;
  position: fixed;
}

.stage::after {
  background: linear-gradient(90deg, rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.5) 32%, rgba(8, 10, 14, 0) 55%);
  content: '';
  inset: 0;
  position: absolute;
}

.clip {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 70% center;
  opacity: 0;
  position: absolute;
  width: 100%;
}

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

.throne {
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 88%;
  position: fixed;
  right: 12%;
  top: 6%;
  width: 26%;
  z-index: 2;
}

.panel {
  left: clamp(24px, 6vw, 96px);
  max-width: 440px;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.crest {
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.5));
  height: 84px;
  width: 84px;
}

h1 {
  color: var(--gold);
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.02;
  margin: 0.4rem 0 0.6rem;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.6);
}

.tagline {
  font-size: 1.5rem;
  font-style: italic;
  margin: 0;
}

.chain {
  color: var(--gold-soft);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin: 0.4rem 0 1.6rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  background: rgba(13, 15, 20, 0.55);
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  cursor: pointer;
  display: inline-block;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--gold);
  color: var(--ink);
}

.button-primary {
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.button-primary:hover {
  background: var(--gold-soft);
}

.button[aria-disabled='true'] {
  cursor: default;
  opacity: 0.75;
}

.contract {
  margin-top: 1.4rem;
}

.contract-label {
  color: var(--muted);
  display: block;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.contract-value {
  background: rgba(13, 15, 20, 0.55);
  border: 1px dashed rgba(232, 179, 62, 0.6);
  border-radius: 8px;
  color: var(--panel-text);
  cursor: pointer;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.contract-value:disabled {
  cursor: default;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
}

.fine-print {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 1.6rem 0 0;
}

.subtitle {
  bottom: 7%;
  color: #fff;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-style: italic;
  left: 66%;
  margin: 0;
  max-width: min(90vw, 620px);
  opacity: 0;
  pointer-events: none;
  position: fixed;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 0, 0, 0.7);
  transform: translateX(-50%);
  transition: opacity 0.3s;
  z-index: 4;
}

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

.sound-toggle {
  background: rgba(13, 15, 20, 0.55);
  border: 1px solid rgba(232, 179, 62, 0.6);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  height: 44px;
  position: fixed;
  right: 20px;
  top: 20px;
  width: 44px;
  z-index: 5;
}

.gate {
  -webkit-backdrop-filter: blur(10px) brightness(0.45);
  align-items: center;
  backdrop-filter: blur(10px) brightness(0.45);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  position: fixed;
  transition: opacity 0.8s;
  z-index: 10;
}

.gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.gate-crest {
  height: 120px;
  margin-bottom: 1.6rem;
  width: 120px;
}

.gate-button {
  font-size: 1.1rem;
  padding: 0.95rem 2.2rem;
}

.gate-note {
  color: var(--muted);
  font-size: 1.1rem;
  font-style: italic;
  margin-top: 1rem;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .stage::after {
    background: linear-gradient(0deg, rgba(8, 10, 14, 0.92) 0%, rgba(8, 10, 14, 0.6) 38%, rgba(8, 10, 14, 0) 60%);
  }

  .clip {
    object-position: 72% center;
  }

  .throne {
    height: 50%;
    left: 0;
    right: auto;
    top: 0;
    width: 100%;
  }

  .panel {
    bottom: 16px;
    left: 16px;
    max-width: none;
    right: 16px;
    top: auto;
    transform: none;
  }

  .crest {
    height: 56px;
    width: 56px;
  }

  .tagline {
    font-size: 1.25rem;
  }

  .chain {
    margin-bottom: 1rem;
  }

  .fine-print {
    font-size: 0.85rem;
    margin-top: 1rem;
  }

  .subtitle {
    bottom: auto;
    left: 50%;
    top: 40%;
  }
}
