/* paparazzi — black tie, gold leaf, red carpet. */
:root {
  --bg: #0b0a09;
  --bg2: #151310;
  --card: #1b1814;
  --line: #3a3127;
  --text: #f4ecdc;
  --muted: #a99c86;
  --gold: #d4af37;
  --gold-hi: #f6e27a;
  --gold-lo: #9c7a1c;
  --red: #9e1b25;
  --red-hi: #c8283a;
  --ok: #6fbf73;
  --radius: 14px;
  --serif: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --goldgrad: linear-gradient(135deg, var(--gold-lo), var(--gold-hi) 45%, var(--gold) 60%, var(--gold-lo));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #231d14 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .02em; margin: 0 0 .4em; }
a { color: var(--gold-hi); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.gold {
  background: var(--goldgrad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* deco divider */
.deco {
  display: flex; align-items: center; gap: .6rem; color: var(--gold);
  margin: .8rem 0 1rem; font-size: .8rem; letter-spacing: .3em; text-transform: uppercase;
}
.deco::before, .deco::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--gold); background: transparent; color: var(--gold-hi);
  padding: .7rem 1.2rem; border-radius: 999px; cursor: pointer; font-weight: 600;
  letter-spacing: .03em; min-height: 44px; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--goldgrad); color: #1a1406; border-color: transparent; }
.btn.red { background: var(--red); border-color: var(--red-hi); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.sm { padding: .35rem .8rem; min-height: 34px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=password], input:not([type]), textarea, select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 5rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0 .25rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}

/* toast */
#toasts { position: fixed; left: 0; right: 0; top: .75rem; display: grid; gap: .5rem; justify-items: center; z-index: 50; pointer-events: none; padding: 0 1rem; }
.toast {
  background: #1f1a12; border: 1px solid var(--gold); color: var(--text); padding: .7rem 1rem;
  border-radius: 12px; box-shadow: 0 8px 30px #000a; max-width: 32rem; pointer-events: auto;
  animation: drop .25s ease-out;
}
.toast.err { border-color: var(--red-hi); }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }

/* ============================================================ guest app */
.guest { min-height: 100%; display: flex; flex-direction: column; }
.guest header {
  text-align: center; padding: 1.2rem 1rem .4rem;
  padding-top: max(1.2rem, env(safe-area-inset-top));
}
.guest header h1 { font-size: 1.6rem; margin: 0; }
.guest header .tagline { color: var(--muted); font-style: italic; font-family: var(--serif); }
.guest main { flex: 1; padding: .5rem 1rem 6rem; max-width: 40rem; width: 100%; margin: 0 auto; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #0e0c0aee; border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  background: none; border: 0; padding: .55rem 0 .6rem; color: var(--muted); cursor: pointer;
  display: grid; justify-items: center; gap: .1rem; font-size: .72rem; letter-spacing: .05em; position: relative;
}
.tabs button svg { width: 24px; height: 24px; }
.tabs button.on { color: var(--gold-hi); }
.tabs .dot { position: absolute; top: .35rem; left: 58%; width: 9px; height: 9px; border-radius: 50%; background: var(--red-hi); box-shadow: 0 0 0 2px var(--bg); }

/* join */
.join { display: grid; place-items: center; min-height: 100%; padding: 2rem 1.25rem; text-align: center; }
.join .ticket {
  width: 100%; max-width: 24rem; padding: 2rem 1.5rem; border-radius: 18px;
  background: linear-gradient(180deg, #1f1a12, #12100c); border: 1px solid var(--gold);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--gold-lo), 0 20px 60px #000c;
}
.join h1 { font-size: 2rem; }
.join form { display: grid; gap: .8rem; margin-top: 1.2rem; }
.star { font-size: 2.2rem; color: var(--gold); }

/* camera */
.shoot { display: grid; place-items: center; padding: 1.5rem 0 1rem; gap: 1rem; text-align: center; }
.shutter {
  width: 9.5rem; height: 9.5rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--goldgrad); color: #1a1406; display: grid; place-items: center;
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--gold-lo), 0 10px 40px #d4af3740;
}
.shutter svg { width: 4rem; height: 4rem; }
.shutter:active { transform: scale(.96); }
.preview { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; background: var(--bg2); }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; width: 100%; }
.progress > div { height: 100%; width: 0; background: var(--goldgrad); transition: width .2s; }

/* programme */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 3.6rem; top: .4rem; bottom: .4rem; width: 1px; background: var(--gold-lo); }
.timeline li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1.1rem; padding: .55rem 0; position: relative; }
.timeline li::after { content: ""; position: absolute; left: calc(3.6rem - 4px); top: 1rem; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); }
.timeline li.now::after { background: var(--red-hi); box-shadow: 0 0 10px var(--red-hi); }
.timeline .t { font-family: var(--serif); color: var(--gold-hi); text-align: right; padding-top: .1rem; }
.timeline .ti { font-weight: 600; }
.lineup { display: grid; gap: .6rem; }
.lineup .p { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: center; }
.lineup .av { grid-row: span 2; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--goldgrad); color: #1a1406; font-family: var(--serif); font-weight: 700; }
.lineup .role { color: var(--muted); font-size: .85rem; }

