:root {
  --bg: #03080a;
  --panel: rgba(6, 14, 16, 0.76);
  --panel-2: rgba(255, 255, 255, 0.05);
  --line: rgba(140, 255, 232, 0.16);
  --text: #eef6f4;
  --muted: #94aba7;
  --accent: #2fe6c6;
  --accent-ink: #03201b;
  --green: #45e08c;
  --warn: #ffc35c;
  --err: #ff7f7f;
  --r: 18px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); }
body {
  min-height: 100vh;
  font-family: 'Montserrat', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* КВ турнира под тёмной вуалью; пока картинки нет, рисуются неоновые линии в его духе. */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(2, 6, 8, 0.55) 0%, rgba(2, 6, 8, 0.72) 55%, rgba(2, 6, 8, 0.9) 100%),
    url('/kv.jpg') center / cover no-repeat,
    radial-gradient(ellipse 80% 45% at 50% 100%, rgba(30, 200, 170, 0.28), transparent 70%),
    linear-gradient(90deg,
      transparent 0 6%, rgba(47, 230, 198, 0.7) 6.2%, transparent 6.5%,
      transparent 17%, rgba(69, 224, 140, 0.6) 17.2%, transparent 17.5%,
      transparent 29%, rgba(47, 230, 198, 0.75) 29.2%, transparent 29.5%,
      transparent 44%, rgba(47, 230, 198, 0.55) 44.2%, transparent 44.5%,
      transparent 55%, rgba(69, 224, 140, 0.65) 55.2%, transparent 55.5%,
      transparent 63%, rgba(47, 230, 198, 0.75) 63.2%, transparent 63.5%,
      transparent 71%, rgba(47, 230, 198, 0.6) 71.2%, transparent 71.5%,
      transparent 83%, rgba(69, 224, 140, 0.7) 83.2%, transparent 83.5%,
      transparent 94%, rgba(47, 230, 198, 0.5) 94.2%, transparent 94.5%),
    #02090b;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 22px 16px 48px; }
.top { padding: 4px 0 20px; }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { font-size: 30px; line-height: 1.1; margin: 6px 0 0; font-weight: 800; }
.muted { color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.step { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin: 4px 0 14px; }
.step-n {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.design {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 12px 12px;
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.2s, transform 0.2s;
}
.design:hover, .design:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.design .tag-svg { width: 100%; display: block; }
.design-name { font-size: 13px; font-weight: 700; margin-top: 10px; line-height: 1.25; }
.design:disabled { cursor: default; transform: none; border-color: var(--line); }
.design:disabled .tag-svg { opacity: 0.35; filter: grayscale(1); }
.design:disabled .design-name { color: var(--muted); }
.sold-out { font-size: 12px; font-weight: 700; color: var(--err); margin-top: 4px; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 16px 0 0; line-height: 1.45; }

.tag-svg { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); overflow: visible; }

.flip { perspective: 1400px; margin: 6px 4px 14px; cursor: pointer; }
.flip-inner {
  position: relative;
  aspect-ratio: 1100 / 512;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}
.flip.is-back .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face-back { transform: rotateY(180deg); }
.face .tag-svg { width: 100%; height: 100%; display: block; }

.sides { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.sides button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.sides button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.field {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}
.field:focus-within { border-color: var(--accent); }
.field input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: var(--text); font: 700 20px 'Montserrat', sans-serif;
  padding: 14px 0;
}
.field input::placeholder { color: rgba(238, 246, 244, 0.35); }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.full { color: var(--warn); }
.msg { min-height: 20px; font-size: 13px; line-height: 1.4; margin: 8px 2px 14px; color: var(--muted); }
.msg.err { color: var(--err); }
.msg.ok { color: var(--green); }

.btn {
  display: block; width: 100%;
  border: 0; border-radius: 14px; padding: 16px;
  font-size: 16px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
  cursor: pointer;
}
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.back-link { background: none; border: 0; color: var(--muted); padding: 0; margin: 0 0 12px; cursor: pointer; font-size: 14px; font-weight: 600; }
.back-link:hover { color: var(--text); }

.notice {
  border: 1px solid rgba(255, 195, 92, 0.45);
  background: rgba(255, 195, 92, 0.1);
  color: var(--warn);
  border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin-bottom: 14px;
}

.pill { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.new, .pill.work { background: rgba(255, 195, 92, 0.14); color: var(--warn); }
.pill.ready { background: rgba(69, 224, 140, 0.16); color: var(--green); }
.pill.given { background: var(--panel-2); color: var(--muted); }
.pill.cancelled { background: rgba(255, 127, 127, 0.12); color: var(--err); }

/* Заказы гостя на первом экране */
.my { margin-bottom: 22px; }
.my-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.my-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; text-align: left;
}
.my-row .tag-svg { width: 84px; flex: none; filter: none; }
.my-no { font-size: 22px; font-weight: 800; flex: none; }
.my-nick { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.limit-note { color: var(--muted); font-size: 14px; font-weight: 600; margin: -8px 2px 18px; }

/* Экран заказа */
.order-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 6px; }
.order-no { font-size: 40px; font-weight: 800; line-height: 1; }
.order-design { font-size: 13px; color: var(--muted); font-weight: 600; text-align: right; }
.status { border-radius: var(--r); padding: 18px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; }
.status-title { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.status-text { font-size: 15px; line-height: 1.45; margin-top: 6px; color: var(--muted); }
.status-text b { color: var(--text); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: none; }
.status.new .status-title, .status.work .status-title { color: var(--warn); }
.status.new .dot, .status.work .dot { animation: pulse 1.4s ease-in-out infinite; }
.status.ready { border-color: rgba(69, 224, 140, 0.6); background: rgba(10, 60, 36, 0.72); }
.status.ready .status-title { color: var(--green); }
.status.ready .status-text { color: #d6f5e3; }
.status.cancelled .status-title { color: var(--err); }
@keyframes pulse { 50% { opacity: 0.25; } }
