/* ==========================================================================
   КУДИ ЖРАТИ? — теплий, апетитний і трохи абсурдний інтерфейс
   ========================================================================== */

:root {
  --bg: #fff7ec;
  --bg-deep: #ffecd4;
  --surface: #ffffff;
  --ink: #2a1810;
  --ink-2: #6e5647;
  --ink-3: #a48e7f;
  --line: #f1e1ce;

  --tomato: #ff5230;
  --tomato-dark: #d6371a;
  --tomato-soft: #ffe6de;
  --mustard: #ffc53a;
  --mustard-dark: #dfa010;
  --mustard-soft: #fff1c9;
  --mustard-ink: #7a5200;
  --basil: #23884b;
  --basil-soft: #ddf2e4;
  --danger: #d8343b;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-sm: 0 1px 2px rgba(73, 38, 14, 0.06), 0 3px 10px rgba(73, 38, 14, 0.06);
  --shadow: 0 2px 6px rgba(73, 38, 14, 0.05), 0 14px 34px rgba(73, 38, 14, 0.1);
  --shadow-lg: 0 24px 64px rgba(42, 24, 16, 0.22);

  --font-display: 'Unbounded Variable', 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Manrope Variable', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --tabbar-h: 0px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html.has-modal {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 95% -8%, #ffe0bf 0%, transparent 60%),
    radial-gradient(900px 420px at -12% 6%, #ffefd8 0%, transparent 60%),
    var(--bg);
  padding-bottom: var(--tabbar-h);
}

img {
  max-width: 100%;
}
a {
  color: var(--tomato-dark);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
::selection {
  background: var(--mustard);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--tomato);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.15;
}
p {
  margin: 0;
}

.muted {
  color: var(--ink-2);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}
.mono {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
}
.section-gap {
  margin-top: 32px;
}

/* ---------- Типографіка ---------- */

.brand {
  position: relative;
  isolation: isolate;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(60px, 13vw, 150px);
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin: 18px 0 0;
}
.brand-line {
  display: block;
}
.brand-accent {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  color: var(--tomato);
}
.brand-accent::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -1.5%;
  right: 4%;
  bottom: 0.04em;
  height: 0.24em;
  border-radius: 0.1em;
  background: var(--mustard);
  transform: rotate(-1.5deg);
}
.brand-q {
  display: inline-block;
  transform-origin: 50% 85%;
  animation: wobble 3.2s ease-in-out infinite;
}

.h-page {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: -0.03em;
}
.h-section {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -0.02em;
}
.h-today {
  font-weight: 900;
  font-size: clamp(26px, 5vw, 44px);
  letter-spacing: -0.035em;
}
.mini-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tomato);
}
.lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-2);
  margin-top: 8px;
  max-width: 680px;
}

/* ---------- Каркас ---------- */

