:root {
  --bg: #07070b;
  --panel: #111118;
  --line: #2a2a36;
  --text: #f5f5f7;
  --muted: #a1a1b0;
  --pink: #ff2bd6;
  --blue: #22e6ff;
  --white: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(255, 43, 214, .18), transparent 60%),
    radial-gradient(600px 400px at 100% 30%, rgba(34, 230, 255, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap.wide { max-width: 1100px; }

.kicker {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--pink); font-weight: 700;
}
.neon {
  font-weight: 900; letter-spacing: .02em; line-height: 1; margin: 6px 0 4px;
  color: var(--white);
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px rgba(255, 43, 214, .6);
}
h1.neon { font-size: clamp(40px, 12vw, 64px); }
.neon-blue { color: var(--blue); text-shadow: 0 0 8px rgba(34, 230, 255, .8); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin: 16px 0;
}
.card.glow-pink { border-color: rgba(255, 43, 214, .55); box-shadow: 0 0 24px rgba(255, 43, 214, .18); }
.card.glow-blue { border-color: rgba(34, 230, 255, .55); box-shadow: 0 0 24px rgba(34, 230, 255, .15); }
.card.white { background: var(--white); color: #0b0b10; border-color: var(--white); }
.card.white .muted { color: #55556a; }
.card h2 { margin: 4px 0 8px; font-size: 22px; }
.stamp {
  display: inline-block; border: 2px solid var(--pink); color: var(--pink);
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800;
  letter-spacing: .15em; transform: rotate(-3deg);
}

.visit .name { font-size: 40px; font-weight: 900; margin: 6px 0 0; }
.visit .title { color: var(--blue); font-weight: 700; font-size: 18px; }
.visit .dept { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.visit dl { margin: 0; }
.visit dt { color: var(--pink); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-top: 12px; font-weight: 700; }
.visit dd { margin: 2px 0 0; }
.visit .threat { margin-top: 16px; color: var(--pink); font-weight: 800; }

input[type=text], input[type=password], textarea {
  width: 100%; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #0b0b12; color: var(--text);
  font-size: 17px; font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34, 230, 255, .2); }
textarea { min-height: 110px; resize: vertical; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 12px; padding: 14px 16px; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 800; letter-spacing: .02em; cursor: pointer;
  background: linear-gradient(90deg, var(--pink), #b14bff 50%, var(--blue));
  color: #fff; text-decoration: none;
}
button.ghost, .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.small { width: auto; padding: 8px 12px; font-size: 13px; margin-top: 8px; }
button:disabled { opacity: .5; cursor: progress; }

.status { margin-top: 10px; font-size: 14px; min-height: 1.4em; }
.status.ok { color: var(--blue); }
.status.err { color: #ff6b8a; }
.done { color: var(--blue); font-weight: 700; }

.secret {
  font-size: 20px; font-weight: 800; padding: 14px; border-radius: 12px;
  background: rgba(255, 43, 214, .08); border: 1px dashed var(--pink); margin: 10px 0;
}
.hidden { display: none !important; }

.photo-preview { width: 100%; border-radius: 12px; margin-top: 12px; display: block; }

.footer { text-align: center; margin-top: 28px; }

/* фото на визитке: досье в неоне */
.mugshot {
  position: relative; margin: -18px -18px 16px; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 18px 18px 0 0; background: #000;
  border-bottom: 3px solid var(--pink);
  box-shadow: 0 6px 24px rgba(255, 43, 214, .45);
}
@supports not (aspect-ratio: 1 / 1) {
  .mugshot { height: 0; padding-top: 100%; }
}
.mugshot img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  filter: grayscale(.5) contrast(1.15) brightness(1.08);
}
.mug-tint {
  position: absolute; inset: 0; mix-blend-mode: color; opacity: .7;
  background: linear-gradient(160deg, var(--blue) 0%, #7a3cff 45%, var(--pink) 100%);
}
.mug-lines {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .65) 100%);
}
.mug-id {
  position: absolute; left: 12px; top: 12px; padding: 4px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, .65); color: var(--blue); font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; border: 1px solid rgba(34, 230, 255, .6);
}
.mug-stamp {
  position: absolute; right: 12px; bottom: 18px; transform: rotate(-8deg);
  padding: 6px 12px; border: 3px solid #fff; border-radius: 8px;
  color: #fff; font-weight: 900; font-size: 18px; line-height: 1.05; text-transform: uppercase;
  letter-spacing: .06em; text-align: center; background: rgba(255, 43, 214, .35);
  text-shadow: 0 0 8px var(--pink), 0 0 18px var(--pink);
  box-shadow: 0 0 14px var(--pink), inset 0 0 10px rgba(255, 43, 214, .6);
}

/* пивной дневник */
.beer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.beer-slot {
  width: 100%; margin: 0; padding: 0; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  background: #0b0b12; border: 1px dashed rgba(34, 230, 255, .5); color: var(--blue);
}
.beer-slot.filled { border: 2px solid var(--blue); box-shadow: 0 0 10px rgba(34, 230, 255, .35); }
.beer-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.beer-num { font-size: 15px; line-height: 1.3; font-weight: 800; }
.beer-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; }
.beer-row:first-of-type { border-top: 0; }
.beer-row .who { width: 90px; flex: none; font-weight: 700; }
.beer-row .cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex: 1; }
.beer-row .cell { aspect-ratio: 1 / 1; border-radius: 8px; background: #0b0b12; border: 1px dashed var(--line); overflow: hidden; }
.beer-row .cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }

