/* משחק צביעה - עיצוב */
:root {
  --ink: #3d3d5c;
  --muted: #7a6a8a;
  --pink: #f06595;
  --pink-dark: #d6336c;
  --purple: #9775fa;
  --yellow: #ffd43b;
  --radius: 24px;
  --shadow: 0 6px 0 rgba(0, 0, 0, .06), 0 10px 24px rgba(120, 60, 120, .14);
  --cur: #ff8fc7;
  font-family: "Varela Round", "Arial Hebrew", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, .8) 0 2px, transparent 3px) 0 0 / 46px 46px,
    linear-gradient(180deg, #ffe3f1 0%, #f3e8ff 50%, #e3f6ff 100%) fixed;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- עמוד ראשי ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 14px 14px 32px; text-align: center; }
.home-head { position: relative; }
.home-head h1 { font-size: clamp(38px, 10vw, 64px); margin: 2px 0 0; color: var(--pink-dark); text-shadow: 0 4px 0 #fff; }
.home-head p { margin: 0 0 8px; font-size: clamp(18px, 4.6vw, 24px); color: var(--muted); }
.home-head .btn-icon { position: absolute; top: 2px; inset-inline-start: 0; }
.home-icons { font-size: clamp(30px, 8vw, 46px); display: flex; justify-content: center; gap: 6px; }
.home-icons span { animation: bob 2.6s ease-in-out infinite; }
.home-icons span:nth-child(2) { animation-delay: .3s; }
.home-icons span:nth-child(3) { animation-delay: .6s; }
.home-icons span:nth-child(4) { animation-delay: .9s; }
.home-icons span:nth-child(5) { animation-delay: 1.2s; }
@media (max-width: 600px) { .home-head .btn-icon { width: 46px; height: 46px; font-size: 22px; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 420px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.thumb {
  background: #fff; border: 4px solid #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 8px 4px; display: flex; flex-direction: column; align-items: center; transition: transform .15s;
}
.thumb svg { width: 100%; aspect-ratio: 1; display: block; pointer-events: none; }
.thumb:hover, .thumb:focus-visible { transform: translateY(-4px) rotate(-1.5deg); border-color: #fcc2d7; }
.thumb:active { transform: scale(.96); }
.thumb-name { font-size: 20px; font-weight: bold; padding: 2px 0 4px; }
.home-foot { margin-top: 26px; color: var(--muted); font-size: 15px; line-height: 2.1; }
.voice-check-btn {
  padding: 10px 22px; font-size: 20px; border-radius: 999px; border: 3px solid #fcc2d7; background: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .06); margin-bottom: 6px;
}
.other-site { color: var(--pink-dark); font-size: 18px; }
.check-result { font-weight: bold; min-height: 1.5em; }
.tips { text-align: start; font-size: 17px; line-height: 1.6; margin: 10px 0; padding-inline-start: 22px; color: var(--muted); }

/* ---------- כפתורים ---------- */
.btn-icon {
  width: 56px; height: 56px; flex: none; border-radius: 50%; border: none; background: #fff0f6;
  font-size: 28px; display: grid; place-items: center; text-decoration: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .08);
}
.btn-start {
  margin-top: 12px; padding: 14px 34px; font-size: 26px; font-weight: bold; color: #fff;
  background: var(--pink); border: none; border-radius: 999px; box-shadow: 0 6px 0 var(--pink-dark);
}
.btn-secondary {
  display: inline-block; margin-top: 12px; padding: 12px 26px; font-size: 22px; color: var(--ink); border: none;
  background: #f3f0ff; border-radius: 999px; text-decoration: none; box-shadow: 0 5px 0 #d0bfff;
}

/* ---------- מסך הצביעה ---------- */
.paint { max-width: 1200px; margin: 0 auto; padding: 8px 8px 20px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px;
  background: rgba(255, 255, 255, .92); border-radius: var(--radius); box-shadow: var(--shadow);
}
.paint-title { margin: 0; font-size: clamp(24px, 6.5vw, 34px); color: var(--pink-dark); }
.paint-body { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.art-wrap { position: relative; width: min(96vw, calc(100vh - 330px), 640px); width: min(96vw, calc(100dvh - 330px), 640px); min-width: 250px; }
.art {
  display: block; width: 100%; aspect-ratio: 1; background: #fff; border-radius: 26px; box-shadow: var(--shadow);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.art-wrap.brush .art { cursor: crosshair; }
.side { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 640px; }

.tools { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tool {
  display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 62px; padding: 6px 8px 4px;
  border: 3px solid transparent; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .07);
}
.tool-i { font-size: 30px; line-height: 1.1; }
.tool-t { font-size: 14px; color: var(--muted); }
.tool.on { border-color: var(--pink); background: #fff0f6; }
.tool.on .tool-i { animation: bob 1.6s ease-in-out infinite; }
.tool:active { transform: scale(.94); }

.palette {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 8px; width: 100%;
  background: rgba(255, 255, 255, .85); padding: 10px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.swatch {
  aspect-ratio: 1; width: 100%; max-width: 64px; justify-self: center; border-radius: 50%;
  border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .12), 0 4px 0 rgba(0, 0, 0, .1); transition: transform .12s;
}
.swatch.on { transform: scale(1.18); box-shadow: 0 0 0 4px var(--ink), 0 6px 10px rgba(0, 0, 0, .2); }
.swatch:active { transform: scale(.92); }

/* מסך רחב (מחשב, טאבלט לרוחב): הציור בצד אחד, הצבעים בצד השני */
@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  .paint-body { flex-direction: row; justify-content: center; align-items: flex-start; gap: 16px; }
  .art-wrap { width: min(calc(100vh - 110px), calc(100vw - 400px), 760px); width: min(calc(100dvh - 110px), calc(100vw - 400px), 760px); }
  .side { width: 350px; flex: none; }
  .palette { grid-template-columns: repeat(5, 1fr); }
}

/* כוכב גדול כשמסיימים ציור */
.wow {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: min(24vw, 130px); animation: wow 1.3s ease-out forwards;
}
/* נצנוץ במקום שצבענו */
.spark {
  position: fixed; z-index: 30; pointer-events: none; font-size: 22px; translate: -50% -50%;
  animation: spark .75s ease-out forwards; text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

/* ---------- חלון ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(214, 51, 108, .28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.overlay-card {
  background: #fff; border-radius: 28px; padding: 22px 20px; max-width: 520px; width: 100%; max-height: 100%; overflow: auto;
  text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); animation: pop .35s;
}
.big-icon { font-size: 72px; line-height: 1.1; }
.overlay-card h2 { font-size: 34px; margin: 4px 0; }
.overlay-card p { font-size: 21px; line-height: 1.5; margin: 8px 0; }

.voice-note { background: #fff3bf; color: #5c3c00; padding: 10px 14px; text-align: center; font-size: 17px; border-bottom: 3px solid var(--yellow); }

/* ---------- קונפטי ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards; }

/* ---------- אנימציות ---------- */
@keyframes pop { 0% { scale: .6; opacity: 0; } 70% { scale: 1.1; opacity: 1; } 100% { scale: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes fall { to { top: 105%; rotate: 540deg; } }
@keyframes wow { 0% { scale: .2; opacity: 0; } 25% { scale: 1.1; opacity: .95; } 60% { scale: 1; opacity: .9; rotate: 12deg; } 100% { scale: 1.2; opacity: 0; translate: 0 -40%; } }
@keyframes spark { from { opacity: 1; transform: translate(0, 0) scale(.6); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