.view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 60vh;
}
@media (min-width: 700px) {
  .view {
    padding: 0 28px;
  }
}
.page-enter {
  animation: page-in 0.28s ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 247, 236, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(241, 225, 206, 0.8);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
@media (min-width: 700px) {
  .topbar-inner {
    padding: 0 28px;
  }
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo b {
  color: var(--tomato);
}
.logo-emoji {
  font-size: 22px;
  display: inline-block;
  transition: transform 0.3s;
}
.logo:hover .logo-emoji {
  transform: rotate(-20deg) scale(1.15);
}
.topnav {
  display: flex;
  gap: 2px;
  margin: 0 auto;
}
.topnav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover {
  background: var(--bg-deep);
  color: var(--ink);
}
.topnav a[aria-current] {
  background: var(--ink);
  color: #fff;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.me-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  max-width: 200px;
}
.me-chip[aria-current] {
  border-color: var(--tomato);
}
.me-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabbar {
  display: none;
}
.footer {
  text-align: center;
  padding: 48px 16px 28px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 899px) {
  body {
    --tabbar-h: calc(78px + env(safe-area-inset-bottom));
  }
  .topnav,
  .topbar .topbar-upload {
    display: none;
  }
  .topbar-inner {
    height: 56px;
  }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(73, 38, 14, 0.07);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 0 4px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
  }
  .tab-ico {
    font-size: 22px;
    line-height: 1.1;
    filter: grayscale(0.7);
    opacity: 0.75;
    transition: transform 0.2s, filter 0.2s;
  }
  .tabbar a[aria-current] {
    color: var(--ink);
  }
  .tabbar a[aria-current] .tab-ico {
    filter: none;
    opacity: 1;
    transform: scale(1.12);
  }
  .tab-fab {
    justify-self: center;
    width: 62px;
    height: 62px;
    margin-top: -28px;
    margin-bottom: 4px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: var(--tomato);
    box-shadow: 0 5px 0 var(--tomato-dark), 0 12px 26px rgba(255, 82, 48, 0.42);
    font-size: 26px;
    cursor: pointer;
    transition: transform 0.12s;
  }
  .tab-fab:active {
    transform: translateY(3px);
  }
}
@media (max-width: 480px) {
  .me-name {
    display: none;
  }
  .me-chip {
    padding: 3px;
  }
}
.is-guest .topbar,
.is-guest .tabbar {
  display: none;
}
.is-guest {
  --tabbar-h: 0px !important;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s, border-color 0.2s, color 0.2s;
  position: relative;
  user-select: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--tomato);
  color: #fff;
  box-shadow: 0 4px 0 var(--tomato-dark), 0 8px 20px rgba(255, 82, 48, 0.26);
}
.btn-primary:hover:not(:disabled) {
  background: #ff6443;
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--tomato-dark), 0 3px 8px rgba(255, 82, 48, 0.2);
}
.btn-dark {
  background: var(--ink);
  color: #fff7ec;
  box-shadow: 0 4px 0 #000, 0 8px 20px rgba(42, 24, 16, 0.22);
}
.btn-dark:hover:not(:disabled) {
  background: #3b2519;
  transform: translateY(-1px);
}
.btn-dark:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000;
}
.btn-mustard {
  background: var(--mustard);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--mustard-dark), 0 8px 20px rgba(223, 160, 16, 0.3);
}
.btn-mustard:hover:not(:disabled) {
  background: #ffcd52;
  transform: translateY(-1px);
}
.btn-mustard:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--mustard-dark);
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  padding: 10px 18px;
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--ink-3);
}
.btn-text {
  background: transparent;
  color: var(--ink-2);
  padding: 10px 12px;
}
.btn-text:hover:not(:disabled) {
  color: var(--ink);
  text-decoration: underline;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 0 #a8242a;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 12.5px;
}
.btn-ghost.btn-sm {
  padding: 6px 12px;
}
.btn-lg {
  padding: 15px 24px;
  font-size: 15px;
}
.btn-ghost.btn-lg {
  padding: 13px 22px;
}
.btn-xl {
  padding: 19px 30px;
  font-size: 17px;
}
.btn-block {
  width: 100%;
}
@media (max-width: 520px) {
  /* довгі кнопки на телефоні переносяться, а не розпирають сторінку */
  .btn-lg,
  .btn-xl {
    white-space: normal;
    text-align: center;
  }
}
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after {
  border-color: var(--line);
  border-top-color: var(--ink);
}
.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--line);
}
.link-more {
  font-weight: 800;
  color: var(--tomato-dark);
  text-decoration: none;
}
.link-more:hover {
  text-decoration: underline;
}

