:root {
  --blue: #2f8de4;
  --blue-dark: #166cc0;
  --ink: #172033;
  --muted: #76849a;
  --line: #e3e8ef;
  --surface: #fff;
  --page: #f2f4f7;
  --shadow: 0 8px 24px rgba(38, 63, 98, .09);
  --shadow-hover: 0 14px 34px rgba(38, 63, 98, .14);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arimo, Arial, "Noto Sans Hebrew", sans-serif;
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.site-header {
  padding: 8px 18px 14px;
}
.header-inner {
  width: min(1160px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header-top-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 32px;
  direction: rtl;
  width: 100%;
}
.header-logo-link {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  transform: translate(40px, 15px);
}
.site-logo {
  display: block;
  width: min(320px, 34vw);
  max-height: 92px;
  object-fit: contain;
  margin: 0 auto;
}
.header-side {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.site-subtitle {
  margin: 0;
  color: #69788f;
  font-size: clamp(14px, 1.8vw, 18px);
  text-align: center;
  line-height: 1.35;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
  direction: rtl;
}
.header-stats {
  display: flex;
  gap: 0;
  padding: 5px 8px;
  border: 1px solid #e4eaf2;
  background: #f8fafc;
  border-radius: 15px;
}
.header-stats > div {
  min-width: 88px;
  padding: 5px 12px;
  border-left: 1px solid #e2e8f0;
  text-align: center;
}
.header-stats > div:last-child { border-left: 0; }
.header-stats strong, .header-stats span { display: block; }
.header-stats strong { font-size: 17px; color: #247fd3; text-align: center; }
.header-stats span { margin-top: 1px; color: #7d899b; font-size: 11px; text-align: center; }
.create-poll-btn {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: #23a455;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(35,164,85,.25);
}
.create-poll-btn:hover { transform: translateY(-2px); background: #198744; }

.user-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 14px;
}
.user-links a {
  color: #4a6f9c;
  text-decoration: none;
  font-weight: 700;
}
.user-links a:hover { color: var(--blue-dark); text-decoration: underline; }
.user-links a.is-active { color: var(--blue-dark); }

.categories-section {
  background: #fff;
  padding: 12px 18px 24px;
  text-align: center;
}
@media (min-width: 769px) {
  .categories-section {
    padding-left: 0;
    padding-right: 0;
  }
}
.category-slider-wrap {
  width: min(1440px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: ltr;
  box-sizing: border-box;
  padding: 0 2px;
}
.category-arrow-left { grid-column: 1; }
.category-arrow-right { grid-column: 3; }
.filter-buttons {
  grid-column: 2;
  justify-self: center;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: visible;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 4px 8px;
  direction: rtl;
  min-width: 0;
  width: auto;
  max-width: 1088px;
}
#categorySlider {
  width: auto;
  max-width: 1088px;
}
.filter-buttons::-webkit-scrollbar { display: none; }
.filter-btn {
  flex: 0 0 112px;
  width: 112px;
  min-height: 82px;
  box-sizing: border-box;
  border: 1px solid #e1e7ef;
  background: #fff;
  color: #34435a;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(38, 63, 98, .06);
  transition: .2s ease;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.filter-btn span { font-size: 27px; line-height: 1; }
.filter-btn b { font-size: 14px; }
.filter-btn:hover {
  transform: translateY(-2px);
  border-color: #afd3f5;
}
.filter-btn.active {
  color: var(--blue-dark);
  border-color: #80bbed;
  background: #f1f8ff;
  box-shadow: 0 7px 18px rgba(47, 141, 228, .15);
}
.filter-btn.new-btn {
  color: #17733a;
  border-color: #72cb8f;
  background: #effbf3;
  box-shadow: 0 7px 18px rgba(41,165,83,.15);
}
.filter-btn.new-btn span { font-size: 25px; }
.category-arrow {
  flex: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #dce4ee;
  background: #fff;
  color: #277fcf;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(35, 65, 100, .08);
  justify-self: center;
}
.category-arrow:hover { background: #f2f8ff; }
.category-arrow.arrow-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.polls-area {
  background: var(--page);
  border-top: 1px solid #e5e9ee;
  padding: 28px 0 64px;
}
body.home-page .polls-area {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}
body.home-page .polls-area > .yoyoo-ad-side {
  position: absolute;
  top: 28px;
  width: 160px;
  height: 600px;
}
body.home-page .polls-area > .yoyoo-ad-left {
  left: calc(50% - 770px);
  right: auto;
}
body.home-page .polls-area > .yoyoo-ad-right {
  left: calc(50% + 610px);
  right: auto;
}
body.home-page .polls-area > .page-shell {
  width: min(1440px, calc(min(1200px, 100vw) - 40px));
  margin-left: auto;
  margin-right: auto;
}
.page-shell {
  width: min(1440px, calc(100% - 28px));
  margin: auto;
}
.poll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 18px;
  align-items: start;
}
.new-polls-block {
  margin-bottom: 40px;
}
.all-polls-block {
  margin-bottom: 40px;
}
.new-polls-block[hidden],
.all-polls-block[hidden] {
  display: none;
}
.category-block {
  margin-bottom: 40px;
}
.category-block.hidden {
  display: none;
}
.category-block-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
}
.category-block-icon {
  font-size: 28px;
  line-height: 1;
}
.category-block-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}
.category-more-link {
  margin: 6px 0 0;
  text-align: center;
}
.category-more-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid #cfe3f7;
  background: #f4f9ff;
  color: #1676cd;
  font-weight: 800;
  text-decoration: none;
  transition: .18s;
}
.category-more-link a:hover {
  background: #e8f3ff;
  transform: translateY(-1px);
}
.category-page-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.category-page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}
.category-page-back {
  margin: 10px 0 0;
  text-align: center;
}
.category-page-back a {
  color: #1676cd;
  font-weight: 700;
  text-decoration: none;
}
.category-page-back a:hover {
  text-decoration: underline;
}
body.category-page .site-header {
  padding-bottom: 4px;
}
body.category-page .category-page-head {
  margin-top: 6px;
}
body.category-page .polls-area {
  padding-top: 10px;
}
body.category-page .polls-area > .categories-section,
body.category-page .page-shell > .categories-section {
  margin-top: 8px;
  padding-top: 10px;
  padding-bottom: 18px;
  background: #fff;
}
.list-page-title {
  margin: 12px 0 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
}
.poll-pagination-wrap {
  margin: 28px 0 8px;
  text-align: center;
}
.poll-pagination-next {
  margin-bottom: 12px;
}
.poll-pagination-next a,
.poll-pagination-next span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid #dfe6ef;
  background: #fff;
  color: #33435b;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.poll-pagination-next a:hover {
  background: #f6fbff;
  border-color: #9cc9ef;
}
.poll-pagination-next .disabled {
  opacity: .45;
  pointer-events: none;
}
.poll-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.poll-pagination a,
.poll-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid #dfe6ef;
  background: #fff;
  color: #33435b;
  font-weight: 700;
  text-decoration: none;
}
.poll-pagination a:hover {
  background: #f6fbff;
  border-color: #9cc9ef;
}
.poll-pagination .current {
  background: #2f8de4;
  border-color: #2f8de4;
  color: #fff;
}
.poll-pagination .disabled {
  opacity: .45;
  pointer-events: none;
}
.category-description-html {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e8edf3;
  color: #3a4455;
  font-size: 15px;
  line-height: 1.7;
}
.poll-card {
  --accent: #1c82ed;
  position: relative;
  display: block;
  width: auto;
  margin: 0;
  padding: 20px;
  break-inside: avoid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.poll-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
}
.poll-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #d4deea;
}
.poll-card.hidden { display: none; }
.poll-question {
  margin: 6px 0 15px;
  font-size: 18px;
  line-height: 1.4;
}
.poll-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--accent), white 90%);
  color: color-mix(in srgb, var(--accent), black 18%);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.poll-category[hidden] {
  display: none !important;
}
.poll-description {
  margin: -5px 0 16px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}
