/* Version B: follows the brief (1930s art deco department store) */
:root {
  --bg: #12141C;
  --bg-deep: #0C0E14;
  --panel: #1A1D28;
  --gold: #D9B65E;
  --gold-hi: #F2DE9E;
  --gold-lo: #9C7B34;
  --ivory: #F3EBDD;
  --ivory-2: #D8CFBE;
  --label: #B8AE9C;
  --line: #3A3526;
  --accent: var(--gold);
  --accent-hi: var(--gold-hi);
  --accent-lo: var(--gold-lo);
  --serif: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body[data-theme="wife"] {
  --accent: #C7834F;
  --accent-hi: #EDB88A;
  --accent-lo: #8A5230;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg-deep); }

body {
  --metal: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 45%, var(--accent-lo) 100%);
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, #1E2232 0%, var(--bg) 55%, var(--bg-deep) 100%);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Art deco sunburst */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 36%, rgba(217,182,94,.055) 0 3deg, transparent 3deg 9deg);
  -webkit-mask-image: radial-gradient(circle at 50% 36%, #000 0, rgba(0,0,0,.5) 35%, transparent 70%);
          mask-image: radial-gradient(circle at 50% 36%, #000 0, rgba(0,0,0,.5) 35%, transparent 70%);
}
body[data-theme="wife"]::before {
  background: repeating-conic-gradient(from 0deg at 50% 36%, rgba(199,131,79,.07) 0 3deg, transparent 3deg 9deg);
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: clamp(18px, 3vw, 30px) 16px 0;
  color: var(--accent);
  transition: color .5s;
}
.lockup { display: flex; align-items: center; gap: 14px; }
.awning { width: clamp(34px, 5vw, 46px); height: auto; flex: none; }
.brand {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(14px, 2.4vw, 22px);
  letter-spacing: .3em;
  white-space: nowrap;
  background: var(--metal);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .34em; color: var(--label); }

/* ---------- Elevator ---------- */
main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(8px, 2vw, 18px) 16px 12px; }

.indicator { padding-bottom: 6px; }
#dial {
  display: block;
  width: 100%;
  max-width: clamp(240px, 32vw, 300px);
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.45));
  transition: opacity .5s;
}
body[data-theme="wife"] #dial { opacity: .4; }

#dial .arc-main { stroke: var(--gold); }
#dial .tick { stroke: var(--line); stroke-width: 1.2; }
#dial .tick.major { stroke: var(--gold-lo); stroke-width: 1.6; }

#dial-floors text {
  font-family: var(--serif);
  font-size: 17px;
  fill: var(--label);
  text-anchor: middle;
  dominant-baseline: central;
  transition: fill .4s;
}
#dial-floors circle { fill: #14161F; stroke: var(--line); stroke-width: 1.5; transition: fill .4s, stroke .4s, filter .4s; }
#dial-floors .lit circle { fill: var(--gold); stroke: var(--gold-hi); filter: drop-shadow(0 0 7px rgba(217,182,94,.75)); }
#dial-floors .lit text { fill: var(--bg-deep); font-weight: 500; }

#needle {
  transform-origin: 120px 120px;
  transition: transform .8s cubic-bezier(.34, 1.56, .64, 1);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}

/* The cabin: arched deco doorway */
.cabin {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 500px;
  margin: 0 auto;
  border: 2px solid var(--accent);
  border-radius: clamp(80px, 18vw, 180px) clamp(80px, 18vw, 180px) 3px 3px;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(217,182,94,.16), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(217,182,94,.035) 46px 47px),
    linear-gradient(180deg, #1D2130 0%, var(--panel) 40%, #151823 100%);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line), 0 40px 90px rgba(0,0,0,.55), inset 0 0 100px rgba(0,0,0,.35);
  transition: border-color .5s;
}
.cabin::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(217,182,94,.28);
  border-radius: inherit;
  pointer-events: none;
}


.screen {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(52px, 8vw, 72px) clamp(22px, 6vw, 72px) clamp(30px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.screen.enter > * { animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) both; }
.screen.enter > *:nth-child(2) { animation-delay: .07s; }
.screen.enter > *:nth-child(3) { animation-delay: .14s; }
.screen.enter > *:nth-child(4) { animation-delay: .21s; }
.screen.enter > *:nth-child(5) { animation-delay: .28s; }
.screen.enter > *:nth-child(6) { animation-delay: .35s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.screen h1, .screen h2 {
  margin: 0 0 18px;
  max-width: 17em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 5.2vw, 46px);
  line-height: 1.14;
  background: var(--metal);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
  outline: none;
  text-wrap: balance;
}
.screen h1 { font-size: clamp(30px, 5.6vw, 52px); }

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--label);
}
.kicker::before, .kicker::after { content: ""; width: 34px; height: 1px; background: var(--accent); opacity: .55; }

