:root {
  --bg-top: #ede9fe;
  --bg-bottom: #fdf2f8;
  --primary: #db2777;
  --primary-dark: #be185d;
  --accent-violet: #8b5cf6;
  --accent-violet-soft: #ede9fe;
  --ink: #831843;
  --ink-soft: #9d4b77;
  --card-bg: #ffffff;
  --border-soft: #fbcfe8;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 10px 30px rgba(131, 24, 67, 0.12);
  --shadow-card-hover: 0 18px 40px rgba(131, 24, 67, 0.18);
  --font-heading: 'M PLUS Rounded 1c', 'Rubik', sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 55%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

:focus-visible {
  outline: 3px solid var(--accent-violet);
  outline-offset: 2px;
  border-radius: 6px;
}

a { color: inherit; }

/* ---------- מבנה כללי ---------- */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- ניווט עליון ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand-emoji { font-size: 1.4rem; }

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-link {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-link:hover { background: var(--accent-violet-soft); }
.nav-link.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- כפתורים משותפים ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 0 var(--primary-dark);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 0 var(--primary-dark); }

.btn-ghost {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--border-soft);
}
.btn-ghost:hover { border-color: var(--primary); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: #fff; transform: translateY(-2px); }

.btn-done {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  cursor: default;
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  max-width: 680px;
  margin: 20px auto 28px;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-violet-soft);
  color: var(--accent-violet);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 999px;
  margin: 0 0 12px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 18px;
  line-height: 1.25;
}
.hero-text {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 32px;
}

/* ---------- משחקים ---------- */

.games-section { margin-bottom: 56px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0;
}
.section-count { color: var(--ink-soft); font-size: 0.95rem; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.game-icon-panel {
  position: relative;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-emoji {
  font-size: 3rem;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15));
}

/* כרטיס עם וידאו: הפאנל נפתח לבאנר 2:1 במקום רצועת האמוג'י.
   רק כרטיסים כאלה גדלים - השאר נשארים 96px. */
.game-icon-panel.has-video {
  height: auto;
  aspect-ratio: 2 / 1;
}
.game-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* הפוסטר מוצג עד שהוידאו יורד (ובמצב צמצום תנועה - לתמיד) */
  background: center / cover no-repeat;
}
.game-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.game-card-body {
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.game-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 8px;
  color: var(--ink);
}
.game-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 14px;
  flex: 1;
}

.game-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-pill {
  background: var(--accent-violet-soft);
  color: var(--accent-violet);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

/* התקדמות על הכרטיס - נבנה ב-js/hub.js לפי חוזה ההתקדמות של js/storage.js */

.game-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.progress-bar {
  flex: 1;
  height: 10px;
  background: var(--accent-violet-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-violet), var(--primary));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.progress-badge {
  background: var(--accent-violet-soft);
  color: var(--accent-violet);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.game-links { display: flex; gap: 10px; }
.game-links .btn { flex: 1; }

.empty-note {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- משימת היום ---------- */

.mission-section { margin-bottom: 56px; }
.mission-card {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary), var(--accent-violet));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-soft);
}
.mission-emoji { font-size: 2.6rem; flex-shrink: 0; }
.mission-body { flex: 1; min-width: 200px; }
.mission-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 6px;
}
.mission-text { margin: 0; opacity: 0.95; line-height: 1.5; }
.mission-reward {
  display: inline-block;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.22);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* ---------- הצעת משחק / רשימת משאלות ---------- */

.wishlist-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 56px;
}
.wishlist-section h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0 0 8px;
}
.wishlist-intro { color: var(--ink-soft); margin: 0 0 20px; }

.wishlist-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.wishlist-form input {
  flex: 1;
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid var(--border-soft);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
}
.wishlist-form input:focus { border-color: var(--primary); outline: none; }

.wishlist-list-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.wishlist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.wishlist-item {
  background: var(--accent-violet-soft);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.4;
}
.wishlist-empty { color: var(--ink-soft); font-style: italic; padding: 4px 2px; }

/* ---------- פוטר ---------- */

.site-footer {
  text-align: center;
  padding: 28px 16px 40px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- מסך "איך קוראים לך?" (js/profile-gate.js) ---------- */

.gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 30px 26px 26px;
  text-align: center;
}
.gate-emoji { font-size: 2.6rem; }
.gate-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 8px 0 6px;
}
.gate-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 20px; }

.gate-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid var(--border-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: center;
  color: var(--ink);
  background: #fff;
}
.gate-input:focus { border-color: var(--primary); outline: none; }

.gate-label {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 20px 0 10px;
}
.gate-avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.gate-avatar {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  line-height: 1;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.gate-avatar:hover { transform: scale(1.08); }
.gate-avatar.selected {
  border-color: var(--primary);
  transform: scale(1.12);
}

.gate-submit { width: 100%; }

/* ---------- רספונסיביות ---------- */

@media (max-width: 640px) {
  .site-nav { justify-content: center; text-align: center; }
  .mission-card { flex-direction: column; text-align: center; }
  .game-links { flex-direction: column; }
}
