:root {
  --bg: #071226;
  --bg-2: #0c1d3b;
  --panel: rgba(16, 33, 66, 0.72);
  --panel-solid: #11244a;
  --line: rgba(166, 196, 255, 0.16);
  --line-strong: rgba(166, 196, 255, 0.3);
  --text: #f3f6ff;
  --muted: #a9b8d6;
  --gold: #f0c35e;
  --gold-2: #ffd98a;
  --gold-3: #b9832f;
  --red: #e23a50;
  --red-2: #ff5f6d;
  --green: #3fd49a;
  --blue: #6fb6ff;
  --danger: #ff6b7a;
  --radius: 22px;
  --radius-s: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --script: 'Lobster', 'Nunito', cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Колір, який видно, коли сторінку відтягують за край на телефоні */
  background: #071226;
  overscroll-behavior-y: none;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 16px/1.5 var(--font);
  color: var(--text);
  background: radial-gradient(120% 80% at 50% 0%, #17325f 0%, var(--bg-2) 38%, var(--bg) 100%) fixed;
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: var(--gold-2); }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(240, 195, 94, 0.35); }

/* Власний скролбар */
* { scrollbar-width: thin; scrollbar-color: rgba(166, 196, 255, 0.3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(166, 196, 255, 0.25); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

#scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Висота «великого» екрана: не змінюється, коли ховається адресний рядок */
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}
.sky-glow {
  position: fixed;
  inset: -20% -10% auto;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(78, 230, 176, 0.12), transparent 70%),
    radial-gradient(40% 50% at 80% 20%, rgba(143, 107, 255, 0.14), transparent 70%);
  filter: blur(20px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translateX(-4%) skewY(-2deg); opacity: 0.8; }
  to { transform: translateX(4%) skewY(2deg); opacity: 1; }
}

#app { position: relative; z-index: 1; }
#app.enter { animation: page-in 0.5s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