.poll-question a {
  color: inherit;
  text-decoration: none;
}
.poll-question a:hover { color: var(--accent); }

.poll-form { display: grid; gap: 10px; }
.poll-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #dfe3e8;
  border-radius: 11px;
  cursor: pointer;
  overflow: hidden;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.poll-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), white 48%);
  background: color-mix(in srgb, var(--accent), white 97%);
  box-shadow: 0 3px 9px rgba(30, 55, 85, .05);
}
.poll-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-radio {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-left: 10px;
  border: 2px solid #c9ced5;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fff;
  transition: .18s ease;
}
.poll-option input:checked + .custom-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.option-label { line-height: 1.35; font-size: 15px; }
.vote-btn, .show-results-btn, .back-vote-btn, .show-more-options-btn {
  width: 100%;
  border-radius: 11px;
  min-height: 46px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}
.vote-btn {
  margin-top: 3px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent), transparent 80%);
}
.show-results-btn, .back-vote-btn, .show-more-options-btn {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.show-more-options-btn {
  margin-top: 0;
  font-size: 14px;
}
.poll-option[hidden] { display: none; }
.vote-btn:hover, .show-results-btn:hover, .back-vote-btn:hover, .show-more-options-btn:hover { transform: translateY(-1px); }
.show-results-btn:hover, .back-vote-btn:hover, .show-more-options-btn:hover {
  background: color-mix(in srgb, var(--accent), white 95%);
}
.vote-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.poll-votes-bottom {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid #edf1f5;
  text-align: center;
  color: #8693a7;
  font-size: 12px;
  font-weight: 700;
}

/* תוצאות — זהה ל-seker/iframe.php */
.poll-card .poll-results-area {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
.poll-card .results-container { width: 100%; }
.poll-card .result-item { margin-bottom: 14px; }
.poll-card .result-answer {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 400;
  color: rgba(26, 26, 46, 0.78);
}
.poll-card .result-percent {
  font-size: clamp(12px, 3vw, 13px);
  color: rgba(26, 26, 46, 0.72);
  white-space: nowrap;
}
.poll-card .result-bar-bg {
  width: 100%;
  height: 30px;
  background: #f1f1f1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.poll-card .result-bar {
  height: 100%;
  border-radius: 12px;
  transition: width 0.8s ease;
  min-width: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.poll-card .result-bar-content {
  width: 100%;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 100%;
  position: relative;
  z-index: 1;
}
.poll-card .results-total {
  display: none;
}
.poll-card .message {
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: clamp(13px, 3vw, 14px);
  font-weight: 500;
}
.poll-card .message-success {
  background: #e8f8e8;
  color: #2d7a2d;
  border: 1px solid #b8e6b8;
}
.poll-card .message-warning {
  background: #fff3e0;
  color: #c67700;
  border: 1px solid #ffe0b2;
}
.poll-card .results-loading {
  text-align: center;
  padding: 20px;
  color: #888;
}

body.poll-page .yoyoo-body-wrap {
  width: 100%;
  max-width: none;
  padding: 0;
}
body.poll-page .yoyoo-main {
  width: 100%;
  max-width: none;
}
.poll-page .polls-area {
  width: 100%;
  max-width: none;
  padding: 24px 0 40px;
}
.poll-page-shell {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
.poll-page-ad-slot {
  flex: 0 0 160px;
  width: 160px;
}
.poll-page-ad-slot .yoyoo-ad-side {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  width: 160px;
  height: 600px;
}
.poll-page-inner {
  flex: 0 1 auto;
  width: min(100%, 430px);
  margin: 0;
}
@media (max-width: 1200px) {
  .poll-page-ad-slot {
    display: none;
  }
  .poll-page-shell {
    gap: 0;
  }
}
.poll-page-below {
  margin-top: 12px;
}
.poll-page-related {
  margin-bottom: 28px;
}
.poll-page-related .poll-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.poll-page-related-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}
.poll-page-related-title a {
  color: inherit;
  text-decoration: none;
}
.poll-page-related-title a:hover {
  color: var(--accent, #1c82ed);
}
body.poll-page .poll-page-below > .categories-section {
  margin-top: 4px;
  padding-top: 10px;
  padding-bottom: 24px;
  background: #fff;
}
.poll-page .poll-card-standalone {
  width: 100%;
}
.poll-page .poll-card-standalone:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.poll-page .poll-question-standalone {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}
.poll-page-credit {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.poll-page-credit a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.poll-page-credit a:hover { color: var(--accent, #1c82ed); }
.poll-page .site-header { padding-bottom: 8px; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.poll-grid > .empty-state {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
}
.empty-icon { font-size: 48px; }
.empty-state h2 { color: var(--ink); margin-bottom: 8px; }
.toast {
  position: fixed;
  z-index: 99;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 25px);
  opacity: 0;
  pointer-events: none;
  background: #101b2e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 14px 35px rgba(8, 18, 35, .25);
  transition: .25s ease;
  font-weight: 700;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .category-slider-wrap {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 6px;
    width: min(100%, 320px);
    margin: 0 auto;
    padding: 0 4px;
  }
  .category-arrow-left { grid-column: 1; }
  .category-arrow-right { grid-column: 3; }
  .category-arrow {
    flex: none;
    width: 34px;
    height: 34px;
    z-index: 2;
    font-size: 14px;
    line-height: 1;
  }
  #categorySlider {
    grid-column: 2;
    width: 100% !important;
    max-width: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-height: calc(3 * 66px + 2 * 6px);
    padding: 0;
    direction: rtl;
    box-sizing: border-box;
  }
  .category-mobile-page {
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, 66px);
    gap: 6px;
    direction: rtl;
    box-sizing: border-box;
  }
  #categorySlider::-webkit-scrollbar { display: none; }
  #categorySlider .filter-btn {
    flex: none;
    width: 100%;
    height: 66px;
    min-height: 66px;
    max-height: 66px;
    padding: 4px 2px;
    gap: 3px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(38, 63, 98, .06);
    box-sizing: border-box;
    overflow: hidden;
  }
  #categorySlider .filter-btn span { font-size: 20px; }
  #categorySlider .filter-btn b {
    font-size: 11px;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 850px) {
  .filter-buttons { justify-content: flex-start; }
}
@media (max-width: 900px) {
  .header-top-row {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .header-side {
    align-items: center;
    width: 100%;
  }
  .site-subtitle {
    text-align: center;
  }
  .header-actions {
    justify-content: center;
    width: min(100%, 430px);
  }
}
@media (max-width: 700px) {
  .header-actions { gap: 7px; }
  .header-actions .header-stats { flex: 1; min-width: 0; }
  .create-poll-btn { min-height: 48px; padding: 0 13px; font-size: 14px; }
}
@media (max-width: 560px) {
  .site-header { padding: 6px 12px 10px; }
  .site-logo { width: min(300px, 78vw); max-height: 86px; }
  .header-stats { width: min(100%, 330px); }
  .header-stats > div { min-width: 0; flex: 1; padding-inline: 5px; }
  .categories-section { padding: 6px 9px 18px; }
  .category-slider-wrap { gap: 4px; }
  .category-arrow { flex-basis: 30px; width: 30px; height: 30px; }
  .polls-area { padding-top: 18px; }
  .page-shell { width: min(100% - 18px, 1440px); }
  .poll-grid { grid-template-columns: 1fr; }
  .poll-page-related .poll-grid { grid-template-columns: 1fr; }
  .poll-card { border-radius: 20px; padding: 18px; }
  .poll-question { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
