:root {
  --vellum: #efe0bd;
  --vellum-dark: #e2cc9c;
  --ink: #2a1d14;
  --iron: #3b2f2a;
  --vermilion: #c63b22;
  --lapis: #2a4c9b;
  --verdigris: #3f8a6c;
  --gold: #c9a13b;
  --wood: #3a2616;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--wood);
  color: var(--ink);
  font-family: "IM Fell English", Georgia, "Times New Roman", serif;
  overflow: hidden;
}

#desk {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background:
    repeating-linear-gradient(92deg, rgba(0,0,0,.07) 0 3px, transparent 3px 11px),
    repeating-linear-gradient(88deg, rgba(255,220,170,.035) 0 1px, transparent 1px 23px),
    radial-gradient(ellipse at 50% 40%, #5a3b22, #24160c 80%);
}

#stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  max-height: 100%;
}

#page {
  display: block;
  height: min(calc(100vh - 24px), calc((100vw - 32px) * 4 / 3));
  width: auto;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.55));
  image-rendering: auto;
}

/* ---------- the Options leaf ---------- */
#menu {
  position: absolute;
  left: calc(100% + 20px);
  top: 50%;
  width: 330px;
  padding: 26px 26px 18px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120,80,30,.18), transparent 60%),
    var(--vellum);
  box-shadow: 0 12px 30px rgba(0,0,0,.6), inset 0 0 40px rgba(120,80,30,.25);
  transform: translateY(-50%) rotate(.6deg);
  user-select: none;
  z-index: 5;
}
#menu.hidden { display: none; }

#menu .ribbon {
  position: absolute;
  top: -12px; right: 38px;
  width: 22px; height: 70px;
  background: linear-gradient(90deg, #8e1f16, #b8321f 50%, #8e1f16);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}

#menu h2 {
  margin: 0;
  font-family: "UnifrakturMaguntia", "IM Fell English", serif;
  font-weight: normal;
  font-size: 38px;
  line-height: 1;
}
#menu h2 .initial {
  color: var(--vermilion);
  font-size: 50px;
}
#menu .sub {
  margin: 2px 0 14px;
  font-style: italic;
  font-size: 14px;
  opacity: .7;
}

#menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: item;
}
#menu-items li {
  counter-increment: item;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 4px 5px 30px;
  font-size: 17px;
  cursor: pointer;
  border-radius: 2px;
}
#menu-items li::before {
  content: counter(item, upper-roman) ".";
  position: absolute;
  left: 0;
  width: 26px;
  text-align: right;
  color: var(--vermilion);
  font-family: "IM Fell English SC", serif;
  font-size: 14px;
}
#menu-items li .label { white-space: nowrap; }
#menu-items li .dots {
  flex: 1;
  border-bottom: 1.5px dotted rgba(42,29,20,.35);
  transform: translateY(-4px);
  min-width: 10px;
}
#menu-items li .value {
  white-space: nowrap;
  font-style: italic;
}
#menu-items li .arrow {
  color: var(--vermilion);
  font-style: normal;
  opacity: 0;
  padding: 0 2px;
}
#menu-items li.sel { background: rgba(198,59,34,.10); }
#menu-items li.sel .arrow { opacity: 1; }
#menu-items li .arrow.off { color: rgba(42,29,20,.22); }
#menu-items li.disabled { opacity: .45; }
#menu-items li.divider {
  height: 10px; padding: 0; cursor: default; counter-increment: none;
}
#menu-items li.divider::before { content: none; }
#menu-items li.action .value { font-style: normal; }
#menu-items li .swatch {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}
#menu .foot {
  margin: 14px 0 0;
  font-size: 12px;
  text-align: center;
  opacity: .6;
}
#menu .note {
  font-size: 13px;
  font-style: italic;
  color: #6b4a2e;
  min-height: 1.3em;
  margin: 8px 0 0 30px;
}

/* ---------- title / interstitial screens ---------- */
#screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#screen.hidden { display: none; }
#screen .card {
  width: min(78%, 480px);
  padding: 26px 30px 22px;
  text-align: center;
  background: rgba(239,224,189,.94);
  box-shadow: 0 0 0 2px var(--vermilion), 0 0 0 6px var(--vellum), 0 0 0 7px var(--gold), 0 12px 40px rgba(0,0,0,.35);
}
#screen h1 {
  margin: 0 0 8px;
  font-family: "UnifrakturMaguntia", serif;
  font-weight: normal;
  font-size: clamp(34px, 6vh, 56px);
  line-height: 1.05;
}
#screen h1 .red { color: var(--vermilion); }
#screen-body { font-size: clamp(14px, 2.1vh, 18px); line-height: 1.4; }
#screen-body p { margin: 6px 0; }
#screen-body .small { font-size: .85em; opacity: .75; font-style: italic; }
#screen .prompt {
  margin: 14px 0 0;
  font-family: "IM Fell English SC", serif;
  color: var(--vermilion);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }

/* not enough desk beside the page: lay the leaf over it */
#menu.overlay {
  left: auto;
  right: 10px;
  width: min(330px, calc(100% - 20px));
  padding: 16px 18px 12px;
  background-color: rgba(239,224,189,.97);
}
#menu.overlay h2 { font-size: 30px; }
#menu.overlay .sub { display: none; }
#menu.overlay #menu-items li { font-size: 15px; padding-block: 3px; }
