:root {
  color: #f6f1e7;
  background: #07080c;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #07080c;
}

button, input, label, .hint, .status, .log, .stats {
  font-family: system-ui, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.3rem;
  background: #e6c27a;
  color: #1b140c;
}

button:disabled { opacity: 0.45; cursor: default; }

.fit {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.frame { position: relative; }

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform-origin: top left;
  background: #100d0b;
}

.screen {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
}

.screen[hidden] { display: none; }

.title, .select, .leave, .paper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 180px;
}

.screen h1:focus { outline: none; }

.title h1, .paper h1 {
  font-size: 112px;
  line-height: 0.9;
  margin: 0 0 24px;
}

.kicker, .masthead {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e6c27a;
  margin: 0 0 12px;
}

.lede, .title li, .paper p { font-size: 28px; max-width: 980px; }

.title ul { padding-left: 1.2em; }
.title li { margin: 0.4em 0; }

.select { justify-content: flex-start; padding-top: 64px; }
.select h1 { font-size: 64px; margin: 0 0 28px; }

.select-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 72px;
  align-items: start;
  width: 100%;
}

.bio {
  margin: 12px 0 0;
  font-size: 28px;
  line-height: 1.45;
}

.picker {
  display: flex;
  align-items: center;
  gap: 28px;
}

.picker img {
  width: 300px;
  height: 400px;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
  border: 3px solid #f6f1e7;
}
#tycoon-name {
  margin: 14px 0 0;
  width: 300px;
  margin-left: 112px;
  min-height: calc(2 * 1.15em);
  text-align: center;
  font-size: 28px;
  line-height: 1.15;
}
#prev, #next { font-size: 64px; width: 84px; height: 84px; padding: 0; flex: none; }

.stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 28px 0 18px;
  font-family: system-ui, sans-serif;
  font-size: 20px;
}
.stat {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.stat-label { color: #c8bba6; }
.meter { display: flex; gap: 8px; min-width: 0; }
.meter span {
  flex: 1;
  height: 26px;
  border-radius: 4px;
  background: #2a2d28;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.meter span.on { background: #3dbe6a; box-shadow: none; }
.trait-block {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 14px;
  align-items: center;
}
.trait-block .stat { display: contents; }
.trait-joke {
  grid-column: 3;
  grid-row: 1 / span 2;
  margin: 0;
  font-style: italic;
  font-size: 26px;
  line-height: 1.35;
  color: #c8bba6;
}

.night { display: flex; }

.venue {
  position: relative;
  width: 1580px;
  height: 1080px;
  overflow: hidden;
}

.venue img#venue-img {
  width: 1580px;
  height: 1080px;
  display: block;
}

.grid {
  position: absolute;
  inset: 0;
  width: 1580px;
  height: 1080px;
  display: none;
  pointer-events: none;
}
.grid line { stroke: rgba(255, 255, 255, 0.28); stroke-width: 2; }

.actor {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 230px;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  transform-origin: bottom center;
}
.stage.walking .actor {
  transition: translate 1.15s ease-in-out, scale 1.15s ease-in-out;
}
.stage.walking .actor.staying { transition: none; }
.actor img {
  display: block;
  width: 230px;
  height: 307px;
  object-fit: cover;
  object-position: center top;
  border-radius: 14px;
  border: 3px solid #f6f1e7;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}
.actor .name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  text-align: center;
  color: white;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  text-shadow: 0 1px 4px #000;
}
.actor.selected img { box-shadow: 0 0 0 4px #e6c27a, 0 16px 30px rgba(0, 0, 0, 0.45); }
.actor.closing img { box-shadow: 0 0 0 4px #f3f6ff, 0 16px 30px rgba(0, 0, 0, 0.45); }

#speeches {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.speech-col {
  position: absolute;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 250px;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
  translate: -50% 0;
  scrollbar-color: rgba(255, 255, 255, 0.55) transparent;
  scrollbar-width: thin;
}
.bubble {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a120c;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.35;
}
.bubble.tycoon { background: rgba(230, 194, 122, 0.95); }

.bar-form {
  position: absolute;
  z-index: 35;
  left: 50%;
  bottom: 16px;
  width: 640px;
  margin: 0;
  padding: 10px 12px 8px;
  translate: -50% 0;
  border-radius: 16px;
  background: rgba(12, 13, 18, 0.9);
  color: #f6f1e7;
}
.bar-form #round-label { margin: 0; font-size: 16px; }
.bar-form .hint { min-height: 0; margin: 2px 0 6px; font-size: 14px; }
.bar-form label { display: flex; justify-content: space-between; margin-bottom: 4px; }
#ask-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
#ask-fields label { grid-column: 1 / -1; }
.bar-form #count { display: inline; margin: 0; }

.countdown {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 18%;
  margin: 0;
  translate: -50% 0;
  font-size: 120px;
  color: white;
  text-shadow: 0 8px 24px #000;
}

.rail {
  width: 340px;
  height: 1080px;
  padding: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #12141c;
}

.ad-slot {
  width: 300px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.hint { margin: 8px 0; color: #c8bba6; font-size: 16px; }
#restart { margin-top: 8px; align-self: flex-start; }

form label { display: block; font-size: 14px; margin-bottom: 6px; }
form input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3a3d4a;
  background: #0c0d12;
  color: white;
}
#count { display: block; text-align: right; color: #9aa0b4; font-size: 13px; margin: 4px 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status { min-height: 1.4em; color: #f0b4a8; font-size: 15px; }

.paper {
  background: #f4efe4;
  color: #1b140c;
  justify-content: flex-start;
  padding: 48px 72px;
}
.paper .masthead, .paper h1 { width: 100%; max-width: none; }
.paper h1 { font-size: 64px; line-height: 0.95; margin: 0 0 28px; }
.paper-body {
  display: flex;
  align-items: start;
  gap: 48px;
  width: 100%;
}
.pair { display: flex; gap: 24px; margin: 0; flex: none; }
.pair img {
  width: 280px;
  height: 373px;
  object-fit: cover;
  object-position: center top;
}
.story { flex: 1; min-width: 0; margin: 0; }
.story p { max-width: none; margin: 0 0 22px; font-size: 30px; line-height: 1.4; }
.story mark { background: #f3d48a; color: inherit; font-weight: 700; }
.leave { align-items: center; text-align: center; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

dialog {
  border: 0;
  border-radius: 18px;
  padding: 28px;
  max-width: 420px;
  color: #1b140c;
  font-family: system-ui, sans-serif;
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.72);
}
dialog form { display: flex; justify-content: flex-end; gap: 10px; }
dialog button[value="no"] { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .stage.walking .actor { transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
