/* HUB של זה״ב — Premium design tokens & shared UI */
:root {
  --blue: #0B3A6E;
  --blue-deep: #07284d;
  --blue-soft: #e8f1fb;
  --turquoise: #1FAD9F;
  --turquoise-deep: #178f84;
  --orange: #F4A261;
  --orange-deep: #e08a45;
  --gold: #FFD166;
  --gold-soft: #fff6d6;
  --green: #2A9D8F;
  --red: #E76F51;
  --bg: #FFF8F1;
  --bg-soft: #fff3e6;
  --text: #1A1A1A;
  --muted: #5C6B7A;
  --white: #FFFFFF;
  --card: rgba(255, 255, 255, 0.92);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow: 0 10px 30px rgba(11, 58, 110, 0.10), 0 2px 8px rgba(11, 58, 110, 0.06);
  --shadow-lg: 0 20px 50px rgba(11, 58, 110, 0.16), 0 6px 16px rgba(11, 58, 110, 0.08);
  --shadow-hover: 0 18px 40px rgba(11, 58, 110, 0.18), 0 4px 12px rgba(31, 173, 159, 0.15);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --touch: 52px;
  --font-display: "Rubik", "Assistant", system-ui, sans-serif;
  --font-body: "Assistant", "Rubik", system-ui, sans-serif;
  --ring: 0 0 0 3px rgba(244, 162, 97, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(31, 173, 159, 0.12), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 209, 102, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, #fff4e8 100%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--blue);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: var(--turquoise); }

img, svg { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Layout */
.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Brand header — gradient glass */
.brand-header {
  background: linear-gradient(125deg, var(--blue) 0%, #0e4d8c 48%, var(--turquoise) 130%);
  color: var(--white);
  padding: 1.1rem 0;
  box-shadow: 0 8px 28px rgba(11, 58, 110, 0.28);
  position: relative;
  overflow: hidden;
}

.brand-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 55%);
  pointer-events: none;
}

.brand-header .brand-name {
  color: var(--white);
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  position: relative;
  z-index: 1;
}

.brand-header .brand-sub {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.82rem, 1.8vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
  opacity: 0.95;
}

.brand-header .brand-name .hub-en,
.hub-en {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}

.brand-header .brand-slogan {
  margin: 0.3rem 0 0;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.brand-header a {
  color: var(--white);
  text-decoration: none;
}

.brand-footer {
  margin-top: 3.5rem;
  padding: 1.75rem 0;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue) 55%, #0e5470);
  color: var(--white);
  text-align: center;
  font-size: 0.95rem;
  box-shadow: 0 -8px 30px rgba(11, 58, 110, 0.12);
}

.brand-footer .gold { color: var(--gold); font-weight: 700; }

/* Buttons — premium pill */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, filter 0.18s ease;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12), 0 8px 18px rgba(11, 58, 110, 0.12);
  position: relative;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.03); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); }

