:root {
  --bg: #0b0d12;
  --ink: #f3efe4;
  --muted: #c6bda8;
  --gold: #c4a35a;
  --gold-hi: #e4c97a;
  --gold-ink: #1a1408;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman",
    serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

.hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  user-select: none;
}

.panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 1.5rem 1.4rem 2.2rem;
  pointer-events: none;
}

.panel > * {
  pointer-events: auto;
}

.tagline {
  margin: 0 0 0.85rem;
  max-width: 28rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10.5rem;
  min-height: 3.15rem;
  padding: 0.75rem 1.8rem;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--gold-ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow:
    0 1px 0 rgba(255, 236, 190, 0.45) inset,
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.play.is-waiting {
  pointer-events: none;
  opacity: 0.72;
  letter-spacing: 0.04em;
}

.play:hover,
.play:focus-visible {
  filter: brightness(1.06);
}

.play.is-waiting:hover,
.play.is-waiting:focus-visible {
  filter: none;
}

.play:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

.game-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
  background: transparent;
}

.game-frame.is-front {
  z-index: 3;
}

.scene.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
}

body.is-playing .scene.overlay {
  pointer-events: none;
}

body.is-playing .play,
body.is-playing .tagline,
body.is-playing .notes {
  display: none;
}

.notes {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(26rem, calc(100vw - 2.8rem));
  max-height: calc(100dvh - 8.5rem);
  padding: 0.85rem 0.9rem 0.7rem;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 6px;
  background: rgba(11, 13, 18, 0.58);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.notes-heading {
  margin: 0 0 0.65rem;
  color: var(--gold-hi);
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.notes-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.note {
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.note:last-child {
  margin-bottom: 0;
}

.notes-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
}

.notes-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(196, 163, 90, 0.45);
  border-radius: 3px;
  background: rgba(11, 13, 18, 0.45);
  color: var(--gold-hi);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.notes-step:hover:not(:disabled),
.notes-step:focus-visible:not(:disabled) {
  background: rgba(196, 163, 90, 0.2);
}

.notes-step:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 2px;
}

.notes-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.notes-pos {
  min-width: 3.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.note-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.15rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.note-toggle:hover .note-title,
.note-toggle:focus-visible .note-title {
  color: var(--gold-hi);
}

.note-toggle:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 2px;
}

.note-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.note-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.note-time {
  flex: none;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.note-summary {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.note-body {
  display: none;
  margin: 0.45rem 0 0.15rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}

.note-body > :first-child {
  margin-top: 0;
}

.note-body > :last-child {
  margin-bottom: 0;
}

.note-body p,
.note-body ul,
.note-body ol,
.note-body blockquote,
.note-body pre {
  margin: 0.55rem 0;
}

.note-body h1,
.note-body h2,
.note-body h3,
.note-body h4 {
  margin: 0.85rem 0 0.35rem;
  color: var(--gold-hi);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
}

.note-body h1 { font-size: 1.2rem; }
.note-body h2 { font-size: 1.08rem; }
.note-body h3,
.note-body h4 { font-size: 1rem; }

.note-body ul,
.note-body ol {
  padding-left: 1.2rem;
}

.note-body li {
  margin: 0.2rem 0;
}

.note-body a {
  color: var(--gold-hi);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-body code {
  padding: 0.08em 0.35em;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.86em;
}

.note-body pre {
  padding: 0.65rem 0.75rem;
  overflow-x: auto;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
}

.note-body pre code {
  padding: 0;
  background: transparent;
}

.note-body blockquote {
  padding: 0.1rem 0 0.1rem 0.75rem;
  border-left: 2px solid var(--gold);
  color: var(--muted);
}

.note-body hr {
  margin: 0.75rem 0;
  border: 0;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
}

.note-body strong {
  color: var(--ink);
}

.note.is-open .note-body {
  display: block;
}

@media (max-width: 720px) {
  .notes {
    left: 50%;
    width: calc(100vw - 2.8rem);
    max-height: 38dvh;
  }
}