/* vote */
.envelope { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.envelope .big { font-size: 3rem; }
.poll h2 { font-size: 1.4rem; text-align: center; margin-bottom: 1rem; }
.options { display: grid; gap: .6rem; }
.option {
  position: relative; overflow: hidden; text-align: left; width: 100%; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem;
  display: flex; justify-content: space-between; gap: 1rem; min-height: 52px; align-items: center;
}
.option .bar { position: absolute; inset: 0 auto 0 0; background: #d4af3726; transition: width .5s ease; z-index: 0; }
.option > span { position: relative; z-index: 1; }
.option.mine { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.option.win { border-color: var(--gold-hi); }
.option:disabled { cursor: default; }

/* chat */
.chat { display: flex; flex-direction: column; gap: .5rem; padding-bottom: 4.5rem; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .75rem; max-width: 85%; align-self: flex-start; }
.msg.me { align-self: flex-end; border-color: var(--gold-lo); background: #221c11; }
.msg.ann { align-self: stretch; max-width: none; border-color: var(--gold); background: linear-gradient(135deg, #2a2110, #16120b); }
.msg .who { font-size: .75rem; color: var(--gold); }
.msg .when { font-size: .7rem; color: var(--muted); margin-left: .4rem; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }
.composer {
  position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; gap: .5rem; padding: .5rem 1rem; background: #0e0c0aee; border-top: 1px solid var(--line);
}
.composer input { flex: 1; }

/* announcement banner */
.banner {
  margin: 0 1rem .5rem; padding: .7rem 1rem; border-radius: 12px; border: 1px solid var(--gold);
  background: linear-gradient(135deg, #2a2110, #16120b); display: flex; gap: .6rem; align-items: flex-start;
}
.banner .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* modal */
.modal { position: fixed; inset: 0; background: #000c; display: grid; place-items: center; z-index: 40; padding: 1.5rem; }
.modal .box { background: var(--card); border: 1px solid var(--gold); border-radius: 18px; padding: 1.6rem; max-width: 24rem; width: 100%; text-align: center; }

/* ============================================================ big screen */
.screen { overflow: hidden; background: #000; cursor: none; }
.screen .stage { position: fixed; inset: 0; }
.screen .slide {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1.2s ease;
}
.screen .slide.on { opacity: 1; }
.screen .slide .blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(.35); }
.screen .slide img {
  position: relative; max-width: 92vw; max-height: 84vh; object-fit: contain;
  border: 6px solid #f4ecdc; box-shadow: 0 30px 80px #000; border-radius: 3px;
  animation: kb 14s ease-out both;
}
@keyframes kb { from { transform: scale(1.0) rotate(-.6deg); } to { transform: scale(1.06) rotate(.4deg); } }
.screen .credit {
  position: absolute; left: 0; right: 0; bottom: 2.2vh; text-align: center; font-family: var(--serif);
  font-size: 2.4vh; color: var(--text); text-shadow: 0 2px 8px #000;
}
.screen .credit b { color: var(--gold-hi); }
.screen .brand {
  position: fixed; top: 2.5vh; left: 3vw; z-index: 5; font-family: var(--serif); font-size: 3.2vh;
  text-shadow: 0 2px 12px #000;
}
.screen .brand small { display: block; font-size: 1.8vh; color: var(--muted); font-style: italic; }
.screen .qr {
  position: fixed; right: 2.5vw; bottom: 2.5vh; z-index: 5; text-align: center; background: #f4ecdc; color: #111;
  border-radius: 10px; padding: .6vh; width: 16vh; font-size: 1.5vh; font-weight: 600; box-shadow: 0 10px 30px #000;
}
.screen .qr img { width: 100%; display: block; }
.screen .empty { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; }
.screen .empty h1 { font-size: 8vh; }
.screen .empty p { font-size: 3vh; color: var(--muted); }
.screen .empty .qrbig { width: 34vh; background: #f4ecdc; padding: 1vh; border-radius: 12px; margin: 3vh auto 0; }
.screen .empty .qrbig img { width: 100%; display: block; }

.screen .overlay {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 6vh 8vw;
  background: radial-gradient(ellipse at center, #1d170dee, #000000f5); animation: fade .6s ease;
}
@keyframes fade { from { opacity: 0; } }
.screen .overlay .inner { width: 100%; max-width: 120vh; text-align: center; }
.screen .overlay h1 { font-size: 6vh; }
.screen .overlay .label { letter-spacing: .4em; text-transform: uppercase; color: var(--gold); font-size: 2vh; }
.screen .ann-text { font-family: var(--serif); font-size: 6vh; line-height: 1.25; }
.screen .bars { display: grid; gap: 1.6vh; margin-top: 4vh; text-align: left; }
.screen .bars .row { position: relative; border: 1px solid var(--gold-lo); border-radius: 1.2vh; padding: 1.8vh 2vh; font-size: 3vh; overflow: hidden; display: flex; justify-content: space-between; }
.screen .bars .row .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #9c7a1c88, #d4af37aa); transition: width .8s ease; }
.screen .bars .row span { position: relative; }
.screen .bars .row.win { border-color: var(--gold-hi); box-shadow: 0 0 40px #d4af3766; }
.screen .winner { font-family: var(--serif); font-size: 10vh; margin-top: 2vh; animation: reveal 1.4s ease both; }
@keyframes reveal { from { opacity: 0; letter-spacing: .5em; filter: blur(8px); } }
.screen .ticker {
  position: fixed; left: 0; right: 0; top: 0; z-index: 6; background: var(--goldgrad); color: #1a1406;
  font-weight: 700; padding: .8vh 3vw; font-size: 2.4vh; text-align: center;
}

/* ============================================================ admin */
.admin header { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin header h1 { font-size: 1.3rem; margin: 0; }
.admin nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.admin nav button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; color: var(--muted); }
.admin nav button.on { border-color: var(--gold); color: var(--gold-hi); }
.admin main { padding: 1rem; max-width: 70rem; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.stat .n { font-family: var(--serif); font-size: 2rem; color: var(--gold-hi); }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; }
.ph { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ph img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ph .meta { padding: .4rem .5rem; font-size: .8rem; }
.ph.hidden img { opacity: .3; }
.ph.pending { border-color: var(--gold); }
.ph .acts { display: flex; gap: .3rem; padding: 0 .5rem .5rem; flex-wrap: wrap; }
.tag { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); color: var(--muted); }
.tag.open { border-color: var(--ok); color: var(--ok); }
.tag.draft { border-color: var(--gold-lo); color: var(--gold); }
.mrow { display: flex; gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.mrow .body { flex: 1; }
.mrow.hidden .body { opacity: .4; text-decoration: line-through; }
.qrcard { text-align: center; }
.qrcard img { width: 14rem; background: #fff; padding: .5rem; border-radius: 10px; }
.mini-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: .15rem 0 .4rem; }
.mini-bar > div { height: 100%; background: var(--goldgrad); }

@media print {
  body { background: #fff; color: #000; }
  .admin header, .admin nav, .noprint { display: none !important; }
  .qrcard img { width: 10cm; }
}

/* ============================================================ red carpet */
/* A runner in perspective, behind the welcome ticket and the big screen's empty state. */
.join { position: relative; overflow-x: clip; }
.join, .screen .empty { isolation: isolate; }
.join::before, .screen .empty::before {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: 0; top: 18%;
  width: min(140vw, 120vh); transform: translateX(-50%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(90deg, var(--gold) 0 .6%, transparent .6% 99.4%, var(--gold) 99.4%),
    linear-gradient(180deg, #3a0a0f 0%, var(--red) 45%, var(--red-hi) 100%);
  opacity: .55;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%);
  mask-image: linear-gradient(180deg, transparent, #000 35%);
}
/* velvet rope accent under the guest header */
.guest header::after {
  content: ""; display: block; height: 3px; margin: .6rem auto 0; width: 9rem; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--red-hi) 20%, var(--red-hi) 80%, transparent);
}

/* ============================================================ invitation (/invite) */
.invite .join { padding: 2.5rem 1rem 3rem; }
.invite .ticket.invitation { max-width: 34rem; text-align: left; padding: 2rem 1.5rem 2.2rem; }
.invitation h1, .invitation .marquee, .invitation > .btn { text-align: center; }
.invitation h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); margin-bottom: 0; }
.invitation .marquee { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }
.invitation .marquee span { margin: 0 .4rem; }
.invitation p { margin: 0 0 1rem; }
.invitation strong { color: var(--gold-hi); font-weight: 600; }
.invitation em { font-family: var(--serif); font-style: italic; color: var(--gold-hi); }
.invitation h2.prog { font-size: 1.25rem; color: var(--gold); margin-top: 1.4rem; }
.invitation .programme { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .35rem; }
.invitation .programme li::before { content: "★"; color: var(--gold); margin-right: .6rem; }
.invitation .facts { margin: 0 0 1rem; display: grid; gap: .8rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.invitation .facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .8rem; }
.invitation .facts dt { color: var(--muted); font-size: .85rem; padding-top: .1rem; }
.invitation .facts dd { margin: 0; }
.invitation > .btn { display: flex; margin: 0 auto; max-width: 18rem; }
@media (max-width: 420px) {
  .invitation .facts div { grid-template-columns: 1fr; gap: .1rem; }
}