.btn-primary {
  background: linear-gradient(145deg, #28c4b4, var(--turquoise) 45%, var(--turquoise-deep));
  color: var(--white);
}

.btn-primary:hover { background: linear-gradient(145deg, #2fd0bf, #1a9e92); }

.btn-secondary {
  background: linear-gradient(145deg, #ffb67a, var(--orange) 50%, var(--orange-deep));
  color: var(--text);
}

.btn-secondary:hover { background: linear-gradient(145deg, #ffc08c, #e8924a); }

.btn-ghost {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--blue);
  border: 2px solid rgba(11, 58, 110, 0.18);
  box-shadow: 0 4px 14px rgba(11, 58, 110, 0.08);
}

.btn-ghost:hover { background: #fff; border-color: var(--turquoise); }

.btn-danger-soft {
  background: #fde8e2;
  color: var(--red);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Soft / glass cards */
.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  border: 1px solid rgba(11, 58, 110, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.35rem;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 260px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  padding: 0;
}

.entry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(31, 173, 159, 0.35);
}

.entry-card .card-media {
  position: relative;
  height: 132px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--blue-soft), #dff7f3);
}

.entry-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.entry-card:hover .card-media img { transform: scale(1.05); }

.entry-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.2rem 1.25rem;
  flex: 1;
}

.entry-card .card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold), var(--orange));
  box-shadow: 0 6px 14px rgba(244, 162, 97, 0.35);
  margin: 1.2rem 1.2rem 0;
}

.entry-card h3 {
  margin: 0;
  font-size: 1.22rem;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
  font-size: 0.95rem;
}

.entry-card.soon {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.entry-card.soon::after {
  content: "בקרוב";
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(145deg, var(--muted), #3d4a56);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Age / meta badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(11, 58, 110, 0.06);
}

.badge-age {
  background: linear-gradient(145deg, #e8f4ff, #d4e9fb);
  color: var(--blue);
  border: 1px solid rgba(11, 58, 110, 0.1);
}

.badge-time {
  background: linear-gradient(145deg, #fff3e0, #ffe4c2);
  color: #b5651d;
  border: 1px solid rgba(181, 101, 29, 0.12);
}

.badge-ok {
  background: linear-gradient(145deg, #e6f7f4, #c9f0e9);
  color: var(--green);
  border: 1px solid rgba(42, 157, 143, 0.18);
}

.badge-warn {
  background: linear-gradient(145deg, #fde8e2, #fcd5cb);
  color: var(--red);
  border: 1px solid rgba(231, 111, 81, 0.18);
}

.badge-gold {
  background: linear-gradient(145deg, #fff6d6, #ffe9a8);
  color: #9a6b00;
  border: 1px solid rgba(154, 107, 0, 0.15);
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Feedback panels */
.feedback {
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  font-weight: 600;
  margin-top: 1rem;
  box-shadow: 0 4px 14px rgba(11, 58, 110, 0.06);
}

.feedback-ok {
  background: linear-gradient(135deg, #e6f7f4, #d4f3ed);
  color: #1a6b60;
  border: 2px solid var(--green);
}

.feedback-try {
  background: linear-gradient(135deg, #fff6e8, #ffefd6);
  color: #8a5a1a;
  border: 2px solid var(--orange);
}

.feedback-hint {
  background: linear-gradient(135deg, #eef5fb, #e2eef9);
  color: var(--blue);
  border: 2px solid #9ec3e8;
}

.stars {
  display: inline-flex;
  gap: 0.25rem;
}

.star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.star.filled {
  background: linear-gradient(145deg, #ffe08a, var(--gold));
  box-shadow: 0 0 0 2px #f0c14b inset, 0 4px 10px rgba(255, 209, 102, 0.5);
}

.star.filled::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: #fff8dc;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Progress */
.progress-track {
  height: 12px;
  background: rgba(11, 58, 110, 0.08);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(11, 58, 110, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--turquoise), var(--green) 60%, var(--gold));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(31, 173, 159, 0.45);
}

/* Soft panel helper */
.soft-panel {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

/* Progress pills */
.progress-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.progress-pills .pill {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(11, 58, 110, 0.15);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.progress-pills .pill.done {
  background: linear-gradient(145deg, var(--turquoise), var(--green));
  box-shadow: 0 0 0 3px rgba(31, 173, 159, 0.2);
}

.progress-pills .pill.current {
  background: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.35);
}

/* Avatar chip */
.avatar-chip {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(11, 58, 110, 0.18);
  border: 3px solid #fff;
  background: var(--gold-soft);
}

.avatar-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}

.avatar-chip.lg {
  width: 88px;
  height: 88px;
}

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

/* Print helpers */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
  .brand-header, .brand-footer { box-shadow: none; }
  a[href]::after { content: ""; }
  .page-break { page-break-before: always; break-before: page; }
}

.print-tips {
  background: linear-gradient(135deg, #eef5fb, #e4f0fa);
  border-inline-start: 4px solid var(--blue);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(11, 58, 110, 0.06);
}

.ink-saver,
.bw {
  filter: grayscale(1) contrast(1.15);
}

/* Extra premium helpers for Wave-1 games */
.guide-bubble {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.guide-bubble .avatar-chip { margin-top: 0.1rem; }

.choice-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 58px;
  padding: 1rem 1.2rem;
  border: 2px solid rgba(11, 58, 110, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 12px rgba(11, 58, 110, 0.06);
}

.choice-btn:hover {
  border-color: var(--turquoise);
  background: #f0fbf9;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(31, 173, 159, 0.15);
}

.choice-btn:disabled { cursor: default; opacity: 0.75; transform: none; }

.choice-btn .num {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), #0e4d8c);
  color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(11, 58, 110, 0.25);
}

.score-pill {
  background: linear-gradient(145deg, var(--blue), #0e4d8c);
  color: #fff;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 6px 16px rgba(11, 58, 110, 0.25);
}

.scene-frame {
  position: relative;
  background: #fff;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.scene-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blue), var(--turquoise), var(--gold));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* ========== Wave 5 · District portal ========== */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  margin-top: 0.65rem;
}
.site-nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  transition: background 0.15s, border-color 0.15s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.28);
  border-color: var(--gold);
  color: #fff;
}
.site-nav .nav-home {
  font-weight: 800;
  background: rgba(255,209,102,0.25);
  border-color: rgba(255,209,102,0.55);
}

.audience-gates {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem;
}
@media (max-width: 960px) {
  .audience-gates { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .audience-gates { grid-template-columns: repeat(2, 1fr); }
}
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  text-decoration: none;
  color: var(--blue);
  background: var(--card);
  border: 2px solid rgba(11,58,110,0.08);
  border-radius: var(--radius);
  padding: 1rem 0.55rem;
  min-height: 96px;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.gate:hover, .gate.is-active {
  transform: translateY(-3px);
  border-color: var(--turquoise);
  box-shadow: var(--shadow-hover);
}
.gate .gate-emoji { font-size: 1.55rem; line-height: 1; }
.gate .gate-sub { font-size: 0.72rem; font-weight: 700; color: var(--muted); font-family: var(--font-body); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.25rem;
  box-shadow: var(--shadow);
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--blue);
}
.filter-bar select {
  min-height: 42px;
  min-width: 140px;
  border-radius: 12px;
  border: 1.5px solid rgba(11,58,110,0.15);
  background: #fff;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.filter-bar .filter-reset {
  margin-inline-start: auto;
}
.filter-count {
  width: 100%;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.library-card[hidden] { display: none !important; }
.library-empty {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-weight: 700;
  background: var(--card);
  border-radius: var(--radius);
  border: 2px dashed rgba(11,58,110,0.15);
}
.library-empty.is-visible { display: block; }

.page-hero {
  padding: 1.75rem 0 0.75rem;
}
.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}
.page-hero .lede {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  max-width: 40rem;
  font-size: 1.05rem;
}
.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.crumb a { color: var(--turquoise-deep); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.entry-card .cta-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--turquoise-deep);
}
.brand-footer a { color: var(--gold); }
.brand-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.75rem;
  font-size: 0.88rem;
}
.brand-footer .footer-links a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
  border-bottom: 1px solid transparent;
}
.brand-footer .footer-links a:hover {
  border-bottom-color: var(--gold);
  opacity: 1;
}