.page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ───── Заголовки ───── */
.hero { text-align: center; padding: 34px 4px 8px; }
.hero.compact { padding-top: 22px; }
.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-2);
  background: rgba(240, 195, 94, 0.1);
  border: 1px solid rgba(240, 195, 94, 0.25);
}
.title-script {
  margin: 0;
  font: 400 clamp(52px, 15vw, 92px)/1.02 var(--script);
  letter-spacing: 0.5px;
  background: linear-gradient(100deg, #fff3c9 0%, var(--gold-2) 30%, #e7a94a 50%, #fff3c9 62%, var(--gold-2) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(255, 200, 100, 0.25));
  overflow-wrap: anywhere;
}
.title-script.small { font-size: clamp(38px, 11vw, 60px); }

.lead { margin: 14px auto 0; max-width: 30em; color: #d7e1f6; font-size: 17px; }
h1, h2 { margin: 0; }
h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; }
h2 svg { color: var(--gold); flex: none; }

.reveal-up { animation: reveal-up 0.8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }

.hero-actions { margin-top: 24px; display: flex; justify-content: center; }

.how {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}
.how li {
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: rgba(16, 33, 66, 0.5);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.how-ico {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 22px;
  background: linear-gradient(145deg, rgba(240, 195, 94, 0.2), rgba(226, 58, 80, 0.15));
  animation: bob 3.2s ease-in-out infinite;
}
.how li:nth-child(2) .how-ico { animation-delay: -1s; }
.how li:nth-child(3) .how-ico { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.how small { color: var(--muted); font-size: 14px; }

/* ───── Панелі ───── */
.panel {
  position: relative;
  padding: 20px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(240, 195, 94, 0.45), transparent 35%, transparent 65%, rgba(111, 182, 255, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.center { text-align: center; align-items: center; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; }
.hint { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.note {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: #d7e1f6;
  background: rgba(111, 182, 255, 0.08);
  border: 1px solid rgba(111, 182, 255, 0.18);
}
.note svg { flex: none; margin-top: 3px; color: var(--blue); }

/* ───── Поля ───── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.field em, summary em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--muted); }
.in {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 14, 32, 0.55);
  color: var(--text);
  font: 600 16px/1.3 var(--font);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.in::placeholder { color: rgba(169, 184, 214, 0.6); font-weight: 500; }
.in:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(240, 195, 94, 0.15); background: rgba(6, 14, 32, 0.75); }
.in.bad { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 122, 0.15); }
.in.good { border-color: var(--green); }
textarea.in { resize: none; min-height: 96px; line-height: 1.45; }
select.in {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f0c35e' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-overflow: ellipsis;
}
input[type='date'].in { min-height: 50px; }
input[type='date']::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) saturate(4) hue-rotate(5deg); cursor: pointer; }
.in.pin { letter-spacing: 14px; text-align: center; font-size: 26px; font-weight: 800; }

/* ───── Кнопки ───── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--spring), box-shadow 0.25s, opacity 0.2s, background 0.2s;
  touch-action: manipulation;
  user-select: none;
  overflow: hidden;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #2a1600;
  background: linear-gradient(135deg, #ffe7a3 0%, var(--gold) 45%, #d9952f 100%);
  box-shadow: 0 10px 30px rgba(240, 160, 60, 0.35), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong); }
.btn-danger { color: #fff; background: rgba(255, 107, 122, 0.16); border: 1px solid rgba(255, 107, 122, 0.4); }
.btn-xl { min-height: 58px; padding: 14px 28px; font-size: 18px; border-radius: 18px; }
.wide { width: 100%; }
.shine::after {
  content: '';
  position: absolute;
  inset: -50% auto -50% -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-20deg);
  animation: shine 3.8s ease-in-out infinite;
}
/* Від -60% до 130% ширини кнопки: 190% / 40% власної ширини = 475% */
@keyframes shine { 0%, 55% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(475%) skewX(-20deg); } }
.btn.loading { pointer-events: none; }
.btn.loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(42, 22, 0, 0.25);
  border-top-color: #2a1600;
  animation: spin 0.8s linear infinite;
}
.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--spring);
  touch-action: manipulation;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn.solid { background: rgba(240, 195, 94, 0.16); color: var(--gold-2); border: 1px solid rgba(240, 195, 94, 0.3); }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--gold-2);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 4px;
  cursor: pointer;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 33, 66, 0.6);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s var(--spring), border-color 0.2s, background 0.2s;
}
.chip-btn svg { color: var(--gold); }
.chip-btn:active { transform: scale(0.95); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(240, 160, 60, 0.45), 0 1px 0 rgba(255, 255, 255, 0.6) inset; }
  .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
  .btn-danger:hover:not(:disabled) { background: rgba(255, 107, 122, 0.28); }
  .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
  .icon-btn.solid:hover { background: rgba(240, 195, 94, 0.28); }
  .chip-btn:hover { border-color: rgba(240, 195, 94, 0.5); background: rgba(240, 195, 94, 0.1); }
  .link-btn:hover { color: #fff; }
}