/* ---------- Базові елементи ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(42, 24, 16, 0.04);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-deep);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.chip-btn {
  background: #fff;
  border: 2px solid var(--line);
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.chip-btn:hover {
  border-color: var(--ink-3);
}
.chip-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--bg-deep);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge-ok {
  background: var(--basil-soft);
  color: var(--basil);
}
.badge-miss {
  background: #f4ece6;
}
.badge-mustard {
  background: var(--mustard-soft);
  color: var(--mustard-ink);
}

.sticker {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--mustard);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  transform: rotate(4deg);
}
.sticker-mine {
  background: var(--tomato);
  color: #fff;
  animation: pop-in 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.sticker-muted {
  background: var(--ink);
  color: #fff;
}
.sticker-tilt {
  transform: rotate(-4deg);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill-live {
  background: var(--basil-soft);
  color: var(--basil);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-out infinite;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tomato);
  transition: width 0.6s cubic-bezier(0.3, 1.2, 0.5, 1);
}
.bar-win i {
  background: linear-gradient(90deg, var(--mustard), var(--tomato));
}

/* Аватари */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-deep);
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  user-select: none;
}
.avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 17px;
}
.avatar-md {
  width: 44px;
  height: 44px;
  font-size: 22px;
}
.avatar-lg {
  width: 68px;
  height: 68px;
  font-size: 34px;
}
.avatar-xl {
  width: 116px;
  height: 116px;
  font-size: 60px;
  box-shadow: 0 0 0 5px #fff, var(--shadow);
}
.av-0 { background: #ffd9c7; }
.av-1 { background: #ffeeb3; }
.av-2 { background: #cdeed7; }
.av-3 { background: #ffd3dc; }
.av-4 { background: #e2d8ff; }
.av-5 { background: #c9ece7; }
.av-ghost { background: var(--line); color: var(--ink-3); }
.avatar-stack {
  display: inline-flex;
  vertical-align: middle;
}
.avatar-stack .avatar + .avatar {
  margin-left: -6px;
}

/* Медіа закладу */
.media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-ph {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-ph::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.34) 2px, transparent 2.6px);
  background-size: 18px 18px;
}
.media-ph span {
  position: relative;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1;
  transform: rotate(-8deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.16));
}
.ph-0 { background: linear-gradient(135deg, #ff7a50, #ffc53a); }
.ph-1 { background: linear-gradient(135deg, #ffc53a, #ffa37a); }
.ph-2 { background: linear-gradient(135deg, #7fcf98, #ffd66b); }
.ph-3 { background: linear-gradient(135deg, #ff95ab, #ff6a45); }
.ph-4 { background: linear-gradient(135deg, #b9a2ff, #ff9fb4); }
.ph-5 { background: linear-gradient(135deg, #7fd3c8, #fff0b8); }

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 2px;
  align-content: start;
}
.stat-emoji {
  font-size: 26px;
  line-height: 1.2;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.stat-value-long {
  font-size: 15px;
  line-height: 1.25;
}
.stat-hint {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--mustard-soft);
  color: var(--mustard-ink);
  font-weight: 800;
  font-size: 13px;
  width: fit-content;
}
.title-badge-lg {
  font-size: 15px;
  padding: 7px 14px;
}

/* Порожні стани, завантаження */
.empty {
  text-align: center;
  padding: 48px 16px;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.empty-emoji {
  font-size: 64px;
  line-height: 1.1;
  animation: float 5s ease-in-out infinite;
}
.empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 3vw, 22px);
  max-width: 520px;
}
.empty-text {
  color: var(--ink-2);
  max-width: 440px;
}
.empty .btn {
  margin-top: 8px;
}
.loading {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 100px 0;
  color: var(--ink-2);
  font-weight: 700;
}
.loading-emoji {
  font-size: 48px;
  animation: wobble 1s ease-in-out infinite;
}

/* ---------- Заголовки сторінок / секції ---------- */

.page-head {
  padding: 28px 0 18px;
}
.page-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.back {
  display: inline-block;
  margin: 18px 0 4px;
  color: var(--ink-2);
  font-weight: 800;
  text-decoration: none;
}
.page-head .back {
  margin: 0 0 10px;
}
.back:hover {
  color: var(--ink);
}
.section {
  margin: 40px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.load-more {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

/* ---------- Головна: hero ---------- */

.hero {
  position: relative;
  padding: 30px 0 12px;
}
.hero > *:not(.hero-deco) {
  position: relative;
  z-index: 1;
}
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-deco span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: clamp(30px, 5vw, 58px);
  animation: float 7s ease-in-out infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 8px 12px rgba(73, 38, 14, 0.12));
}
@media (max-width: 699px) {
  .hero-deco span {
    opacity: 0.4;
  }
  .hero-deco span:nth-child(n + 4) {
    display: none;
  }
}
.hero-date {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}
.hero-sub {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 800;
  max-width: 640px;
  margin: 18px 0 6px;
  letter-spacing: -0.01em;
}
.hero-tagline {
  color: var(--ink-2);
  font-style: italic;
  margin-bottom: 22px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 520px) {
  .hero-actions .btn {
    flex: 1 1 100%;
    white-space: normal;
    text-align: center;
  }
}

/* ---------- Голосування ---------- */

.poll {
  padding: 20px;
  margin-bottom: 20px;
}
@media (min-width: 700px) {
  .poll {
    padding: 28px;
  }
}
.poll-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.poll-head-main {
  display: grid;
  gap: 8px;
  flex: 1 1 320px;
  align-content: start;
  justify-items: start;
}
.poll-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 30px);
  letter-spacing: -0.025em;
}
.timer-box {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  padding: 12px 22px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff7ec;
  min-width: 170px;
  flex: 0 0 auto;
}
.timer-label,
.timer-at {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.timer {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.timer.is-urgent {
  color: var(--mustard);
  animation: throb 1s ease-in-out infinite;
}
@media (max-width: 520px) {
  .timer-box {
    width: 100%;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 16px;
  }
  .timer {
    font-size: 24px;
    justify-self: center;
  }
}

.voted-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  background: var(--basil-soft);
  border: 2px dashed rgba(35, 136, 75, 0.35);
  animation: pop-in 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
.voted-banner b {
  display: block;
  color: var(--basil);
}
.voted-banner span {
  color: var(--ink-2);
  font-weight: 600;
}
.voted-emoji {
  font-size: 32px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.option {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: #fff;
  border: 2px solid var(--line);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
}
.option:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.option.is-mine {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px var(--tomato-soft), var(--shadow);
}
.option.is-dim {
  opacity: 0.72;
}
.option-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-deep);
}
.option-chips {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.option-chips .chip {
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.option-media .sticker,
.place-card-media .sticker {
  position: absolute;
  top: 10px;
  right: 10px;
}
.option-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
  flex: 1;
}
.option-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.option-name a {
  color: inherit;
  text-decoration: none;
}
.option-name a:hover {
  color: var(--tomato-dark);
}
.option-desc {
  font-size: 14px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.option-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
}
.option-votes {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.option-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.option-count b {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  margin-right: 2px;
}

.poll-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 2px dashed var(--line);
}
.voters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.voter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
}
.voter-name {
  font-weight: 800;
}
.voter-status {
  color: var(--ink-3);
  font-weight: 600;
}
.voter.is-done .voter-status {
  color: var(--basil);
}
.poll-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Результат */
.result {
  overflow: hidden;
  margin-bottom: 20px;
}
.result-media {
  position: relative;
  aspect-ratio: 21 / 9;
  background: var(--bg-deep);
}
@media (max-width: 699px) {
  .result-media {
    aspect-ratio: 4 / 3.4;
  }
}
.result-media .media-ph span {
  font-size: clamp(90px, 16vw, 170px);
  transform: rotate(-10deg) translate(20%, -12%);
}
.result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(to top, rgba(24, 12, 6, 0.82) 0%, rgba(24, 12, 6, 0.25) 55%, transparent 80%);
}
@media (min-width: 700px) {
  .result-overlay {
    padding: 32px;
  }
}
.result-eyebrow {
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--mustard);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(12px, 1.8vw, 15px);
  letter-spacing: 0.02em;
  transform: rotate(-2deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.result-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  overflow-wrap: anywhere;
}
.result-name a {
  color: inherit;
  text-decoration: none;
}
.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-meta .chip,
.chip-glass {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.result-body {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 700px) {
  .result-body {
    padding: 28px 32px 32px;
  }
}
.result-joke {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 800;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 520px) {
  .result-actions .btn {
    flex: 1 1 100%;
  }
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 18px;
  border-top: 2px dashed var(--line);
}
@media (min-width: 820px) {
  .result-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.breakdown,
.hist-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.bd-row,
.hr-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(50px, 1.6fr) 22px 56px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.bd-name,
.hr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.is-winner .bd-name,
.is-winner .hr-name {
  font-weight: 800;
}
.bd-count,
.hr-count {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}

/* Нічия */
.tie {
  text-align: center;
  padding: 32px 20px;
  margin-bottom: 20px;
  display: grid;
  justify-items: center;
  gap: 12px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(255, 197, 58, 0.1) 18px 36px),
    #fff;
  border: 2px dashed var(--mustard);
}
.tie-emoji {
  font-size: 68px;
  line-height: 1.1;
  animation: wobble 2s ease-in-out infinite;
}
.tie-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: -0.025em;
  max-width: 640px;
}
.tie-contenders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 10px 0 16px;
}
.tie-item {
  width: 150px;
  display: grid;
  gap: 8px;
  font-weight: 800;
}
.tie-media {
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tie-vs {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--tomato);
  transform: rotate(-8deg);
}

.today-empty {
  text-align: center;
  padding: 44px 20px;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.today-empty h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 3.4vw, 28px);
  letter-spacing: -0.02em;
}
.today-empty-emoji {
  font-size: 76px;
  line-height: 1.1;
  animation: float 5s ease-in-out infinite;
}
.today-empty .btn {
  margin: 8px 0;
}

/* Свіжі фото */
.recent {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 200px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}
.recent-item {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
  background: var(--bg-deep);
}
.recent-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.recent-item:hover img {
  transform: scale(1.05);
}
.recent-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 12px 10px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-align: left;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.strip-item {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  background: var(--bg-deep);
  box-shadow: var(--shadow-sm);
}
.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.strip-more {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-deep);
  font-weight: 800;
}

/* ---------- Нове голосування ---------- */

.newpoll {
  display: grid;
  gap: 16px;
  max-width: 900px;
}
.form-card {
  padding: 22px;
  display: grid;
  gap: 14px;
}
@media (min-width: 700px) {
  .form-card {
    padding: 28px;
  }
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.step:not(:first-child) {
  margin-top: 8px;
}
.step-n {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tomato);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.step-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.counter {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-deep);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.counter.is-ok {
  background: var(--basil-soft);
  color: var(--basil);
}
.time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.time-input {
  width: auto;
  font-family: var(--font-display) !important;
  font-weight: 700;
  font-size: 22px !important;
  padding: 8px 14px !important;
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.pick-empty {
  grid-column: 1 / -1;
}
.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.pick:hover {
  border-color: var(--ink-3);
}
.pick:active {
  transform: scale(0.98);
}
.pick.is-on {
  border-color: var(--tomato);
  background: var(--tomato-soft);
}
.pick-media {
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
}
.pick-media .media-ph span {
  font-size: 30px;
}
.pick-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.pick-name,
.pick-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-name {
  font-weight: 800;
}
.pick-meta {
  font-size: 13px;
  color: var(--ink-2);
}
.pick-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tomato);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.pick.is-on .pick-check {
  transform: scale(1);
}
.pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.submit-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 12px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(255, 247, 236, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.submit-bar .form-error {
  flex: 1 1 240px;
}
@media (max-width: 520px) {
  .submit-bar {
    padding: 8px;
  }
  .submit-bar .btn {
    flex: 1 1 100%;
    padding: 15px 18px;
    font-size: 15px;
  }
}

/* ---------- Форми ---------- */

.form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
input:not([type='radio']):not([type='checkbox']):not([type='file']),
select,
textarea {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px var(--tomato-soft);
}
input::placeholder,
textarea::placeholder {
  color: #c2ad9d;
}
.select-sm {
  width: auto !important;
  padding: 9px 12px !important;
  font-size: 15px !important;
  font-weight: 700;
}
.hint {
  font-size: 14px;
  color: var(--ink-2);
}
.form-error {
  color: var(--danger);
  font-weight: 700;
}
.form-error:empty {
  display: none;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--mustard-soft);
  font-weight: 700;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--bg-deep);
  width: fit-content;
}
.seg label,
.seg button {
  display: flex;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg span,
.seg button {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  border: 0;
  background: transparent;
  transition: background 0.15s, box-shadow 0.15s;
}
.seg input:checked + span,
.seg button[aria-selected='true'] {
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.seg input:focus-visible + span {
  outline: 3px solid var(--tomato);
}
.seg-wide {
  display: flex;
  width: 100%;
}
.seg-wide button {
  flex: 1;
  justify-content: center;
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.emoji-btn {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.emoji-btn:hover {
  transform: scale(1.1);
}
.emoji-btn.is-on {
  border-color: var(--tomato);
  background: var(--tomato-soft);
}

.photo-pick,
.avatar-edit {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.photo-pick-preview {
  width: 150px;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  flex: none;
  background: var(--bg-deep);
}
.photo-pick-preview .media-ph span {
  font-size: 44px;
}
.photo-pick-actions {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.dropzone {
  display: grid;
  place-items: center;
  padding: 30px 16px;
  border: 2.5px dashed #e8cfb3;
  border-radius: var(--r-lg);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.is-over {
  border-color: var(--tomato);
  background: var(--tomato-soft);
}
.dropzone.has-files {
  padding: 14px;
}
.dropzone-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
}
.dropzone-emoji {
  font-size: 42px;
  line-height: 1.1;
}
.has-files .dropzone-emoji {
  display: none;
}
.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.previews:empty {
  display: none;
}
.preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  animation: pop-in 0.25s ease both;
}
.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.progress {
  position: relative;
  height: 36px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
}
.progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--mustard);
  transition: width 0.3s;
}
.progress span {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
}
.pw-details summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 10px;
}
.confirm-text {
  margin-bottom: 20px;
  color: var(--ink-2);
  font-size: 17px;
}

/* ---------- Модалки ---------- */

dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: min(600px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: visible;
  color: var(--ink);
}
dialog.modal-sm {
  max-width: min(440px, calc(100vw - 32px));
}
dialog::backdrop {
  background: rgba(42, 24, 16, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
.is-closing .modal-inner {
  animation: modal-out 0.18s ease forwards;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 10px;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.modal-body {
  padding: 8px 22px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-width: 599px) {
  dialog.modal,
  dialog.modal-sm {
    margin: auto 0 0;
    max-width: 100vw;
    width: 100vw;
    max-height: 94dvh;
  }
  .modal-inner {
    max-height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation-name: sheet-in;
  }
  .is-closing .modal-inner {
    animation-name: sheet-out;
  }
}

/* ---------- Лайтбокс ---------- */

dialog.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  background: rgba(16, 9, 5, 0.96);
  color: #fff;
}
dialog.lightbox[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}
dialog.lightbox::backdrop {
  background: rgba(16, 9, 5, 0.9);
}
.lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 16px;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  object-fit: contain;
  border-radius: 10px;
  animation: pop-in 0.25s ease both;
}
.lb-nav,
.lb-close {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.lb-nav:hover,
.lb-close:hover {
  background: rgba(255, 255, 255, 0.26);
}
.lb-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  font-size: 34px;
  line-height: 1;
  padding-bottom: 4px;
}
.lb-prev {
  left: 16px;
}
.lb-next {
  right: 16px;
}
.lb-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  font-size: 16px;
}
.lb-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 13px;
  opacity: 0.7;
}
.lb-info {
  background: #1f130c;
  padding: 28px 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lb-dish {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.lb-dish.muted {
  color: rgba(255, 255, 255, 0.5);
}
.lb-place {
  color: var(--mustard);
  font-weight: 800;
  text-decoration: none;
}
.lb-caption {
  font-size: 17px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.88);
}
.lb-author {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.lb-date {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}
.lb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}
.lb-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
@media (max-width: 899px) {
  dialog.lightbox[open] {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .lb-img {
    max-height: calc(62dvh);
  }
  .lb-info {
    max-height: 38dvh;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .lb-dish {
    font-size: 19px;
  }
  .lb-nav {
    width: 42px;
    height: 42px;
    margin-top: -21px;
    font-size: 28px;
  }
  .lb-prev {
    left: 8px;
  }
  .lb-next {
    right: 8px;
  }
  .lb-actions {
    margin-top: 4px;
  }
}

/* ---------- Тости / ефекти ---------- */

/* .toasts — popover: скидаємо UA-стилі popover явно (inset/margin/border/background) */
.toasts {
  position: fixed;
  top: auto;
  right: auto;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 18px);
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(460px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff7ec;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.toast.is-in {
  opacity: 1;
  transform: none;
}
.toast-error {
  background: #7d1f1f;
}
.toast-emoji {
  font-size: 22px;
  flex: none;
}

.fx-emoji {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  line-height: 1;
  will-change: transform, opacity;
}

.slot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(42, 24, 16, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
  transition: opacity 0.3s;
}
.slot-overlay.is-out {
  opacity: 0;
}
.slot-card {
  width: min(540px, 100%);
  padding: 32px 24px;
  border-radius: 32px;
  background: #fff;
  text-align: center;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}
.slot-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.slot-window {
  padding: 26px 16px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--mustard);
  overflow: hidden;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.slot-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: -0.02em;
}
.slot-overlay.is-done .slot-window {
  background: var(--tomato);
  color: #fff;
  transform: scale(1.05) rotate(-1deg);
}
.slot-sub {
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- Галерея ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.month-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 24px);
  letter-spacing: -0.02em;
  margin: 34px 0 14px;
}
.month-title::first-letter {
  text-transform: uppercase;
}
.month-count {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-left: 6px;
}
.masonry {
  columns: 4 230px;
  column-gap: 14px;
}
.masonry-2 {
  columns: 2 180px;
}
.tile {
  break-inside: avoid;
  margin: 0 0 14px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tile-img {
  background: var(--bg-deep);
}
.tile-img img {
  width: 100%;
  height: auto;
  display: block;
}
.tile-cap {
  display: grid;
  gap: 3px;
  padding: 12px 14px 14px;
}
.tile-dish {
  font-weight: 800;
  line-height: 1.25;
}
.tile-place {
  font-size: 13px;
  font-weight: 700;
  color: var(--tomato-dark);
}
.tile-caption {
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
}
.tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}
@media (max-width: 599px) {
  .masonry {
    columns: 2;
    column-gap: 10px;
  }
  .tile {
    margin-bottom: 10px;
    border-radius: var(--r-md);
  }
  .tile-cap {
    padding: 9px 10px 11px;
  }
  .tile-caption {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ---------- Історія ---------- */

.timeline {
  display: grid;
  gap: 18px;
}
.hist {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  overflow: hidden;
}
.hist-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 8px;
  text-align: center;
  background: var(--tomato);
  color: #fff;
}
.hist:nth-child(3n + 2) .hist-date {
  background: var(--mustard);
  color: var(--ink);
}
.hist:nth-child(3n + 3) .hist-date {
  background: var(--ink);
  color: #fff7ec;
}
.hist-day {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.hist-month {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
}
.hist-year {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
}
.hist-wd {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 6px;
}
.hist-main {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}
.hist-winner {
  display: flex;
  gap: 16px;
  align-items: center;
}
.hist-cover {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.hist-cover .media-ph span {
  font-size: 44px;
}
.hist-winner-text {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 0;
}
.hist-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(19px, 2.6vw, 24px);
  letter-spacing: -0.025em;
}
.hist-title a {
  color: inherit;
  text-decoration: none;
}
.hist-title a:hover {
  color: var(--tomato-dark);
}
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.hist-champs {
  font-size: 14px;
  font-weight: 700;
}
.hist-champs a {
  color: var(--ink);
}
.hist-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
}
.hist-people,
.hist-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 3px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.person-chip:hover {
  background: var(--bg-deep);
}
@media (max-width: 639px) {
  .hist {
    grid-template-columns: 1fr;
  }
  .hist-date {
    flex-direction: row;
    justify-content: flex-start;
    align-items: baseline;
    gap: 8px;
    padding: 10px 18px;
  }
  .hist-day {
    font-size: 26px;
  }
  .hist-wd {
    margin: 0 0 0 auto;
  }
  .hist-cover {
    width: 72px;
    height: 72px;
  }
  .bd-row,
  .hr-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) 18px 44px;
    gap: 8px;
    font-size: 13px;
  }
}

/* ---------- Заклади ---------- */

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.place-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.place-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.place-card.is-archived {
  opacity: 0.65;
  filter: grayscale(0.4);
}
.place-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-deep);
}
.medal {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 36px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}
.place-card-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 18px;
}
.place-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.place-card-desc {
  font-size: 14px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.place-stats {
  display: flex;
  gap: 14px;
  font-weight: 800;
  font-size: 14px;
}

.place-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  overflow: hidden;
  margin-top: 8px;
}
.place-hero-media {
  min-height: 320px;
  background: var(--bg-deep);
}
.place-hero-media .media-ph span {
  font-size: 120px;
}
.place-hero-body {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: start;
  padding: 28px;
}
.place-hero-emoji {
  font-size: 42px;
  line-height: 1;
}
.place-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
@media (max-width: 759px) {
  .place-hero {
    grid-template-columns: 1fr;
  }
  .place-hero-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
  .place-hero-body {
    padding: 20px;
  }
}
.wins-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wins-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.wins-date {
  font-weight: 800;
}
.wins-votes {
  margin-left: auto;
  font-weight: 800;
  color: var(--tomato-dark);
}

/* ---------- Люди / профіль ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.person {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.person:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.person-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.person-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.person-stats {
  display: flex;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-2);
}
.invite {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 26px;
  margin-top: 28px;
  background: var(--ink);
  color: #fff7ec;
  border: 0;
}
.invite .muted {
  color: rgba(255, 247, 236, 0.65);
}
.invite-emoji {
  font-size: 48px;
  line-height: 1;
}
.invite-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.invite-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.invite .btn-dark {
  background: var(--mustard);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--mustard-dark);
}
@media (max-width: 599px) {
  .invite {
    flex-direction: column;
    padding: 20px;
  }
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-top: 24px;
}
.profile-main {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.profile-bio {
  font-size: 18px;
  font-style: italic;
}
.profile-actions {
  display: grid;
  gap: 8px;
}
@media (max-width: 759px) {
  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 18px;
  }
  .profile-main {
    justify-items: center;
  }
  .profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}
.profile-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 28px;
}
.profile-cols .section {
  margin-top: 16px;
}
@media (max-width: 859px) {
  .profile-cols {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
.vh-list {
  list-style: none;
  margin: 0;
  padding: 6px 16px;
}
.vh-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 2px dashed var(--line);
}
.vh-row:last-child {
  border-bottom: 0;
}
.vh-date {
  font-weight: 800;
  font-size: 14px;
}
.vh-place a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.vh-place a:hover {
  color: var(--tomato-dark);
}
.vh-row .badge {
  white-space: normal;
  text-align: right;
}
@media (max-width: 520px) {
  .vh-row {
    grid-template-columns: 1fr auto;
  }
  .vh-date {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--ink-3);
  }
}

/* ---------- Вхід ---------- */

.auth {
  min-height: calc(100dvh - 100px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 0 0;
}
.brand-auth {
  font-size: clamp(52px, 8.4vw, 124px);
}
.auth-hero .hero-sub {
  margin-bottom: 22px;
}
.auth-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
}
.auth-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-steps span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 20px;
}
.auth-card {
  padding: 24px;
  display: grid;
  gap: 20px;
}
@media (min-width: 700px) {
  .auth-card {
    padding: 32px;
  }
}
.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
@media (max-width: 859px) {
  .auth {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 20px;
  }
  .auth-steps {
    display: none;
  }
}

/* ---------- Анімації ---------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-14px) rotate(6deg);
  }
}
@keyframes wobble {
  0%, 100% {
    transform: rotate(6deg);
  }
  50% {
    transform: rotate(18deg);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}
@keyframes throb {
  50% {
    transform: scale(1.06);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}
@keyframes sheet-out {
  to {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
