:root {
  --bg: #f6f4ff;
  --ink: #24213a;
  --muted: #6b6785;
  --primary: #6c4cf1;
  --primary-dark: #5237d1;
  --accent: #ff6b9a;
  --card: #ffffff;
  --soft: #f0ecff;
  --ok: #2fbf71;
  --bad: #e5484d;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(60, 40, 140, 0.12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', 'Heebo', Arial, 'Noto Sans Hebrew', sans-serif;
  line-height: 1.55;
  font-size: 17px;
}
a { color: var(--primary); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* כותרת עליונה */
.site-header { background: linear-gradient(120deg, #6c4cf1, #a24cf1 60%, #ff6b9a); color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.logo { color: #fff; font-size: 1.6rem; font-weight: 800; text-decoration: none; }
.nav { display: flex; gap: 16px; }
.nav a { color: #fff; text-decoration: none; font-weight: 600; opacity: 0.95; }
.nav a:hover { text-decoration: underline; }

/* דף הבית */
.hero { text-align: center; padding: 28px 0 10px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.hero p { margin: 0; color: var(--muted); }
.cat { margin: 26px 0; }
.cat h2 { font-size: 1.3rem; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.12s; }
.card:hover { transform: translateY(-3px); }
.thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; }
.thumb-emoji { font-size: 3.2rem; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18)); }
.card-title { font-weight: 800; padding: 10px 12px 0; }
.card-sub { color: var(--muted); font-size: 0.85rem; padding: 2px 12px 12px; }
.about-box, .how, .page-text { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin: 22px 0; }
.page-text { margin-top: 24px; }
.page-text h1, .how h2, .about-box h2 { margin-top: 0; }

/* מסגרת פרסומת */
.ad { margin: 18px auto; min-height: 90px; text-align: center; }
.ad-placeholder { border: 2px dashed #c9c1f5; border-radius: 12px; color: #a39bd3; display: flex; align-items: center; justify-content: center; background: #faf9ff; }

/* עמוד משחק */
.crumbs { margin: 14px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.game-h1 { margin: 6px 0 12px; text-align: center; font-size: clamp(1.5rem, 5vw, 2rem); }
.game-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; max-width: 640px; margin: 0 auto; }
.game { position: relative; }
.how ul { padding-inline-start: 22px; }

/* כפתורים ונתונים */
.btn { display: inline-block; text-decoration: none; font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 9px 18px; background: var(--primary); color: #fff; cursor: pointer; touch-action: manipulation; }
.btn:hover { background: var(--primary-dark); }
.btn.alt { background: var(--soft); color: var(--primary-dark); }
.btn.alt:hover { background: #e4ddff; }
.btn.small { padding: 6px 14px; font-size: 0.92rem; }
.btn.active { background: var(--primary); color: #fff; }
.btn:disabled { opacity: 0.3; cursor: default; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.stat { background: var(--soft); border-radius: 12px; padding: 4px 14px; font-weight: 700; }
.ltr { direction: ltr; }
.overlay { position: absolute; inset: 0; background: rgba(36, 33, 58, 0.82); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; border-radius: 14px; z-index: 5; }
.overlay .big { font-size: 1.7rem; font-weight: 800; }

/* זיכרון */
.mem-wrap { position: relative; }
.mem-board { display: grid; gap: 8px; }
.mem-card { aspect-ratio: 1; border: 0; border-radius: 12px; background: linear-gradient(135deg, #8e6cff, #ff8fb5); font-size: clamp(1.4rem, 7vw, 2.6rem); cursor: pointer; padding: 0; touch-action: manipulation; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); }
.mem-card .mem-face { visibility: hidden; }
.mem-card.open, .mem-card.done { background: #fff; box-shadow: inset 0 0 0 3px var(--soft); }
.mem-card.open .mem-face, .mem-card.done .mem-face { visibility: visible; }
.mem-card.done { background: #eafaf1; box-shadow: inset 0 0 0 3px #b9ecd0; }

/* נחש */
.snake-wrap { position: relative; width: fit-content; margin: 0 auto; }
.snake-canvas { display: block; border-radius: 12px; touch-action: none; background: #e9fbe9; }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; justify-content: center; margin: 12px auto 0; direction: ltr; }
.dpad button { font-size: 1.4rem; border: 0; border-radius: 14px; background: var(--soft); color: var(--primary-dark); cursor: pointer; touch-action: manipulation; }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* 2048 */
.g2048 { position: relative; max-width: 420px; margin: 0 auto; }
.g2048-board { direction: ltr; touch-action: none; background: #cfc6ff; border-radius: 12px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(1.3rem, 7vw, 2.1rem); background: #e6e0ff; color: #4a3f8f; }
.tile.pop { animation: pop 0.18s ease-out; }
@keyframes pop { from { transform: scale(0.4); } to { transform: scale(1); } }
.t-2 { background: #ffffff; color: #6c4cf1; } .t-4 { background: #f1e9ff; color: #6c4cf1; }
.t-8 { background: #ffd6e7; color: #b8265f; } .t-16 { background: #ffb3d1; color: #9c1a4d; }
.t-32 { background: #ff8fb8; color: #fff; } .t-64 { background: #ff6b9a; color: #fff; }
.t-128 { background: #b79cff; color: #fff; font-size: clamp(1.1rem, 6vw, 1.8rem); }
.t-256 { background: #9b7dff; color: #fff; font-size: clamp(1.1rem, 6vw, 1.8rem); }
.t-512 { background: #7c5cf5; color: #fff; font-size: clamp(1.1rem, 6vw, 1.8rem); }
.t-1024 { background: #5b3ee0; color: #fff; font-size: clamp(0.95rem, 5vw, 1.5rem); }
.t-2048 { background: linear-gradient(135deg, #ffb703, #ff6b9a); color: #fff; font-size: clamp(0.95rem, 5vw, 1.5rem); }
.t-big { background: #24213a; color: #fff; font-size: clamp(0.85rem, 4.4vw, 1.3rem); }

/* איקס עיגול */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 12px auto; direction: ltr; }
.ttt-cell { aspect-ratio: 1; font: inherit; font-size: clamp(2.2rem, 13vw, 3.6rem); font-weight: 800; border: 0; border-radius: 14px; background: var(--soft); cursor: pointer; touch-action: manipulation; }
.ttt-cell:disabled { cursor: default; }
.ttt-cell.x { color: var(--primary); }
.ttt-cell.o { color: var(--accent); }
.ttt-cell.win { background: #d9f7e6; }
.ttt-status { text-align: center; font-weight: 800; font-size: 1.15rem; min-height: 1.8em; }

/* תפוס את החפרפרת */
.whack-wrap { position: relative; }
.whack-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 380px; margin: 12px auto; }
.hole { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 70%, #7a5530, #3b2713); cursor: pointer; touch-action: manipulation; }
.hole .mole { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(2.4rem, 13vw, 4rem); transform: translateY(105%); transition: transform 0.07s; }
.hole.up .mole { transform: translateY(0); }
.hole.hit { background: radial-gradient(circle at 50% 70%, #ffd166, #f4a261); }

/* סדרו את האותיות */
.sc-emoji { font-size: 5rem; text-align: center; line-height: 1.1; margin-top: 4px; }
.sc-answer { display: flex; gap: 8px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.sc-slot { width: 52px; height: 58px; border-radius: 12px; border: 3px dashed #cfc6ff; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 800; color: var(--primary-dark); }
.sc-slot.filled { border-style: solid; background: var(--soft); }
.sc-answer.ok .sc-slot { border-color: var(--ok); background: #e4f8ec; color: #1b8a50; }
.sc-answer.bad { animation: shake 0.4s; }
.sc-answer.bad .sc-slot { border-color: var(--bad); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.sc-tiles { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.sc-tile { width: 54px; height: 58px; font: inherit; font-size: 1.9rem; font-weight: 800; border: 0; border-radius: 12px; background: var(--primary); color: #fff; cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.sc-tile:disabled { opacity: 0.2; cursor: default; box-shadow: none; }

/* תחתית */
.site-footer { margin-top: 40px; padding: 20px 0 30px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 4px 0; }

/* ---- עיצוב פורטל ---- */
.site-header { position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 14px rgba(60, 40, 140, 0.25); }
.hero2 { background: linear-gradient(135deg, #6c4cf1, #a24cf1 55%, #ff6b9a); color: #fff; text-align: center; padding: 26px 16px 30px; border-radius: 0 0 30px 30px; box-shadow: 0 10px 30px rgba(108, 76, 241, 0.25); }
.hero2 h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 5.5vw, 2.6rem); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.hero2 p { margin: 0; opacity: 0.95; }
.search { display: flex; gap: 8px; max-width: 540px; margin: 18px auto 0; }
.search input { flex: 1; min-width: 0; border: 0; border-radius: 14px; padding: 12px 16px; font: inherit; color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
.search .btn { background: #24213a; white-space: nowrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.chip { border: 0; border-radius: 999px; padding: 7px 16px; font: inherit; font-weight: 700; background: rgba(255, 255, 255, 0.22); color: #fff; cursor: pointer; }
.chip:hover { background: rgba(255, 255, 255, 0.35); }
.chip.active { background: #fff; color: var(--primary-dark); }
.cat h2 { display: flex; align-items: center; gap: 8px; }
.cat h2::before { content: ''; width: 6px; height: 1.2em; border-radius: 4px; background: linear-gradient(var(--primary), var(--accent)); }
.thumb { position: relative; overflow: hidden; }
.thumb::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.6), transparent 42%), radial-gradient(circle at 88% 92%, rgba(255, 255, 255, 0.38), transparent 46%); }
.thumb::after { content: '▶'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(36, 33, 58, 0.45); color: #fff; font-size: 2rem; opacity: 0; transition: opacity 0.15s; }
.card:hover .thumb::after { opacity: 1; }
.thumb-emoji { position: relative; font-size: 3.6rem; }
.badge { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; background: #ff3d71; color: #fff; font-size: 0.72rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.card { box-shadow: 0 4px 14px rgba(60, 40, 140, 0.12); }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(60, 40, 140, 0.22); }
.none { text-align: center; color: var(--muted); padding: 30px 0; }
.snd { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 6; border: 0; background: var(--soft); border-radius: 12px; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; }
.game-box { position: relative; }
.footer-cats { margin: 6px 0 10px; }
.footer-cats a { margin: 0 8px; }

/* ---- אימוג'י תלת־ממדי ---- */
.em { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.em-thumb { width: 4.2rem; height: 4.2rem; vertical-align: middle; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22)); transition: transform 0.15s; }
.card:hover .em-thumb { transform: scale(1.12) rotate(-4deg); }
.em-h1 { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.mem-face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.mem-face .em { width: 72%; height: 72%; vertical-align: middle; }
.sc-emoji .em { width: 5.2rem; height: 5.2rem; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18)); }
.hm-balloons .em { width: 2.4rem; height: 2.4rem; }
.rps-hand .em { width: clamp(4.2rem, 20vw, 6rem); height: clamp(4.2rem, 20vw, 6rem); vertical-align: middle; }
.rps-e .em { width: 2.8rem; height: 2.8rem; vertical-align: middle; }
.license { white-space: pre-wrap; background: var(--soft); border-radius: 12px; padding: 14px; font-size: 0.85rem; overflow-x: auto; }

/* ---- קנבס ---- */
.cv-wrap { position: relative; width: 100%; max-width: 360px; margin: 0 auto; }
.cv { display: block; width: 100%; height: auto; border-radius: 14px; touch-action: none; background: #fff; }

/* ---- תפוס את המילה ---- */
.hm-balloons { display: flex; justify-content: center; gap: 6px; font-size: 2.2rem; margin: 6px 0; }
.hm-balloons span { transition: opacity 0.2s, transform 0.2s; }
.hm-balloons .popped { opacity: 0.35; transform: scale(0.8); }
.hm-hint { text-align: center; color: var(--muted); font-weight: 700; margin: 4px 0; }
.hm-word { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.hm-slot { width: 44px; height: 54px; border-bottom: 4px solid #cfc6ff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.hm-slot.on { border-color: var(--ok); }
.hm-slot.lost { color: var(--bad); border-color: var(--bad); }
.hm-kb { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.hm-key { width: 44px; height: 46px; font: inherit; font-size: 1.25rem; font-weight: 800; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; touch-action: manipulation; }
.hm-key.good { background: var(--ok); }
.hm-key.bad { background: #c9c3e6; color: #8d87ad; }
.hm-key:disabled { cursor: default; }

/* ---- אבן נייר ומספריים ---- */
.rps-arena { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.rps-side { text-align: center; }
.rps-label { font-weight: 700; color: var(--muted); }
.rps-hand { font-size: clamp(3.5rem, 18vw, 5.5rem); line-height: 1.1; }
.rps-hand.shake { animation: rpsShake 0.18s infinite alternate; }
@keyframes rpsShake { from { transform: translateY(-10px) rotate(-8deg); } to { transform: translateY(8px) rotate(8deg); } }
.rps-vs { font-weight: 800; color: var(--muted); }
.rps-btns { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.rps-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-weight: 700; border: 0; border-radius: 16px; padding: 10px 16px; min-width: 92px; background: var(--soft); color: var(--primary-dark); cursor: pointer; touch-action: manipulation; }
.rps-btn:hover:not(:disabled) { background: #e4ddff; }
.rps-btn:disabled { opacity: 0.4; cursor: default; }
.rps-e { font-size: 2.4rem; }

/* ---- חשבון מהיר ---- */
.mwrap { position: relative; }
.mq { text-align: center; font-size: clamp(2rem, 11vw, 3rem); font-weight: 800; margin: 10px 0 14px; color: var(--primary-dark); }
.mopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 360px; margin: 0 auto; }
.mopt { font: inherit; font-size: 1.7rem; font-weight: 800; padding: 16px 0; border: 0; border-radius: 16px; background: var(--soft); color: var(--primary-dark); cursor: pointer; touch-action: manipulation; }
.mopt:hover:not(:disabled) { background: #e4ddff; }
.mopt.good { background: var(--ok); color: #fff; }
.mopt.bad { background: var(--bad); color: #fff; }

/* ---- פאזל הזזה ---- */
.sl-wrap { position: relative; max-width: 380px; margin: 0 auto; }
.sl-board { display: grid; gap: 6px; background: #cfc6ff; padding: 8px; border-radius: 14px; }
.sl-tile, .sl-blank { aspect-ratio: 1; border-radius: 10px; }
.sl-tile { font: inherit; font-size: clamp(1.4rem, 8vw, 2.2rem); font-weight: 800; border: 0; background: linear-gradient(135deg, #8e6cff, #ff8fb5); color: #fff; cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); }
.sl-tile.ok { background: linear-gradient(135deg, #2fbf71, #6adf9f); }
.sl-blank { background: rgba(255, 255, 255, 0.35); }

/* ---- זכרו את הרצף ---- */
.sq-wrap { position: relative; max-width: 340px; margin: 0 auto; }
.sq-pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sq-pad { aspect-ratio: 1; border: 0; border-radius: 22px; background: var(--c); opacity: 0.55; cursor: pointer; touch-action: manipulation; transition: opacity 0.08s, transform 0.08s, box-shadow 0.08s; }
.sq-pad.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 28px var(--c); }

/* ---- שולה מוקשים ---- */
.ms-wrap { position: relative; max-width: 380px; margin: 0 auto; }
.ms-board { display: grid; gap: 3px; background: #b9b3da; padding: 6px; border-radius: 12px; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ms-cell { aspect-ratio: 1; padding: 0; font: inherit; font-size: clamp(0.9rem, 4.2vw, 1.25rem); font-weight: 800; border: 0; border-radius: 6px; background: linear-gradient(135deg, #8e6cff, #a995ff); color: #fff; cursor: pointer; }
.ms-cell.open { background: #f4f1ff; cursor: default; }
.ms-cell.mine { background: #ffe1e6; }
.ms-cell.boom { background: #ff9aa9; }
.ms-cell.n1 { color: #2d6cdf; } .ms-cell.n2 { color: #1f9d55; } .ms-cell.n3 { color: #e5484d; } .ms-cell.n4 { color: #6c2bd9; }
.ms-cell.n5 { color: #b3541e; } .ms-cell.n6 { color: #0e9aa7; } .ms-cell.n7 { color: #24213a; } .ms-cell.n8 { color: #6b6785; }

/* ---- ארבע בשורה ---- */
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; background: #3b4cca; padding: 8px; border-radius: 16px; direction: ltr; max-width: 420px; margin: 10px auto; }
.c4-col { display: flex; flex-direction: column; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 10px; touch-action: manipulation; }
.c4-col:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.c4-col:disabled { cursor: default; }
.c4-cell { aspect-ratio: 1; border-radius: 50%; background: #e8ecff; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.25); }
.c4-cell.p { background: #ff5a7a; }
.c4-cell.c { background: #ffd23f; }
.c4-cell.win { box-shadow: 0 0 0 4px #fff inset; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .game-box { padding: 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb-emoji { font-size: 2.8rem; }
  .search { flex-direction: column; }
  .hm-slot { width: 36px; height: 48px; font-size: 1.7rem; }
  .hm-key { width: 38px; height: 44px; font-size: 1.1rem; }
}