/* ───── Форма учасників ───── */
.form-head, .people-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.form-head h2 { font-size: 22px; }
.people { display: flex; flex-direction: column; gap: 10px; counter-reset: p; }
.person {
  display: grid;
  grid-template-columns: 30px 1fr 44px;
  gap: 8px;
  align-items: start;
  padding: 10px 6px 10px 10px;
  border-radius: 18px;
  background: rgba(6, 14, 32, 0.35);
  border: 1px solid var(--line);
  transition: opacity 0.22s, transform 0.22s var(--ease);
}
.person.enter { animation: person-in 0.45s var(--spring); }
@keyframes person-in { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
.person.leave { opacity: 0; transform: translateX(30px) scale(0.96); }
.person.shake, .shake { animation: shake 0.5s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.person-num {
  margin-top: 11px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #2a1600;
  background: linear-gradient(135deg, #ffe7a3, var(--gold));
}
.person-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.person .icon-btn { margin-top: 2px; }
.contact-wrap { position: relative; }
.contact-wrap .in { padding-left: 40px; min-height: 44px; font-size: 16px; }
.contact-wrap.big .in { min-height: 50px; font-size: 17px; }
.contact-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; transition: color 0.2s; }
.contact-wrap.ok .contact-ico { color: #4fb8ff; }
.contact-wrap.ok .in { border-color: rgba(79, 184, 255, 0.55); }
.contact-wrap.bad .in { border-color: var(--danger); }
.contact-wrap.bad .contact-ico { color: var(--danger); }
.contact-hint { min-height: 0; font-size: 12.5px; color: #8fd0ff; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-hint:empty { display: none; }
.contact-hint.bad { color: var(--danger); }
.add-person { border-style: dashed; }

details.extras, details.my-wish {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(6, 14, 32, 0.3);
  overflow: hidden;
}
details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2.5px solid var(--gold); border-bottom: 2.5px solid var(--gold); transform: rotate(45deg); transition: transform 0.3s var(--ease); }
details[open] > summary::after { transform: rotate(225deg); }
details > summary svg { color: var(--gold); flex: none; }
.extras-body { display: flex; flex-direction: column; gap: 18px; padding: 4px 16px 18px; animation: reveal-up 0.4s var(--ease); }
.my-wish { display: flex; flex-direction: column; }
.my-wish[open] { padding-bottom: 14px; }
.my-wish textarea, .my-wish .btn { margin: 0 14px; width: calc(100% - 28px); }
.my-wish .btn { margin-top: 10px; }
.budget { display: flex; gap: 8px; flex-wrap: wrap; }
.budget .in { flex: 1 1 140px; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(6, 14, 32, 0.55); border: 1px solid var(--line-strong); }
.seg button {
  min-width: 44px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  color: var(--muted);
}
.seg button[aria-checked='true'] { background: linear-gradient(135deg, #ffe7a3, var(--gold)); color: #2a1600; }
.excl-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.excl-pick > span { color: var(--gold); font-weight: 800; }

.excl-list { display: flex; flex-wrap: wrap; gap: 8px; }
.excl-list:empty { display: none; }
.excl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  background: rgba(226, 58, 80, 0.15);
  border: 1px solid rgba(226, 58, 80, 0.35);
  animation: person-in 0.35s var(--spring);
}
.excl-chip i { font-style: normal; color: var(--red-2); }
.excl-chip button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.summary { margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 14.5px; min-height: 22px; }

/* ───── Мої ігри ───── */
.my-games-list { display: flex; flex-direction: column; gap: 8px; }
.game-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(6, 14, 32, 0.4);
  border: 1px solid var(--line);
  transition: transform 0.25s var(--spring), border-color 0.2s;
}
.game-link small { color: var(--muted); grid-column: 1; }
.game-link .game-arrow { grid-row: 1 / 3; grid-column: 2; align-self: center; display: grid; place-items: center; color: var(--gold); transition: transform 0.25s var(--spring); }
.game-link b { grid-column: 1; }
.game-link:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .game-link:hover { border-color: rgba(240, 195, 94, 0.45); } .game-link:hover .game-arrow { transform: translateX(4px); } }

/* ───── Організатор ───── */
.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 8px;
  border: 0;
  border-radius: 12px;
  background: rgba(16, 33, 66, 0.55);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.admin-head { text-align: center; align-items: center; }
.admin-head .eyebrow { margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fact { padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.hero .facts { margin-top: 14px; }
.progress { width: 100%; height: 10px; border-radius: 99px; background: rgba(6, 14, 32, 0.6); overflow: hidden; border: 1px solid var(--line); }
.progress-bar {
  height: 100%;
  width: var(--p);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #8ef0c4, var(--gold));
  transform-origin: left;
  animation: grow 1.2s var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0); } }
.link-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  border-radius: 14px;
  background: rgba(6, 14, 32, 0.55);
  border: 1px dashed rgba(240, 195, 94, 0.4);
  font-weight: 700;
}
.link-box span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold-2); }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 12px;
  border-radius: 14px;
  background: rgba(6, 14, 32, 0.35);
  border: 1px solid var(--line);
  animation: reveal-up 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 40ms);
}
.status-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.status-main b { overflow-wrap: anywhere; }
.status-main small { color: var(--muted); font-size: 13px; }
.status-dot { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.status-row.ok .status-dot { background: rgba(63, 212, 154, 0.16); color: var(--green); }
.status-row.wait .status-dot { background: rgba(240, 195, 94, 0.14); color: var(--gold); }
.status-row.wait .status-dot svg { animation: tick 2.4s linear infinite; }
@keyframes tick { to { transform: rotate(360deg); } }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.row-actions .btn { flex: 1 1 160px; }

/* ───── Учасник: імена ───── */
.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; perspective: 900px; }
.name-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 58, 110, 0.75), rgba(12, 26, 54, 0.8));
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease), border-color 0.2s, opacity 0.2s;
  animation: tile-in 0.6s var(--spring) both;
  animation-delay: calc(var(--i) * 45ms);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(20px) rotateX(-30deg) scale(0.9); } }
