:root {
  color-scheme: dark;
  --bg: #0e0e18;
  --panel: rgba(25, 25, 39, 0.82);
  --panel-strong: rgba(19, 19, 31, 0.96);
  --line: rgba(255, 255, 255, 0.09);
  --muted: rgba(255, 255, 255, 0.56);
  --pink: #ff5a8a;
  --orange: #ff8b4a;
  --gold: #e9c46a;
  --green: #58d6a9;
  --danger: #ff7085;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: #fff;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 90, 138, 0.18), transparent 32%),
    linear-gradient(180deg, #151321 0%, #0e0e18 42%, #090d16 100%);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora { position: absolute; width: 70vw; height: 42vw; min-width: 420px; min-height: 260px; border-radius: 50%; filter: blur(70px); opacity: .12; }
.aurora-a { top: 6%; left: -25%; background: #4ed7bb; transform: rotate(-15deg); }
.aurora-b { top: 20%; right: -30%; background: #9f67ff; transform: rotate(24deg); }
.stars {
  position: absolute; inset: 0; opacity: .38;
  background-image:
    radial-gradient(1px 1px at 8% 12%, #fff, transparent),
    radial-gradient(1px 1px at 28% 22%, #fff, transparent),
    radial-gradient(1px 1px at 72% 8%, #fff, transparent),
    radial-gradient(1px 1px at 92% 32%, #fff, transparent),
    radial-gradient(1px 1px at 18% 64%, #fff, transparent),
    radial-gradient(1px 1px at 63% 74%, #fff, transparent),
    radial-gradient(1px 1px at 82% 88%, #fff, transparent);
  background-size: 260px 260px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 28px, 1060px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 max(90px, env(safe-area-inset-bottom));
}
.loading-card {
  min-height: 70vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.1); border-top-color: var(--pink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.brand { font-family: Syne, sans-serif; letter-spacing: -.04em; }
.brand-gradient {
  background: linear-gradient(100deg, var(--pink), var(--orange) 55%, #ffd166);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow { margin: 0 0 8px; font-size: 11px; letter-spacing: .17em; font-weight: 800; color: rgba(255,255,255,.43); text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(36px, 8vw, 62px); line-height: .92; }
h2 { margin-bottom: 8px; font-size: clamp(22px, 4vw, 30px); line-height: 1.1; }
h3 { margin-bottom: 8px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.lead { max-width: 650px; color: rgba(255,255,255,.68); line-height: 1.55; }

.auth-layout { min-height: 92vh; display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: center; }
.hero-card, .panel, .auth-card, .meeting-hero, .proposal, .history-card, .stat {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.hero-card { min-height: 560px; padding: clamp(28px, 6vw, 66px); border-radius: 32px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 340px; height: 340px; right: -160px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,90,138,.38), transparent 67%); }
.auth-card { padding: 26px; border-radius: 26px; background: var(--panel-strong); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 22px; border-radius: 14px; background: rgba(255,255,255,.055); }
.auth-tab { border: 0; padding: 10px; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.auth-tab.active { color: #fff; background: rgba(255,255,255,.1); }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 700; }
input, textarea, select {
  width: 100%; min-height: 46px; padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 13px;
  outline: none; color: #fff; background: rgba(255,255,255,.055);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(255,90,138,.65); box-shadow: 0 0 0 3px rgba(255,90,138,.12); }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.3); }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 18px; min-height: 18px; accent-color: var(--pink); }

.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 13px;
  background: rgba(255,255,255,.08); color: #fff; text-decoration: none;
  font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.12); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(100deg, var(--pink), #ff6d72); box-shadow: 0 12px 30px rgba(255,90,138,.22); }
.btn-primary:hover { background: linear-gradient(100deg, #ff6995, #ff7a7e); }
.btn-gold { border-color: rgba(233,196,106,.32); background: rgba(233,196,106,.1); color: #fff1c6; }
.btn-danger { border-color: rgba(255,112,133,.28); background: rgba(255,112,133,.1); color: #ffd8de; }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-small { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.topbar .brand { font-size: 23px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.member-chip { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); }
.member-avatar { width: 30px; height: 30px; display: grid; place-content: center; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--orange)); font-size: 12px; font-weight: 900; }
.language-switcher {
  display: inline-flex; width: fit-content; gap: 3px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(14,14,24,.65);
}
.language-switcher button {
  min-width: 36px; min-height: 30px; padding: 5px 8px;
  border: 0; border-radius: 999px; background: transparent;
  color: rgba(255,255,255,.48); font: inherit; font-size: 10px;
  font-weight: 900; letter-spacing: .08em; cursor: pointer;
}
.language-switcher button.active { background: rgba(255,255,255,.11); color: #fff; }
.nav {
  position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 30;
  display: flex; gap: 5px; padding: 5px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 17px;
  background: rgba(14,14,24,.79); backdrop-filter: blur(24px); overflow-x: auto;
}
.nav button { min-width: max-content; flex: 1; border: 0; border-radius: 12px; padding: 10px 12px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; font-size: 12px; }
.nav button.active { color: #fff; background: rgba(255,255,255,.09); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.stack { display: grid; gap: 14px; }
.panel { padding: 20px; border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.action-panel {
  border-color: rgba(88,214,169,.34);
  background: linear-gradient(180deg, rgba(88,214,169,.12), rgba(255,255,255,.035));
  box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 0 0 3px rgba(88,214,169,.045);
}
.action-panel.voting-live { animation: live-action-glow 2.8s ease-in-out infinite; }
@keyframes live-action-glow {
  0%, 100% { border-color: rgba(88,214,169,.28); box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 0 0 3px rgba(88,214,169,.035); }
  50% { border-color: rgba(88,214,169,.58); box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 0 28px rgba(88,214,169,.13); }
}
.meeting-hero { padding: 24px; border-radius: 26px; overflow: hidden; position: relative; }
.meeting-hero::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(78,215,187,.18), transparent 68%); pointer-events: none; }
.watched-list { display: grid; gap: 8px; margin: 0 0 18px; }
.watched-item { display: flex; align-items: center; gap: 10px; font-size: clamp(17px, 3vw, 23px); font-weight: 800; }
.watched-item > span { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--gold); font-size: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.055); color: rgba(255,255,255,.65); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.badge-live { border-color: rgba(88,214,169,.3); color: #9bf1d3; background: rgba(88,214,169,.09); }
.badge-kids { border-color: rgba(233,196,106,.3); color: #fff1c6; background: rgba(233,196,106,.08); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0; }
.meta { padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.05); color: rgba(255,255,255,.64); font-size: 11px; font-weight: 700; }
.status-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }

.proposal-list, .history-list { display: grid; gap: 10px; }
.proposal { position: relative; padding: 15px; border-radius: 17px; box-shadow: none; cursor: pointer; }
.proposal:hover { border-color: rgba(255,255,255,.18); }
.proposal.selected { border-color: rgba(255,90,138,.55); box-shadow: 0 0 0 3px rgba(255,90,138,.11); }
.proposal-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.proposal-last-watched { margin: 3px 0 2px; color: rgba(233,196,106,.78); font-size: 11px; line-height: 1.35; }
.vote-count { min-width: 34px; height: 34px; display: grid; place-content: center; border-radius: 10px; background: rgba(255,255,255,.06); font-weight: 900; }
.vote-hint { margin-top: 10px; color: rgba(255,255,255,.5); }
.vote-hint.selected { color: #ff9fbb; }
.warning { margin-top: 9px; padding: 8px 10px; border-radius: 10px; background: rgba(255,112,133,.1); color: #ffc4ce; font-size: 11px; }
.inline-link {
  margin-left: 5px; padding: 0; border: 0; background: transparent;
  color: #fff; font: inherit; font-weight: 800; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}
.winner { border-color: rgba(233,196,106,.48); background: linear-gradient(180deg, rgba(233,196,106,.12), rgba(255,255,255,.035)); }
.winner-title { font-family: Syne, sans-serif; color: #fff1c6; }
.attendee-list { display: flex; flex-wrap: wrap; gap: 7px; }
.attendee-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px;
  border: 1px solid rgba(88,214,169,.2); border-radius: 999px;
  background: rgba(88,214,169,.08); color: rgba(255,255,255,.82);
  font-size: 12px; font-weight: 700;
}
.attendee-chip > span { color: #9bf1d3; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stat { padding: 16px; border-radius: 17px; box-shadow: none; }
.stat-number { display: block; margin-bottom: 5px; font-family: Syne, sans-serif; font-size: 28px; }
.stat-label { color: var(--muted); font-size: 11px; }
.history-card { padding: 15px; border-radius: 17px; box-shadow: none; }
.history-top { display: flex; justify-content: space-between; gap: 10px; }
.attendance-yes { color: #9bf1d3; }
.attendance-no { color: rgba(255,255,255,.35); }
.stars-rating { color: #ffd166; letter-spacing: 2px; }
.catalog-list { display: grid; gap: 8px; margin-top: 12px; }
.catalog-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid transparent; border-radius: 13px;
  background: rgba(255,255,255,.045);
}
.catalog-item-own { border-color: rgba(88,214,169,.22); background: rgba(88,214,169,.065); }
.catalog-item-copy { min-width: 0; display: grid; gap: 6px; }
.catalog-item-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.catalog-movie-title { font-weight: 750; }
.badge-mine { border-color: rgba(88,214,169,.24); color: #aaf1d7; background: rgba(88,214,169,.09); }
.empty { padding: 28px 18px; text-align: center; border: 1px dashed rgba(255,255,255,.12); border-radius: 18px; color: var(--muted); }
.divider { height: 1px; margin: 16px 0; background: var(--line); }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 460px); padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 14px;
  color: #fff; background: rgba(18,18,28,.94); box-shadow: var(--shadow);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: .22s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: rgba(255,112,133,.42); color: #ffd6dd; }

.admin-feed { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.feed-item { padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.045); font-size: 12px; line-height: 1.45; }
.admin-member-list { display: grid; gap: 8px; margin-top: 14px; }
.admin-member-card, .admin-meeting-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); }
.admin-member-card > summary, .admin-meeting-card > summary {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 10px 9px 13px; list-style: none; cursor: pointer;
}
.admin-member-card > summary::-webkit-details-marker, .admin-meeting-card > summary::-webkit-details-marker { display: none; }
.admin-member-card[open] > summary, .admin-meeting-card[open] > summary { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.035); }
.admin-member-name { display: grid; gap: 3px; }
.admin-gear, .icon-button {
  width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px; color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.045);
}
.admin-gear svg, .icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-member-card > summary:hover .admin-gear, .admin-meeting-card > summary:hover .admin-gear { color: #fff; background: rgba(255,255,255,.09); }
.admin-member-actions { padding: 13px; }
.admin-member-edit { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.member-attendance-list { display: grid; gap: 7px; max-height: 290px; overflow: auto; }
.admin-attendance-option {
  grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.04); cursor: pointer;
}
.admin-attendance-option input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--green); }
.admin-attendance-option > span { min-width: 0; display: grid; gap: 2px; }
.admin-attendance-option .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-meeting-list, .admin-catalog-list { display: grid; gap: 8px; margin-top: 14px; }
.admin-catalog-row {
  min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 11px 10px 13px; border-radius: 14px; background: rgba(255,255,255,.045);
}
.admin-meeting-copy { min-width: 0; display: grid; gap: 4px; }
.admin-meeting-copy > span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.admin-meeting-summary-actions, .admin-catalog-copy { display: flex; align-items: center; gap: 8px; }
.admin-meeting-edit-panel { padding: 13px; }
.admin-meeting-wide { grid-column: 1 / -1; }
.admin-meeting-kids { align-self: end; min-height: 46px; }
.admin-catalog-copy { min-width: 0; flex-wrap: wrap; }
.icon-button { padding: 0; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.icon-button:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); }
.icon-button:active { transform: scale(.96); }
.icon-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-button-danger { color: #ffc2cc; border-color: rgba(255,112,133,.25); background: rgba(255,112,133,.08); }
.icon-button-danger:hover { border-color: rgba(255,112,133,.5); background: rgba(255,112,133,.15); }
.compact-empty { padding: 15px 12px; border-radius: 12px; }

@media (max-width: 820px) {
  .auth-layout, .content-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: auto; }
}
@media (max-width: 560px) {
  .app-shell { width: min(100% - 20px, 1060px); padding-top: max(12px, env(safe-area-inset-top)); }
  .hero-card, .auth-card, .panel, .meeting-hero { border-radius: 20px; padding: 17px; }
  .auth-layout { gap: 12px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .member-chip > span:not(.member-avatar) { display: none; }
  .nav { margin-left: -2px; margin-right: -2px; }
  .status-line { align-items: flex-start; flex-direction: column; }
  .button-row .btn { flex: 1; }
  .admin-member-edit { grid-template-columns: 1fr; }
  .admin-meeting-card > summary { align-items: flex-start; }
  .admin-meeting-summary-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
