/* Афиша Констанца и Мамая. "Вечер у моря": песок, коралл и глубокая синева. */
:root {
  --bg: #f4efe6;
  --surface: #ffffff;
  --surface-2: #ebe4d6;
  --text: #1b2230;
  --muted: #6c7280;
  --line: #e2d9c8;
  --accent: #e4572e;
  --accent-soft: #fbe1d7;
  --on-accent: #ffffff;
  --sea: #1f4e79;
  --sea-soft: #dde8f2;
  --shadow: 0 1px 2px rgba(27, 34, 48, .06), 0 6px 18px rgba(27, 34, 48, .06);
  --radius: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1420;
  --surface: #172131;
  --surface-2: #1f2b3e;
  --text: #eef2f7;
  --muted: #95a3b8;
  --line: #263449;
  --accent: #ff7a50;
  --accent-soft: #3a2421;
  --on-accent: #1b0f0b;
  --sea: #8cc3f5;
  --sea-soft: #1c3047;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1420; --surface: #172131; --surface-2: #1f2b3e; --text: #eef2f7; --muted: #95a3b8;
    --line: #263449; --accent: #ff7a50; --accent-soft: #3a2421; --on-accent: #1b0f0b; --sea: #8cc3f5;
    --sea-soft: #1c3047; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Manrope, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 640px; margin: 0 auto; padding-bottom: 32px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- header --- */
.top { padding: 20px 16px 6px; }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
h1 {
  font-family: Unbounded, Manrope, sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.5px;
}
h1::after { content: "."; color: var(--accent); }
.sub { margin-top: 6px; color: var(--sea); font-weight: 600; letter-spacing: .3px; }
.channel {
  flex: none;
  margin-top: 2px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.search {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.search input::placeholder { color: var(--muted); }

/* --- filters --- */
.filters { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 4px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.chip .n { color: var(--muted); font-weight: 500; font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
#when .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chips.small .chip { height: 30px; font-size: 13px; padding: 0 12px; }

.count { padding: 6px 16px 0; color: var(--muted); font-size: 13px; }

/* --- day groups --- */
.day { padding: 0 16px; }
.day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 18px 2px 10px;
}
.day-head b { font-family: Unbounded, Manrope, sans-serif; font-weight: 500; font-size: 17px; }
.day-head span { color: var(--muted); font-size: 13px; }

/* --- cards --- */
.card {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .12s;
}
.card:active { transform: scale(.985); }
.thumb {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 34px;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.time { color: var(--accent); font-weight: 700; }
.card-title {
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.place { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
}
.tag.hot { background: var(--accent-soft); color: var(--accent); }
.tag.price { background: var(--surface-2); color: var(--text); }

/* --- empty / footer --- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.link-btn { margin-top: 14px; color: var(--accent); font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px 16px 0; }
.foot a { color: var(--sea); font-weight: 700; text-decoration: none; }

/* --- detail --- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow-y: auto;
  background: var(--bg);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail[hidden] { display: none; }
.detail > div { max-width: 640px; margin: 0 auto; padding-bottom: 40px; }
.back {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 21;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  backdrop-filter: blur(6px);
}
body.tg .back { display: none; } /* Telegram shows its own back button */
.poster {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 64px;
  overflow: hidden;
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-main { padding: 18px 16px 0; }
.d-title { font-family: Unbounded, Manrope, sans-serif; font-weight: 700; font-size: 20px; line-height: 1.25; }
.facts { margin-top: 16px; display: grid; gap: 10px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact .ic {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 17px;
}
.fact b { display: block; font-size: 15px; }
.fact span { color: var(--muted); font-size: 13px; }
.teaser { margin-top: 18px; font-size: 16px; line-height: 1.55; }
.actions { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  color: var(--text);
}
.act.main { grid-column: 1 / -1; background: var(--accent); color: var(--on-accent); box-shadow: none; }
.source { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.source a { color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
}