.name-tile b { font-size: 17px; overflow-wrap: anywhere; transform: translateZ(20px); }
.name-tile small { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; transform: translateZ(14px); }
.name-tile-gift { font-size: 34px; transform: translateZ(34px); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); }
.name-tile.free .name-tile-gift { animation: wiggle 3s ease-in-out infinite; animation-delay: calc(var(--i) * -0.4s); }
@keyframes wiggle { 0%, 80%, 100% { transform: translateZ(34px) rotate(0); } 85% { transform: translateZ(34px) rotate(-12deg); } 90% { transform: translateZ(34px) rotate(10deg); } 95% { transform: translateZ(34px) rotate(-6deg); } }
.name-tile.free { border-color: rgba(240, 195, 94, 0.35); }
.name-tile.free small { color: var(--gold-2); }
.name-tile.tg, .name-tile.taken { opacity: 0.55; }
.name-tile.tg { cursor: default; }
.name-tile.mine { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 12px 40px rgba(63, 212, 154, 0.25); }
.name-tile.mine small { color: var(--green); }
.name-tile:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .name-tile.free:hover { border-color: var(--gold); } }

.claim-name { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 2px; }
.claim-name span { font-size: 34px; animation: wiggle 2.4s ease-in-out infinite; }
.claim-name b { font: 400 34px/1.1 var(--script); color: var(--gold-2); overflow-wrap: anywhere; }

/* ───── Картка ───── */
.card-page { gap: 14px; }
.card-stage { min-height: 520px; display: grid; place-items: center; }
.card-actions { gap: 12px; }
.whisper { margin: 0; font-weight: 700; color: var(--gold-2); }
.wish-box { padding: 14px 16px; border-radius: 16px; background: rgba(240, 195, 94, 0.08); border: 1px solid rgba(240, 195, 94, 0.3); }
.wish-box small { color: var(--gold); font-weight: 700; }
.wish-box p { margin: 4px 0 0; font-style: italic; font-size: 17px; overflow-wrap: anywhere; }

.reveal { position: relative; width: min(100%, 380px); aspect-ratio: 3 / 4; display: grid; place-items: center; perspective: 1100px; }
.reveal-rays {
  position: absolute;
  inset: -30%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 217, 138, 0.18) 0 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%);
  mask: radial-gradient(circle, #000 20%, transparent 62%);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.8s, transform 1.2s var(--ease);
  animation: tick 24s linear infinite;
}
.reveal.opened .reveal-rays { opacity: 1; transform: scale(1); }
.reveal-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: translateY(32%) scale(0.35);
  opacity: 0;
  transition: transform 1s var(--spring), opacity 0.4s;
}
.reveal.opened .reveal-card { transform: none; opacity: 1; transition-delay: 0.15s; }
.reveal-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.9s var(--ease); transform: rotateY(180deg); }
.reveal.flipped .reveal-card-inner { transform: rotateY(0); }
.reveal-back, .reveal-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(240, 195, 94, 0.35);
}
.reveal-front { object-fit: cover; }
.reveal-back {
  display: grid;
  place-items: center;
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 12px, transparent 12px 24px),
    linear-gradient(145deg, #c42a43, #7d0f26);
  font-size: 90px;
}
.reveal.instant * { transition: none !important; }

