:root {
  --ink: #1d2a5b;
  --ink-soft: #55608c;
  --sky: #8fd6ff;
  --sky-light: #d9f2ff;
  --cream: #fff9ec;
  --paper: #ffffff;
  --sun: #ffc83d;
  --coral: #ff6b5e;
  --grass: #7ccb5f;
  --line: 3px solid var(--ink);
  --head: Fredoka, Rubik, Arial, sans-serif;
  --body: Rubik, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 17px/1.5 var(--body); overflow-x: hidden; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: -60px; right: 12px; z-index: 30; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 0 0 10px 10px; }
.skip:focus { top: 0; }

.notice { padding: 9px 16px; background: var(--ink); color: #fff; text-align: center; font-weight: 500; }

/* ----- הכותרת: שמיים, שמש וגבעות ----- */
.hero { position: relative; overflow: hidden; padding: 28px 16px 118px; background: linear-gradient(#8fd6ff, #d9f2ff 92%); }
.hero-in { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 28px; max-width: 900px; margin: 0 auto; }
.logo { width: 132px; height: auto; flex: none; transform: rotate(8deg); animation: settle 1.1s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: 50% 94%; }
.hero-text { text-align: center; }
.hero h1 { font: 700 clamp(44px, 9vw, 76px)/1.02 var(--head); letter-spacing: 0; }
#tagline { margin-top: 6px; font: 500 clamp(18px, 3.2vw, 24px)/1.2 var(--body); }
.spin-btn {
  margin-top: 18px; padding: 12px 26px; border: var(--line); border-radius: 18px; background: var(--sun);
  font: 700 21px/1.1 var(--head); box-shadow: 0 6px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.spin-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.spin-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.spin-hint { margin-top: 12px; font-size: 15px; color: var(--ink-soft); }

.sun { position: absolute; top: 22px; left: 5%; width: 84px; height: 84px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 16px rgba(255, 200, 61, .28), 0 0 0 34px rgba(255, 200, 61, .14); }
.cloud { position: absolute; width: 124px; height: 38px; border-radius: 40px; background: #fff; opacity: .92; }
.cloud::before, .cloud::after { content: ''; position: absolute; bottom: 12px; border-radius: 50%; background: #fff; }
.cloud::before { right: 20px; width: 56px; height: 56px; }
.cloud::after { left: 22px; width: 38px; height: 38px; }
.c1 { top: 40px; right: 5%; animation: drift 34s ease-in-out infinite alternate; }
.c2 { top: 136px; left: 13%; transform: scale(.7); animation: drift 44s ease-in-out infinite alternate-reverse; }
.c3 { top: 18px; left: 36%; transform: scale(.5); opacity: .7; animation: drift 52s ease-in-out infinite alternate; }
.hills { position: absolute; inset: auto 0 -1px; z-index: 1; width: 100%; height: 124px; }

@keyframes drift { from { margin-inline-start: -30px; } to { margin-inline-start: 50px; } }
@keyframes settle { from { transform: rotate(-30deg) translateY(-24px); opacity: 0; } to { transform: rotate(8deg); opacity: 1; } }
@keyframes whirl {
  0% { transform: rotate(8deg) rotateY(0); }
  70% { transform: rotate(-4deg) rotateY(1620deg); }
  85% { transform: rotate(12deg) rotateY(1760deg); }
  100% { transform: rotate(8deg) rotateY(1800deg); }
}
.logo.whirl { animation: whirl 1.5s cubic-bezier(.2, .7, .3, 1) both; }

/* ----- תוכן ----- */
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 44px; }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 24px; }
.tab { padding: 8px 20px; border: var(--line); border-radius: 14px; background: var(--paper); font: 600 18px/1.2 var(--head); transition: transform .12s, background .12s; }
.tab:hover { transform: translateY(-2px); }
.tab[aria-pressed='true'] { background: var(--ink); color: #fff; }

.search { display: block; max-width: 340px; margin: 0 auto 24px; }
.search input { width: 100%; padding: 10px 16px; border: var(--line); border-radius: 14px; background: var(--paper); font: inherit; color: inherit; }

.shelf { margin-bottom: 40px; --c: #3f7bf6; }
.shelf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.shelf-head h2 { padding: 4px 16px 5px; border-radius: 12px; background: var(--c); color: #fff; font: 700 25px/1.2 var(--head); transform: rotate(-1deg); }
.shelf-head::after { content: ''; flex: 1; height: 4px; border-radius: 4px; background: var(--c); opacity: .22; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px 22px; }

.card {
  position: relative; display: flex; flex-direction: column; border: var(--line); border-radius: 22px; overflow: hidden;
  background: var(--paper); box-shadow: 0 7px 0 var(--ink); transition: transform .14s, box-shadow .14s;
}
.card-link { display: flex; flex: 1; flex-direction: column; text-decoration: none; }
.grid .card:nth-child(3n + 1) { --tilt: -.6deg; }
.grid .card:nth-child(3n + 2) { --tilt: .5deg; }
.card:hover { transform: translateY(-4px) rotate(var(--tilt, 0deg)); box-shadow: 0 11px 0 var(--ink); }
.card:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.cover { aspect-ratio: 8 / 5; width: 100%; object-fit: cover; border-bottom: var(--line); background: var(--sky-light); transition: transform .3s; }
.cover-box { overflow: hidden; }
.card:hover .cover { transform: scale(1.04); }
.cover.blank { display: grid; place-items: center; background: var(--c); color: #fff; font: 700 54px/1 var(--head); }
.body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 12px 16px 16px; }
.title { font: 700 22px/1.2 var(--head); }
.desc { flex: 1; color: var(--ink-soft); font-size: 16px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { padding: 1px 10px; border-radius: 9px; background: var(--sky-light); font-size: 14px; font-weight: 500; }

.new { position: absolute; top: 10px; right: -3px; z-index: 2; padding: 3px 14px 4px 12px; border: var(--line); border-radius: 12px 0 0 12px; background: var(--coral); color: #fff; font: 700 17px/1.1 var(--head); }

.fav {
  position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px;
  border: var(--line); border-radius: 50%; background: var(--paper); padding: 0;
}
.fav svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; }
.fav[aria-pressed='true'] { background: #ffe1de; }
.fav[aria-pressed='true'] svg { fill: var(--coral); }

/* המשחק המומלץ */
.featured { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; margin-bottom: 40px; border: var(--line); border-radius: 26px; overflow: hidden; background: var(--sun); box-shadow: 0 8px 0 var(--ink); text-decoration: none; transition: transform .14s, box-shadow .14s; }
.featured:hover { transform: translateY(-3px); box-shadow: 0 11px 0 var(--ink); }
.featured:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--ink); }
.featured img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; border-inline-start: var(--line); }
.featured .info { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 22px 26px; }
.featured .label { font: 600 17px/1 var(--head); }
.featured h2 { font: 700 clamp(30px, 4.6vw, 44px)/1.08 var(--head); }
.featured p { line-height: 1.4; }
.featured .go { margin-top: 8px; padding: 9px 22px; border-radius: 14px; background: var(--ink); color: #fff; font: 700 19px/1.1 var(--head); }

/* שורות אישיות */
.row { display: flex; gap: 14px; padding: 2px 2px 10px; overflow-x: auto; scrollbar-width: thin; }
.mini { flex: 0 0 150px; border: var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); box-shadow: 0 4px 0 var(--ink); text-decoration: none; transition: transform .12s; }
.mini:hover { transform: translateY(-2px); }
.mini img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; border-bottom: var(--line); }
.mini span { display: block; padding: 6px 10px 7px; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { padding: 30px 0; text-align: center; color: var(--ink-soft); }

/* ----- הבטחה להורים ----- */
.promise { padding: 34px 16px 36px; background: var(--ink); color: #fff; text-align: center; }
.promise h2 { font: 700 30px/1.2 var(--head); }
.promise ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; max-width: 980px; margin: 22px auto; padding: 0; list-style: none; }
.promise strong { display: block; color: var(--sun); font: 600 21px/1.2 var(--head); }
.promise span { font-size: 15.5px; color: #d8def5; }
.parents-btn { padding: 9px 26px; border: 3px solid #fff; border-radius: 14px; background: transparent; color: #fff; font: 600 19px/1.1 var(--head); }
.parents-btn:hover { background: #fff; color: var(--ink); }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; padding: 14px 16px; background: var(--ink); border-top: 1px solid #36447f; color: #c9d1ee; font-size: 14.5px; }
.link-btn { padding: 2px; border: 0; background: none; color: inherit; text-decoration: underline; }

/* ----- בחירת הסביבון ----- */
.pick { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 16px; background: rgba(29, 42, 91, .88); color: #fff; animation: fade .2s both; }
.pick[hidden] { display: none; }
.pick img { width: min(420px, 88vw); aspect-ratio: 8 / 5; object-fit: cover; border: 4px solid #fff; border-radius: 22px; animation: pop .4s cubic-bezier(.2, 1.5, .4, 1) both; }
.pick p { font: 700 30px/1.2 var(--head); text-align: center; }
@keyframes pop { from { transform: scale(.6) rotate(-6deg); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ----- סגור בשבת ובחג ----- */
.locked > :not(.lock) { display: none !important; }
.lock { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: linear-gradient(#1d2a5b, #3b3f8f 70%, #7c5c9e); color: #fff; text-align: center; }
.lock[hidden] { display: none; }
.lock-card { display: grid; justify-items: center; gap: 10px; max-width: 520px; }
.lock h1 { font: 700 clamp(44px, 9vw, 68px)/1.1 var(--head); color: var(--sun); }
.lock p { font-size: 20px; line-height: 1.5; }

/* ----- להורים ----- */
.parents { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 20px 24px 26px; border: var(--line); border-radius: 22px; background: var(--cream); color: var(--ink); }
.parents::backdrop { background: rgba(29, 42, 91, .6); }
.parents h2 { font: 700 30px/1.2 var(--head); }
.parents h3 { margin-top: 20px; font: 600 21px/1.2 var(--head); }
.parents p { margin-top: 4px; }
.close-row { float: left; }
.close { width: 38px; height: 38px; border: var(--line); border-radius: 50%; background: var(--paper); font-weight: 700; }
.gate form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.gate label { font-size: 22px; font-weight: 700; }
.gate input { width: 80px; padding: 6px 10px; border: var(--line); border-radius: 10px; font: inherit; text-align: center; }
.err { color: #c6302a; font-weight: 500; }
.primary { display: inline-block; padding: 9px 22px; border: var(--line); border-radius: 13px; background: var(--sun); font: 600 18px/1.2 var(--head); text-decoration: none; box-shadow: 0 4px 0 var(--ink); }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.contact { display: grid; gap: 10px; margin-top: 8px; }
.contact label { display: grid; gap: 3px; font-weight: 500; }
.contact input:not(.vh), .contact textarea { width: 100%; padding: 9px 12px; border: var(--line); border-radius: 10px; background: var(--paper); font: inherit; color: inherit; }
.contact .primary { justify-self: start; }
.status { min-height: 1.5em; font-weight: 500; }

@media (max-width: 680px) {
  .hero { padding: 20px 16px 96px; }
  .hero-in { gap: 12px; }
  .logo { width: 86px; }
  .sun { top: -20px; left: -24px; width: 64px; height: 64px; }
  .c1 { top: auto; bottom: 86px; right: -46px; transform: scale(.6); }
  .c2, .c3 { display: none; }
  .hills { height: 92px; }
  .spin-btn { font-size: 19px; padding: 11px 20px; }
  .featured { grid-template-columns: 1fr; }
  .featured img { min-height: 0; aspect-ratio: 8 / 5; border-inline-start: 0; border-bottom: var(--line); }
  .featured .info { padding: 16px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