.lead { margin: 0 0 16px; max-width: 30em; font-size: clamp(16px, 2vw, 18px); color: var(--ivory); }
.aside { margin: 0 0 26px; max-width: 26em; font-family: var(--serif); font-style: italic; font-size: clamp(19px, 2.6vw, 24px); line-height: 1.4; color: var(--ivory-2); }

/* Rules plaque */
.rules {
  list-style: none;
  counter-reset: rule;
  margin: 6px 0 26px;
  padding: 6px 0;
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: 1fr;
  text-align: left;
  color: var(--ivory-2);
  font-size: 15px;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
.rules li { counter-increment: rule; position: relative; padding: 11px 0 11px 46px; border-bottom: 1px solid var(--line); }
.rules li:last-child { border-bottom: 0; }
.rules li::before { content: counter(rule, upper-roman); position: absolute; left: 4px; top: 8px; min-width: 30px; font-family: var(--serif); font-size: 22px; color: var(--accent); }

/* Illustration medallion */
.medal {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 0 18px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle, rgba(217,182,94,.1), transparent 70%);
  box-shadow: 0 0 0 5px var(--panel), 0 0 0 6px rgba(217,182,94,.35);
}
.art { width: 50px; height: 50px; }

/* ---------- Buttons (brief: 2px corners, 48px+, gold, uppercase) ---------- */
.btn-row { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--accent-hi);
  font: 600 12.5px/1 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, color .25s, box-shadow .25s, transform .15s;
}
.btn::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(217,182,94,.3); pointer-events: none; }
.btn.primary { background: var(--metal); border-color: var(--accent-hi); color: #1A1608; box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary::after { border-color: rgba(26,22,8,.28); }
.btn:hover { background: rgba(217,182,94,.12); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
body[data-theme="wife"] .btn.primary { color: #1F1109; }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }

/* ---------- Share ---------- */
.share { margin-top: 28px; width: 100%; padding-top: 22px; border-top: 1px solid var(--line); }
.share p { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--label); }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255,255,255,.015);
  color: var(--ivory-2);
  font: 500 13px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent-hi); background: rgba(217,182,94,.06); }
.share-status { min-height: 1.4em; margin-top: 10px; font-size: 13px; color: var(--accent-hi); }

/* ---------- Doors: brass and navy panels with deco lines ---------- */
.doors { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.6%;
  background:
    repeating-linear-gradient(45deg, transparent 0 17px, rgba(217,182,94,.1) 17px 18px),
    repeating-linear-gradient(-45deg, transparent 0 17px, rgba(217,182,94,.1) 17px 18px),
    linear-gradient(180deg, #262B3D, #141722);
  transition: transform .4s cubic-bezier(.65, 0, .35, 1);
  box-shadow: inset 0 0 0 1px var(--gold-lo);
}
.door::before { content: ""; position: absolute; inset: 22px 18px; border: 1px solid rgba(217,182,94,.5); box-shadow: inset 0 0 0 5px rgba(20,23,34,.9), inset 0 0 0 6px rgba(217,182,94,.25); }
.door::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi), var(--gold-lo)); }
.door.l { left: 0; transform: translateX(-101%); }
.door.l::after { right: 0; }
.door.r { right: 0; transform: translateX(101%); }
.door.r::after { left: 0; }
.doors.closed .door { transform: none; }

/* ---------- Controls & footer ---------- */
.controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin-top: 18px; }
.restart { color: var(--accent-hi); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-underline-offset: 5px; text-decoration-color: rgba(217,182,94,.5); padding: 14px 0; }
.restart[hidden] { display: none; }
.ding { margin-left: auto; min-height: 48px; padding: 0 4px; background: none; border: 0; color: var(--label); font: 500 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.ding:hover { color: var(--ivory); }

.site-footer { position: relative; z-index: 1; padding: 18px 16px 30px; text-align: center; font-size: 11px; letter-spacing: .34em; color: var(--label); }
.site-footer p { margin: 0; }
.noscript { text-align: center; color: var(--ivory-2); }

@media (max-width: 599px) {
  .cabin { min-height: 520px; }
  .kicker::before, .kicker::after { width: 22px; }
  .medal { width: 76px; height: 76px; }
  .art { width: 44px; height: 44px; }
}

@media (min-width: 700px) {
  .btn-row { flex-direction: row; max-width: none; justify-content: center; }
  .rules { grid-template-columns: 1fr 1fr; column-gap: 36px; }
  .rules li:nth-child(n+3) { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
