/* ===== Шрифты RF Dewi (как на shodka.fun) ===== */
@font-face {
  font-family: "RF Dewi"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/RFDewi-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "RF Dewi"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/RFDewi-Semibold.woff2") format("woff2");
}
@font-face {
  font-family: "RF Dewi"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/RFDewi-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "RF Dewi Expanded"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("/static/fonts/RFDewiExpanded-Black.woff2") format("woff2");
}

:root {
  --bg: #131316;
  --card: #25242a;
  --elev: #1c1b21;
  --text: #f3fdff;
  --muted: #908f99;
  --accent: #8cf55b;
  --accent-dark: #7ae84a;
  --accent-deep: #067644;
  --on-accent: #0f1410;
  --red: #ff6b6f;
  --amber: #f5b45a;
  --line: #37363d;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "RF Dewi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "RF Dewi Expanded", "RF Dewi", sans-serif;
  font-weight: 900;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

header.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(19, 19, 22, 0.88);
  backdrop-filter: blur(10px);
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
header.top .logo { height: 26px; width: auto; display: block; }
header.top h1 { margin: 0; font-size: 22px; }
header.top .sub { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ----- карточки событий (главный экран) ----- */
.event-card {
  display: flex; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.event-card:hover { border-color: #4a4953; }
.event-card:active { transform: scale(.99); }
.event-card .thumb {
  width: 116px; min-width: 116px; height: 116px;
  background: #1a191e center/cover no-repeat;
}
.event-card .thumb.empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: #4a4953;
}
.event-card .body { padding: 12px 14px 12px 0; flex: 1; min-width: 0; }
.event-card .date {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: capitalize;
}
.event-card .title {
  font-size: 17px; font-weight: 600; margin: 4px 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.event-card .meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.price { font-weight: 700; }
.seats {
  font-size: 13px; padding: 3px 10px; border-radius: 20px;
  background: rgba(140, 245, 91, .14); color: var(--accent); font-weight: 700;
}
.seats.few { background: rgba(245, 180, 90, .15); color: var(--amber); }
.seats.full { background: rgba(255, 107, 111, .15); color: var(--red); }

/* ----- экран события ----- */
.gallery { display: flex; gap: 8px; overflow-x: auto; border-radius: var(--radius); }
.gallery img {
  height: 240px; border-radius: var(--radius); object-fit: cover;
  scroll-snap-align: start;
}
.gallery.empty {
  height: 200px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: #4a4953;
}
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-top: 14px;
}
.panel h2 { margin: 0 0 6px; font-size: 24px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.desc { white-space: pre-wrap; line-height: 1.55; margin: 12px 0; color: #d8dde0; }
.names { list-style: none; padding: 0; margin: 8px 0 0; }
.names li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.names li:last-child { border: 0; }

/* ----- формы / кнопки ----- */
input, textarea, select {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #1a191e; color: var(--text); margin: 6px 0; font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #5d5c66; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { font-size: 13px; color: var(--muted); font-weight: 600; }
textarea { resize: vertical; min-height: 64px; }

.btn {
  display: inline-block; width: 100%; text-align: center;
  background: var(--accent); color: var(--on-accent); border: 0;
  padding: 14px; font-size: 16px; font-weight: 700;
  border-radius: 12px; cursor: pointer; transition: background .12s, transform .1s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(.99); }
.btn:disabled { background: #34333b; color: #6b6a74; cursor: not-allowed; }
.btn.secondary { background: #2f2e36; color: var(--text); }
.btn.secondary:hover { background: #3a3942; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(255,107,111,.4); }
.btn.danger:hover { background: rgba(255,107,111,.12); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #2f2e36; color: var(--text); padding: 12px 20px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 100; opacity: 0;
  border: 1px solid var(--line);
  transition: opacity .2s; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; }

.back { color: var(--muted); font-size: 14px; margin-bottom: 12px; display: inline-block; }
.back:hover { color: var(--text); }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ----- модалка ----- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line); width: 100%; max-width: 720px;
  border-radius: 20px 20px 0 0; padding: 20px;
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 600px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: 20px; }
}

/* ----- админка ----- */
.tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer; font-weight: 600; font-size: 14px;
}
.tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.adm-section { display: none; }
.adm-section.active { display: block; }
.list-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.notif-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-left: 6px;
}
.pill { font-size: 12px; background: #2f2e36; padding: 2px 8px; border-radius: 10px; color: var(--muted); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.thumb-wrap { position: relative; width: 76px; height: 76px; }
.thumb-wrap img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); display: block; }
.thumb-x {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  background: var(--red); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; border: 2px solid var(--bg); line-height: 1;
}
.thumb-loading {
  width: 76px; height: 76px; border-radius: 10px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details summary { color: var(--accent); cursor: pointer; }