/* общая галерея */
/* праздничные эффекты */
h1.neon { animation: neon-on 1.4s ease-out both; }
@keyframes neon-on {
  0%, 18%, 22%, 30% { opacity: .15; text-shadow: none; }
  20%, 26%, 40%, 100% { opacity: 1; }
}
.party-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
.party-hello {
  position: fixed; inset: 0; z-index: 29; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(255, 43, 214, .35), rgba(7, 7, 11, .92) 70%);
  animation: hello-in .35s ease-out both;
}
.party-hello.out { animation: hello-out .6s ease-in both; }
.party-hello-inner { text-align: center; padding: 20px; animation: hello-pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.party-emoji { font-size: 72px; animation: hello-wiggle 1s ease-in-out infinite; }
.party-title {
  font-size: clamp(36px, 11vw, 64px); font-weight: 900; line-height: 1.05; color: #fff; margin-top: 8px;
  text-shadow: 0 0 8px var(--pink), 0 0 24px var(--pink), 0 0 48px var(--blue);
}
.party-sub { margin-top: 12px; color: var(--blue); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
@keyframes hello-in { from { opacity: 0; } }
@keyframes hello-out { to { opacity: 0; transform: scale(1.08); } }
@keyframes hello-pop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
@keyframes hello-wiggle { 50% { transform: rotate(12deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  h1.neon, .party-hello, .party-hello-inner, .party-emoji { animation: none; }
}

/* фейс-контроль при входе */
.quiz { margin-top: 12px; }
.quiz-q { font-weight: 800; font-size: 17px; margin: 0 0 4px; }
.quiz-opt { margin-top: 8px; text-align: left; justify-content: flex-start; font-weight: 600; }
.quiz-opt:active { border-color: var(--pink); }
.quiz-opt:disabled { opacity: .55; cursor: default; }
.quiz-opt.right { opacity: 1; border-color: var(--blue); color: var(--blue); box-shadow: 0 0 10px rgba(34, 230, 255, .35); }
.quiz-opt.wrong { opacity: 1; border-color: #ff6b8a; color: #ff6b8a; }
.quiz-step { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.quiz-note { margin: 10px 0 0; color: var(--text); }

/* секретная операция */
.card.mission { border: 2px dashed #ffd76a; box-shadow: 0 0 22px rgba(255, 215, 106, .18); }
.card.mission .stamp, .card.mission-target .stamp { border-color: #ffd76a; color: #ffd76a; }
.mission-remote { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(255, 215, 106, .08); border: 1px solid rgba(255, 215, 106, .4); }
.card.mission-target {
  border: 2px solid #ffd76a; box-shadow: 0 0 30px rgba(255, 215, 106, .35);
  animation: mission-pulse 1.6s ease-in-out infinite;
}
.card.mission-target .secret { border-color: #ffd76a; background: rgba(255, 215, 106, .08); }
@keyframes mission-pulse { 50% { box-shadow: 0 0 46px rgba(255, 43, 214, .55); } }

#lightbox { background: rgba(0, 0, 0, .97); }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.gallery-head h2 { margin: 0; font-size: 22px; }
.gallery-head button { margin: 0; }
.gallery-row { border-top: 1px solid var(--line); padding: 10px 0; }
.gallery-row:first-child { border-top: 0; padding-top: 0; }
.gallery-row .who { font-weight: 800; margin-bottom: 6px; }
.gallery-row .thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gallery-row .thumbs img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; border-radius: 8px;
  cursor: zoom-in; background: #000; border: 1px solid var(--line);
}

.card.game-closed { opacity: .75; border-style: dashed; }

/* премия */
.gold {
  color: #ffd76a;
  text-shadow: 0 0 10px rgba(255, 200, 80, .7), 0 0 28px rgba(255, 43, 214, .4);
}
.award { border-color: rgba(255, 215, 106, .6); box-shadow: 0 0 28px rgba(255, 200, 80, .18); }
.nomination { border-top: 1px solid var(--line); padding: 12px 0; }
.nom-title { font-weight: 800; font-size: 17px; }
.winner { font-size: 26px; font-weight: 900; color: #ffd76a; margin-top: 4px; text-shadow: 0 0 12px rgba(255, 200, 80, .6); }
select {
  width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; font-size: 16px;
  background: #0b0b12; color: var(--text); border: 1px solid var(--line); font-family: inherit;
}

/* admin */
.tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tabs button { width: auto; margin: 0; background: transparent; border: 1px solid var(--line); color: var(--text); }
.tabs button.active { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 43, 214, .35); }
.answer { border-top: 1px solid var(--line); padding: 14px 0; }
.answer:first-of-type { border-top: 0; }
.answer .text { font-size: 19px; }
.answer .who { color: var(--blue); font-weight: 800; margin-top: 6px; }
.num { color: var(--pink); font-weight: 800; margin-right: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; cursor: zoom-in; background: #000; }
.grid figcaption { padding: 10px; font-size: 13px; color: var(--muted); }
.guest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.guest-row:first-of-type { border-top: 0; }
.badges { font-size: 13px; color: var(--muted); }
.badges b { color: var(--blue); }
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 10; overflow: auto;
}
.modal .inner { max-width: 560px; width: 100%; }
.modal img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