/* 3D-коробка */
.box3d { pointer-events: none; --s: 150px; position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(-32deg); z-index: 1; transition: opacity 0.5s 0.6s, transform 0.6s; }
.reveal.shake .box3d { animation: box-shake 1.1s ease-in-out; }
@keyframes box-shake {
  0%, 100% { transform: rotateX(-18deg) rotateY(-32deg); }
  15% { transform: rotateX(-18deg) rotateY(-24deg) translateY(-6px) rotateZ(-5deg); }
  30% { transform: rotateX(-18deg) rotateY(-40deg) translateY(0) rotateZ(5deg); }
  45% { transform: rotateX(-18deg) rotateY(-26deg) translateY(-8px) rotateZ(-6deg); }
  60% { transform: rotateX(-18deg) rotateY(-38deg) translateY(0) rotateZ(4deg); }
  80% { transform: rotateX(-18deg) rotateY(-30deg) translateY(-12px) scale(1.05); }
}
.reveal.opened .box3d { opacity: 0; transform: rotateX(-18deg) rotateY(-32deg) translateY(40px) scale(0.85); }
.box3d-body, .box3d-lid { position: absolute; inset: 0; transform-style: preserve-3d; }
.box3d i { position: absolute; display: block; }
.box3d-body i {
  width: var(--s);
  height: var(--s);
  background:
    linear-gradient(90deg, transparent 42%, #f3cf74 42% 58%, transparent 58%),
    linear-gradient(160deg, #ec4a5f, #a3172f);
  border-radius: 6px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
}
.box3d-body .f { transform: translateZ(calc(var(--s) / 2)); }
.box3d-body .b { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.box3d-body .l { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.8); }
.box3d-body .r { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.9); }
.box3d-lid { --l: calc(var(--s) * 1.12); top: calc(var(--s) * -0.16); left: calc(var(--s) * -0.06); width: var(--l); height: calc(var(--s) * 0.24); transition: transform 0.9s var(--ease); }
.box3d-lid i:not(.bow) {
  width: var(--l);
  height: calc(var(--s) * 0.24);
  background: linear-gradient(90deg, transparent 42%, #ffe08f 42% 58%, transparent 58%), linear-gradient(160deg, #ff5d72, #c2213c);
  border-radius: 6px;
}
.box3d-lid .f { transform: translateZ(calc(var(--l) / 2)); }
.box3d-lid .b { transform: rotateY(180deg) translateZ(calc(var(--l) / 2)); }
.box3d-lid .l { transform: rotateY(-90deg) translateZ(calc(var(--l) / 2)); filter: brightness(0.8); }
.box3d-lid .r { transform: rotateY(90deg) translateZ(calc(var(--l) / 2)); filter: brightness(0.9); }
.box3d-lid .t {
  height: var(--l) !important;
  transform: rotateX(90deg) translateZ(calc(var(--s) * 0.12));
  background:
    linear-gradient(90deg, transparent 42%, #ffe08f 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 42%, #ffe08f 42% 58%, transparent 58%),
    linear-gradient(160deg, #ff6a7e, #d02a45) !important;
}
.box3d-lid .bow {
  left: 50%;
  top: calc(var(--s) * -0.32);
  width: calc(var(--s) * 0.5);
  height: calc(var(--s) * 0.3);
  margin-left: calc(var(--s) * -0.25);
  transform: translateZ(calc(var(--l) / 2 - 10px));
  background:
    radial-gradient(ellipse 50% 60% at 25% 60%, #ffe08f 55%, transparent 58%),
    radial-gradient(ellipse 50% 60% at 75% 60%, #ffe08f 55%, transparent 58%);
}
.reveal.opened .box3d-lid { transform: translateY(-160px) rotateZ(-28deg) rotateX(30deg); }

/* ───── Розподіл ───── */
.draw-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: radial-gradient(60% 50% at 50% 45%, rgba(40, 70, 130, 0.65), rgba(4, 9, 22, 0.92));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s;
}
.draw-stage.show { opacity: 1; }
.draw-scene { position: relative; width: 140px; height: 190px; perspective: 1100px; }
.draw-ring { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-14deg); }
.draw-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, #1e3a6e, #0e2148);
  border: 1px solid rgba(240, 195, 94, 0.5);
  box-shadow: 0 0 30px rgba(240, 195, 94, 0.18);
  transform: rotateY(var(--a)) translateZ(var(--r));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.7s var(--ease), opacity 0.6s;
}
.draw-card b { font-size: 16px; overflow-wrap: anywhere; line-height: 1.2; }
.draw-card-face { font-size: 38px; }
.draw-stage.collapse .draw-card { transform: rotateY(var(--a)) translateZ(0) scale(0.2); opacity: 0; transition-delay: calc(var(--i) * 15ms); }
.draw-core { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.draw-gift { font-size: 20px; opacity: 0; transform: scale(0.2); transition: transform 0.8s var(--spring), opacity 0.4s; }
.draw-core-glow { position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 217, 138, 0.55), transparent 65%); opacity: 0; transform: scale(0.3); transition: transform 1s var(--ease), opacity 0.6s; }
.draw-stage.done .draw-gift { opacity: 1; transform: scale(5); animation: bob 1.6s ease-in-out infinite; }
.draw-stage.done .draw-core-glow { opacity: 1; transform: scale(1.2); }
.draw-status { margin: 0; padding: 0 20px; text-align: center; font: 400 28px/1.2 var(--script); color: var(--gold-2); min-height: 34px; animation: pulse 1.4s ease-in-out infinite; }
.draw-stage.done .draw-status { animation: none; }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (min-width: 700px) { .draw-scene { width: 160px; height: 210px; } }

/* ───── Нижні вікна ───── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(3, 8, 20, 0);
  transition: background 0.3s;
}
.sheet-overlay.open { background: rgba(3, 8, 20, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #16305e, #0d1f40);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(105%);
  transition: transform 0.38s var(--ease);
}
.sheet-overlay.open .sheet { transform: none; }
.sheet-overlay.closing .sheet { transform: translateY(105%); }
.sheet-grip { width: 100%; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grip::before { content: ''; width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line-strong); transform: translateY(30px) scale(0.96); opacity: 0; transition: transform 0.35s var(--spring), opacity 0.25s; }
  .sheet-overlay.open .sheet { opacity: 1; }
  .sheet-overlay.closing .sheet { transform: translateY(20px) scale(0.97); opacity: 0; }
  .sheet-grip { display: none; }
  .sheet-head { margin-top: 10px; }
}
.longpress-img { width: 100%; border-radius: 16px; -webkit-touch-callout: default; user-select: auto; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps-list svg { vertical-align: -3px; color: var(--blue); }

/* ───── Дрібниці ───── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: rgba(17, 36, 74, 0.95);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 140%);
  transition: transform 0.4s var(--spring);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(63, 212, 154, 0.55); }
.toast.error { border-color: rgba(255, 107, 122, 0.6); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 0; color: var(--muted); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(240, 195, 94, 0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 34px 20px; gap: 12px; }
.big-emoji { font-size: 64px; animation: bob 3s ease-in-out infinite; }
.foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 0; }
.foot-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.foot-note { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.foot-note a { color: var(--gold-2); }
.noscript { position: relative; z-index: 2; padding: 40px 20px; text-align: center; }

.css-snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.css-snow i { position: absolute; top: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(30px, 110vh, 0); } }

@media (min-width: 700px) {
  .page { padding-top: 34px; gap: 22px; }
  .panel { padding: 26px 26px; }
  .how { grid-template-columns: repeat(3, 1fr); }
  .how li { grid-template-columns: 1fr; text-align: center; justify-items: center; row-gap: 6px; }
  .how-ico { grid-row: auto; }
  .names { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .person { grid-template-columns: 24px 1fr 40px; padding-left: 8px; }
  .person-num { width: 22px; height: 22px; font-size: 12px; }
  .excl-pick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .excl-pick > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ───── Власний випадний список ───── */
.picker { position: relative; min-width: 0; }
.picker-btn {
  display: flex;
  align-items: center;
  text-align: left;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f0c35e' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-size: 16px;
}
.picker-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker.empty .picker-text { color: rgba(169, 184, 214, 0.7); font-weight: 600; }
.picker.open .picker-btn { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(240, 195, 94, 0.15); }
.picker-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 160px;
  max-height: 240px;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: #132a55;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top;
  transition: opacity 0.18s, transform 0.22s var(--ease);
}
.picker.up .picker-list { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; transform: translateY(6px) scale(0.98); }
.picker.open .picker-list { opacity: 1; transform: none; }
.picker-list li {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-list li.active, .picker-list li:active { background: rgba(240, 195, 94, 0.14); }
.picker-list li[aria-selected='true'] { color: var(--gold-2); }
.picker-list .picker-empty { color: var(--muted); cursor: default; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .picker-list li:not(.picker-empty):hover { background: rgba(240, 195, 94, 0.14); } }
.picker-list:empty { display: none; }

/* Довгі імена ніде не вилазять */
.excl-chip { max-width: 100%; }
.excl-names { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.excl-names b { min-width: 0; max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.game-link b, .status-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-link { min-width: 0; }
.status-main b { overflow-wrap: normal; }
.facts .fact { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-tile b { overflow-wrap: anywhere; word-break: break-word; }
.draw-card b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
details.extras { overflow: visible; }
.picker-list { width: max(100%, 230px); max-width: calc(100vw - 48px); }
.excl-pick [data-ex-b] .picker-list { left: auto; right: 0; }

/* Поля з шрифтом менше 16px iPhone наближає при натисканні, тому всюди 16 */
input, textarea, select, .in { font-size: max(16px, 1em); }
.in.pin { font-size: 26px; }

/* ───── Календар ───── */
.date-field { position: relative; display: flex; align-items: center; }
.date-btn { display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; padding-right: 48px; }
.date-btn svg { flex: none; color: var(--gold); }
.date-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-field.empty .date-text { color: rgba(169, 184, 214, 0.7); font-weight: 600; }
.date-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.date-clear[hidden] { display: none; }
.cal-sheet .sheet-body { gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font: 400 26px/1.1 var(--script); color: var(--gold-2); }
.cal-head .icon-btn:disabled { opacity: 0.25; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-week span { font-size: 13px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-week .weekend { color: var(--red-2); }
.cal-grid { min-height: 276px; align-content: start; }
.cal-grid.from-right { animation: cal-right 0.3s var(--ease); }
.cal-grid.from-left { animation: cal-left 0.3s var(--ease); }
@keyframes cal-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes cal-left { from { opacity: 0; transform: translateX(-24px); } }
.cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--spring), color 0.2s;
  touch-action: manipulation;
}
.cal-day:disabled { opacity: 0.22; cursor: default; background: transparent; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px rgba(111, 182, 255, 0.7); }
.cal-day.holiday:not(:disabled)::after { content: '✦'; position: absolute; top: 2px; right: 5px; font-size: 9px; color: var(--gold); }
.cal-day.on { background: linear-gradient(135deg, #ffe7a3, var(--gold)); color: #2a1600; transform: scale(1.06); box-shadow: 0 6px 18px rgba(240, 160, 60, 0.35); }
.cal-day.on::after { color: #2a1600 !important; }
.cal-day:not(:disabled):active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .cal-day:not(:disabled):not(.on):hover { background: rgba(240, 195, 94, 0.16); } }
.cal-quick { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
@media (min-width: 640px) { .cal-sheet { max-width: 420px; } }

/* ───── Акаунт ───── */
.account-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-height: 42px; }
.account-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 60vw; padding: 4px 12px 4px 4px; border-radius: 99px; background: rgba(16, 33, 66, 0.6); border: 1px solid var(--line); font-weight: 700; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #ffe7a3, var(--gold)); color: #2a1600; font-weight: 800; }
.g-btn svg { flex: none; background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
.claim-banner { border-color: rgba(240, 195, 94, 0.45); background: linear-gradient(160deg, rgba(240, 195, 94, 0.14), var(--panel)); }

/* ───── Сторінка гри ───── */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.small-btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badges:empty { display: none; }
.badge { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(111, 182, 255, 0.12); border: 1px solid rgba(111, 182, 255, 0.25); }
.badge.gift { background: rgba(63, 212, 154, 0.14); border-color: rgba(63, 212, 154, 0.4); color: #b8f5dc; }
.switch { position: relative; flex: none; width: 52px; height: 30px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.14); cursor: pointer; transition: background 0.25s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.3s var(--spring); }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(22px); }
.contact-wrap.need .in { border-color: rgba(240, 195, 94, 0.6); }
.contact-wrap.need .contact-ico { color: var(--gold); }
.legacy-games { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.legacy-row { display: flex; gap: 8px; align-items: stretch; }
.legacy-row .game-link { flex: 1; }
.legacy-row .btn { flex: none; }

/* ───── Додати учасників ───── */
.add-rows { display: flex; flex-direction: column; gap: 10px; }
.add-row { display: grid; grid-template-columns: 1fr 44px; gap: 6px; padding: 10px; border-radius: 16px; background: rgba(6, 14, 32, 0.35); border: 1px solid var(--line); }
.add-row > .in, .add-row > .contact-wrap, .add-row > .contact-hint { grid-column: 1; }
.add-row > .icon-btn { grid-column: 2; grid-row: 1; }
.modes { display: flex; flex-direction: column; gap: 8px; }
.mode-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 16px; text-align: left; background: rgba(6, 14, 32, 0.35); border: 1.5px solid var(--line); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.mode-card b { font-size: 15px; }
.mode-card b em { margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-style: normal; font-size: 11px; background: rgba(63, 212, 154, 0.18); color: #b8f5dc; }
.mode-card small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.mode-card.on { border-color: var(--gold); background: rgba(240, 195, 94, 0.1); }
.mode-card:disabled { opacity: 0.45; cursor: not-allowed; }
.confirm-box { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 6px 0; }
.confirm-box h3 { margin: 0; font-size: 20px; }

/* ───── Публічний статус ───── */
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.stat-tile b { font: 400 30px/1 var(--script); color: var(--gold-2); }
.stat-tile small { color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.status-table { display: flex; flex-direction: column; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; align-items: center; gap: 4px; padding: 10px 4px; border-bottom: 1px solid var(--line); animation: reveal-up 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.st-row:last-child { border-bottom: 0; }
.st-row > span:not(.st-name) { display: grid; place-items: center; }
.st-head { color: var(--muted); font-size: 15px; animation: none; }
.st-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-weight: 800; }
.mark.on { background: rgba(63, 212, 154, 0.2); color: var(--green); }

/* ───── Назва гри не обрізається знизу (хвостики літер Lobster) ───── */
.title-script { padding: 0.06em 0.24em 0.16em; margin: 0 -0.12em -0.06em; line-height: 1.12; }
.title-script.small { line-height: 1.15; }

/* ───── Організатор у формі ───── */
.person.org { border-color: rgba(240, 195, 94, 0.45); background: linear-gradient(160deg, rgba(240, 195, 94, 0.1), rgba(6, 14, 32, 0.35)); grid-template-columns: 30px 1fr; padding-right: 10px; }
.person.org .person-num { background: none; font-size: 18px; }
.org-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.org-head b { font-size: 15px; color: var(--gold-2); }
.org-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.org-note { font-size: 12.5px; }
.budget-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; flex: 1 1 220px; }
.budget-range > span { color: var(--muted); font-weight: 800; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg3 button { min-width: 0; padding: 0 6px; font-size: 14px; }

/* ───── Сторінка гри ───── */
.note.done { background: rgba(63, 212, 154, 0.1); border-color: rgba(63, 212, 154, 0.35); }
.note.warn { background: rgba(240, 195, 94, 0.1); border-color: rgba(240, 195, 94, 0.35); }
.note.warn svg { color: var(--gold); }
.note a { color: var(--gold-2); font-weight: 700; }
.center-note { justify-content: center; text-align: center; }
.org-panel p { margin: 0; overflow-wrap: anywhere; }
.pairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: pair; }
.pairs li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(6, 14, 32, 0.35); border: 1px solid var(--line); }
.pairs b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.pairs b:last-child { text-align: right; color: var(--gold-2); }
.pairs i { font-style: normal; color: var(--red-2); font-weight: 800; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(6, 14, 32, 0.35); border: 1px solid var(--line); cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); color: transparent; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.pick input:checked + .pick-box { background: var(--gold); border-color: var(--gold); color: #2a1600; }
.pick input:focus-visible + .pick-box { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.pick small { color: var(--muted); font-size: 12px; }
.pick.off { opacity: 0.5; cursor: not-allowed; }

/* Посилання на бота без підкреслення */
.how a, .note a, .lead a, .muted a { text-decoration: none; font-weight: 700; }

/* Організатор: я чи інша людина */
.org-who { margin-bottom: 10px; }
.p-email { margin-top: 8px; }

/* Попередження перед виправленням учасника */
.edit-warn { margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 196, 77, 0.12); border: 1px solid rgba(255, 196, 77, 0.35); color: #ffe7b0; font-size: 14px; line-height: 1.45; }
.edit-warn b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.edit-warn p { margin: 6px 0 0; }
