/* Suisse Intl (Swiss Typefaces): латиница + кириллица, сабсет в woff2 */
@font-face { font-family: 'Suisse Intl'; font-weight: 400; font-display: swap; src: url(fonts/suisse-400.woff2) format('woff2'); }
@font-face { font-family: 'Suisse Intl'; font-weight: 500; font-display: swap; src: url(fonts/suisse-500.woff2) format('woff2'); }
@font-face { font-family: 'Suisse Intl'; font-weight: 600; font-display: swap; src: url(fonts/suisse-600.woff2) format('woff2'); }
@font-face { font-family: 'Suisse Intl'; font-weight: 700; font-display: swap; src: url(fonts/suisse-700.woff2) format('woff2'); }

/* Строгая кинематографичная тема: тёмная ночь, один источник света (луна), холодный голубой акцент */
:root {
  --night: #02061a;
  --ink: #060f33;
  --surface: rgba(12, 28, 84, .38);
  --accent: #8fb8ff;
  --accent-deep: #4f8dff;
  --text: #eef3ff;
  --muted: rgba(238, 243, 255, .62);
  --faint: rgba(238, 243, 255, .4);
  --line: rgba(143, 184, 255, .18);
  --danger: #ff8a8a;
  --radius: 3px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Suisse Intl', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--night);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* микроподписи капсом с разрядкой — основной "строгий" элемент */
.label {
  font-size: 11px; font-weight: 600; line-height: 1.4;
  letter-spacing: .26em; text-transform: uppercase; color: var(--faint);
}
.label.accent { color: var(--accent); }
.brand { display: block; height: 30px; width: auto; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(100% 70% at 80% 18%, #0b2477 0%, #05123f 42%, var(--night) 100%); }
/* луна с ведьмой: кадр 1003×1376, центр луны примерно в (50%, 47%) */
.hero-art {
  position: absolute;
  top: -40px; right: -175px;
  width: 520px; aspect-ratio: 1003 / 1376;
  background: url(assets/witch-moon.jpg) center / cover no-repeat;
  -webkit-mask-image: radial-gradient(closest-side at 50% 47%, #000 52%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 47%, #000 52%, transparent 100%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 26, 0) 55%, var(--night) 100%),
    radial-gradient(80% 60% at 0% 100%, rgba(2, 6, 26, .85), rgba(2, 6, 26, 0));
  pointer-events: none;
}
.hero-in { position: relative; z-index: 1; min-height: 450px; padding-top: 24px; padding-bottom: 24px; display: flex; flex-direction: column; }
/* сверху: заголовок слева, логотип справа; внизу над вкладками — статус и таймер */
.topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.topline .brand { flex: none; margin-top: 6px; }
.hero h1 {
  margin: 0; font-size: clamp(38px, 11vw, 104px); line-height: .95; font-weight: 600;
  letter-spacing: -.025em;
  text-shadow: 0 2px 30px rgba(2, 6, 26, .7);
}
.status { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 24px; }
.status .big { font-size: 30px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; color: var(--accent); text-shadow: 0 0 22px rgba(79, 141, 255, .6); }
.status .state { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text); }
.status .clock {
  font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  color: var(--accent); text-shadow: 0 0 22px rgba(79, 141, 255, .7);
}
.status[hidden] { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-deep); animation: pulse 1.6s ease-in-out infinite; }
.dot.off { background: var(--faint); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
@media (min-width: 860px) {
  .hero-art { width: 800px; top: -150px; right: calc(50% - 760px); }
  .hero-in { min-height: 620px; padding-top: 48px; }
  .status .clock { font-size: 64px; }
  .status .big { font-size: 40px; }
}

/* ---------- кнопки ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--text); border-radius: var(--radius); padding: 14px 22px;
  background: var(--text); color: var(--night);
  font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.pill:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 24px rgba(79, 141, 255, .45); }
.pill:active { transform: translateY(1px); }
.pill:disabled { opacity: .35; cursor: default; box-shadow: none; transform: none; background: transparent; color: var(--muted); border-color: var(--line); }
.pill.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.pill.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; box-shadow: none; }
.pill.big { padding: 18px 28px; font-size: 13px; }
.pill.wide { width: 100%; }

/* ---------- вкладки ---------- */
.bar { position: sticky; top: 0; z-index: 5; background: rgba(2, 6, 26, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 28px; }
.tab {
  border: 0; background: none; padding: 18px 0 16px; margin-bottom: -1px;
  font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--faint); border-bottom: 2px solid transparent; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* main.wrap, чтобы .wrap не обнулял вертикальные отступы */
main.wrap { padding-top: 28px; padding-bottom: 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { margin: 8px 0 0; font-size: 30px; line-height: 1.05; font-weight: 600; letter-spacing: -.015em; }

/* ---------- карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

.card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s;
}
.card.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 44px rgba(79, 141, 255, .4); }
.card .photo { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; background: #0a1640; cursor: zoom-in; }
.card .num { position: absolute; top: 10px; right: 10px; color: var(--text); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 600; font-size: 16px; line-height: 1.25; letter-spacing: -.005em; overflow-wrap: anywhere; }
.card .costume { color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.card .actions { margin-top: auto; padding-top: 12px; }
.card .actions .pill { width: 100%; padding: 12px 10px; font-size: 11px; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 8px; border-radius: var(--radius);
  background: rgba(2, 6, 26, .78); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.badge.accent { background: var(--accent); color: var(--night); }
.linkbtn { border: 0; background: none; padding: 4px 0 0; color: var(--danger); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; text-align: left; }

.empty { padding: 64px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty h3 { margin: 12px 0 8px; color: var(--text); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.empty p { margin: 0 auto; max-width: 420px; line-height: 1.5; }

.notice { padding: 14px 18px; border-left: 2px solid var(--accent); background: rgba(143, 184, 255, .07); margin-bottom: 26px; line-height: 1.5; color: var(--muted); }
.notice b { color: var(--text); font-weight: 600; }

/* ---------- sheet (модалка) ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(1, 3, 14, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.overlay[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow: auto;
  background: var(--ink); border: 1px solid var(--line); border-bottom: 0; border-top: 2px solid var(--accent);
  border-radius: 6px 6px 0 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
  animation: up .25s ease;
}
@media (min-width: 600px) { .overlay { align-items: center; } .sheet { border-radius: 6px; border-bottom: 1px solid var(--line); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 8px 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.sheet .hint { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sheet .row { display: flex; gap: 10px; margin-top: 20px; }
.sheet .row .pill { flex: 1; }

.drop {
  position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
  aspect-ratio: 3 / 4; max-height: 46vh; margin: 0 auto 18px;
  border: 1px dashed rgba(143, 184, 255, .5); border-radius: var(--radius); background: rgba(143, 184, 255, .04);
  cursor: pointer; overflow: hidden; text-align: center;
}
.drop .plus { font-size: 34px; font-weight: 400; line-height: 1; color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop[hidden], .editor[hidden] { display: none; }

/* редактор фото (Cropper.js) */
.editor { margin-bottom: 18px; }
.editor-stage { height: min(48vh, 420px); border-radius: var(--radius); overflow: hidden; background: #030a24; }
.editor-stage img { display: block; max-width: 100%; }
.editor-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tool {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.tool[data-edit] { font-size: 17px; letter-spacing: 0; }
.tool[data-edit="reset"] { font-size: 11px; letter-spacing: .14em; }
.tool:active, .tool:hover { border-color: var(--accent); color: var(--accent); }
.tool input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor-tools label.tool { margin-left: auto; }
.editor-hint { margin: 10px 0 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.cropper-view-box { outline: 1px solid var(--accent); outline-color: var(--accent); }
.cropper-line, .cropper-point { background-color: var(--accent); }
/* маркеры рамки крупнее, чтобы попадать пальцем; scale сохраняет их центр */
.cropper-point { opacity: 1; border-radius: 50%; transform: scale(2.4); }
.cropper-point.point-se { width: 5px; height: 5px; }
.cropper-modal { background-color: #01030e; opacity: .7; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 8px; }
label.field input {
  width: 100%; padding: 14px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(238, 243, 255, .04); outline: none; font-size: 16px;
}
label.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(143, 184, 255, .12); }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 4px 0 0; }

.confirm-photo { width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); margin: 6px auto 16px; }
.center { text-align: center; }

.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(1, 3, 14, .94); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92vh; border-radius: var(--radius); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%);
  padding: 14px 22px; border-radius: var(--radius); background: var(--text); color: var(--night);
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); text-align: center;
}
.toast[hidden] { display: none; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 32px; }
