:root {
  --void: #050506;
  --cream: #f3ead8;
  --gold: #c9a227;
  --muted: #e4d3b4;
  --ink: #1a1404;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--void); color: var(--cream); }
body { font-family: Manrope, system-ui, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#back {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--void);
  overflow: hidden;
}
#back video,
#back .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#back .slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}
#back .slide.on { opacity: 1; }
#scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.55), transparent 16%, transparent 84%, rgba(5, 5, 6, 0.55)),
    linear-gradient(180deg, rgba(5, 5, 6, 0.62) 0%, rgba(5, 5, 6, 0.28) 24%, rgba(5, 5, 6, 0.4) 62%, rgba(5, 5, 6, 0.86) 100%);
}
body[data-scene="black"] #scrim {
  background: radial-gradient(ellipse 70% 38% at 50% 0%, rgba(201, 162, 39, 0.2), transparent 62%);
}
#app { position: relative; z-index: 2; }
#sound {
  position: fixed;
  z-index: 5;
  top: 0.85rem;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.75);
  background: rgba(5, 5, 6, 0.78);
  color: var(--cream);
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
#sound[hidden] { display: none !important; }
#sound svg { display: block; }
.front {
  width: min(920px, calc(100% - 1.5rem));
  margin: 0 auto;
  min-height: 100dvh;
  padding: 4.2rem 0 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.brand, .label {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
h1 {
  font-family: Oswald, sans-serif;
  font-weight: 600;
  font-size: clamp(3.2rem, 10vw, 6.4rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0.35rem 0 0.85rem;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-wrap: balance;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.72);
}
.when, .place, .age, .names, .value {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
.when {
  font-family: Oswald, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}
.place { color: var(--muted); font-size: 1rem; margin-top: 0.2rem; }
.age {
  margin: 0.45rem 0 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--cream);
}
.cards {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.4rem 0 0.85rem;
}
.card { display: flex; flex-direction: column; min-width: 0; }
.photo {
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.18), rgba(5, 5, 6, 0.15)),
    #141416;
  background-size: cover;
  background-position: center;
}
.nick {
  background: var(--gold);
  color: var(--ink);
  font-family: Oswald, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.6vw, 0.95rem);
  padding: 0.32rem 0.2rem 0.26rem;
  min-height: 1.7rem;
}
.names {
  font-family: Oswald, sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0.15rem 0 0.7rem;
  max-width: 28ch;
}
.crew {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem 1rem;
  margin-top: 0.2rem;
}
.value {
  font-family: Oswald, sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
  margin-top: 0.15rem;
}
.pay { width: min(640px, 100%); margin-top: 1.15rem; }
.price {
  font-family: Oswald, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.55rem;
}
.cta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 200px;
  min-height: 52px;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  font-family: Oswald, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.25rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.cta.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(243, 234, 216, 0.55);
}
.blik {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.blik-no {
  font-family: Oswald, sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: 0.06em;
}
.blik-meta { color: var(--muted); font-size: 0.92rem; }
.textbtn {
  margin-top: 0.35rem;
  background: transparent;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  min-height: 44px;
}
.papers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: center;
  margin-top: 1.1rem;
}
.papers a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.edit [contenteditable="true"] {
  outline: 1px dashed rgba(201, 162, 39, 0.7);
  outline-offset: 4px;
  cursor: text;
}
.edit .photo { cursor: pointer; outline: 1px dashed rgba(201, 162, 39, 0.7); outline-offset: 3px; }
.note {
  width: min(640px, calc(100% - 1.4rem));
  margin: 0.6rem auto 0;
  color: var(--gold);
  font-size: 0.88rem;
  text-align: center;
}
.err { color: #f0c2b6; }
.dock {
  position: relative;
  z-index: 3;
  width: min(720px, calc(100% - 1.5rem));
  margin: 0 auto 2.5rem;
  padding-top: 0.4rem;
  text-align: left;
}
.dock h2 {
  font-family: Oswald, sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 1.15rem 0 0.35rem;
}
.help { color: var(--muted); font-size: 0.95rem; line-height: 1.5; max-width: 62ch; }
.row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; align-items: center; }
.dock button, .dock .file, .drop button {
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: transparent;
  color: var(--cream);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 40px;
}
.dock button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.file input { display: none; }
.dock input[type="url"],
.dock input[type="text"],
.paper textarea {
  width: 100%;
  background: #0c0c0e;
  border: 1px solid rgba(243, 234, 216, 0.2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.dock label.grow { flex: 1 1 220px; display: flex; }
.slides { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.slide-thumb { width: 72px; display: flex; flex-direction: column; gap: 0.25rem; }
.slide-thumb img { width: 72px; height: 96px; object-fit: cover; }
.slide-thumb button { font-size: 0.75rem; padding: 0.25rem; }
.drops { display: grid; gap: 0.6rem; margin-top: 0.7rem; }
.drop {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.55rem;
  align-items: center;
}
.drop img { width: 52px; height: 68px; object-fit: cover; }
.drop p { font-family: Oswald, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.slots { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.paper {
  width: min(62ch, calc(100% - 1.6rem));
  margin: 0 auto;
  min-height: 100dvh;
  padding: 4.5rem 0 3rem;
  text-align: left;
}
.paper h1 { font-size: clamp(2.6rem, 8vw, 4.2rem); max-width: 12ch; margin: 0.8rem 0 0.4rem; }
.backlink {
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  text-decoration: none;
}
.prose {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 1.05rem;
  margin-top: 0.8rem;
}
.paper textarea { min-height: 52vh; margin-top: 0.8rem; line-height: 1.5; }
.paper .save { margin-top: 0.7rem; }
@media (max-width: 720px) {
  .crew { grid-template-columns: 1fr; gap: 0.7rem; }
  h1 { font-size: clamp(2.5rem, 12vw, 3.8rem); max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #back .slide { transition: none; }
}
