:root {
  --blue: #1E5172; --deep: #163E58; --orange: #FC7B0B; --pale: #C7D4DC; --steel: #8FA8B9;
  --cream: #FFFDFA; --ink: #141414; --line: #DCE4E9; --muted: #567D95;
  --he: "Frank Ruhl Libre", serif; --ub: Unbounded, sans-serif; --ns: "Noto Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 16px/1.45 var(--ns); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.page { max-width: 640px; margin: 0 auto; padding: 0 16px 120px; }

.hero { display: flex; align-items: flex-end; gap: 8px; padding: 28px 0 18px; }
.hero-text { flex: 1; min-width: 0; }
.kicker { margin: 0 0 6px; color: var(--orange); font: 800 13px/1.2 var(--ns); letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 0 0 10px; color: var(--blue); font: 800 clamp(26px, 7.4vw, 40px)/1.08 var(--ub); }
.lede { margin: 0; color: #2c3e4a; }
.hero-img { width: 30%; max-width: 136px; height: auto; flex: none; }

.cta { display: grid; gap: 12px; margin: 4px 0 30px; }
.cta-btn {
  width: 100%; min-height: 84px; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 14px 10px 10px; border: 0; border-radius: 16px; color: #fff;
  box-shadow: 0 5px 0 var(--shade), 0 12px 22px rgba(22,62,88,.22); transition: transform .08s, box-shadow .08s;
}
.cta-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--shade), 0 4px 10px rgba(22,62,88,.2); }
.cta-btn.ready { --shade: #C25C00; background: var(--orange); }
.cta-btn.own { --shade: #0F2A3C; background: var(--blue); }
.cta-btn.own img { width: 40px; margin: 0 12px; }
.cta-btn.ready small { color: #FFE9D4; }
.cta-btn.ready i { background: #fff; color: var(--orange); }
.cta-btn img { width: 64px; height: auto; flex: none; }
.cta-btn span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cta-btn b { font: 600 17px/1.2 var(--ub); }
.cta-btn small { color: var(--pale); font-size: 14px; line-height: 1.3; margin-top: 4px; }
.cta-btn i {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; font: 800 20px/1 var(--ns);
}

h2 { margin: 0 0 4px; color: var(--blue); font: 600 18px/1.2 var(--ub); }

.sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
section { scroll-margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chip {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: center;
  padding: 8px 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.chip:active { transform: scale(.98); }
.chip .slip {
  display: flex; align-items: center; justify-content: center; height: 64px; margin-bottom: 8px;
  border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px #e6ebee, 0 2px 6px rgba(0,0,0,.08);
  font: 800 40px/1 var(--he); direction: rtl;
}
.chip .name { font: 600 14px/1.2 var(--ub); color: var(--blue); }
.chip .leader { margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.25; }
.chip .edge {
  position: absolute; top: -9px; right: 8px; padding: 2px 8px; border-radius: 99px;
  background: var(--orange); color: #fff; font: 800 11px/1.5 var(--ns); letter-spacing: .04em;
}
.chip .check {
  position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; display: grid; place-items: center;
  color: #fff; font: 800 14px/1 var(--ns);
}
.chip[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(252,123,11,.18); }
.chip[aria-pressed="true"] .check { background: var(--orange); border-color: var(--orange); }

.rest { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
.rest summary { cursor: pointer; color: var(--blue); font: 600 16px/1.3 var(--ub); padding: 6px 0 12px; }
.rest summary span { color: var(--muted); font: 400 14px var(--ns); }
.search {
  width: 100%; margin-bottom: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  font: inherit; background: #fff;
}
.search:focus { outline: none; border-color: var(--steel); }


.btn {
  padding: 12px 16px; border-radius: 12px; border: 2px solid var(--pale); background: #fff;
  color: var(--blue); font: 600 15px/1.2 var(--ns); white-space: nowrap;
}
.btn.primary { border-color: var(--orange); background: var(--orange); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--cream); padding-left: 0; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--blue); color: var(--cream); box-shadow: 0 -6px 20px rgba(0,0,0,.18);
}
.bar span { font-size: 14px; }

.viewer {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--deep);
}
.viewer-top { width: 100%; max-width: 640px; }
.card-img {
  width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 170px - env(safe-area-inset-bottom)); min-height: 0; -webkit-touch-callout: default;
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.hold { margin: -4px 0 0; color: var(--steel); font-size: 13px; text-align: center; }
.viewer-actions { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.viewer-actions .btn { flex: 1 1 auto; padding: 12px 10px; }
.toast {
  position: absolute; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  margin: 0; padding: 8px 14px; border-radius: 10px; background: var(--cream); color: var(--blue); font-size: 14px;
}

/* Режим «на участке»: только бумажки, максимально крупно */
.booth {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: #0f2a3c;
}
.booth-slips { flex: 1; min-height: 0; display: grid; gap: 14px; }
.booth-slip {
  min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; padding: 8px; overflow: hidden;
}
.booth-slip .l { font: 800 1em/1 var(--he); direction: rtl; color: #000; }
.booth-slip .n { margin-top: .5em; font: 600 clamp(13px, 3.6vw, 18px)/1.2 var(--ub); color: var(--blue); text-align: center; }
.booth-hint { margin: 10px 0 0; text-align: center; color: var(--steel); font-size: 13px; }

@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
