/* מילולי · עיצוב משותף */
:root {
  --bg: #FBF7F1;
  --bg-2: #F3EEFF;
  --card: #FFFFFF;
  --ink: #1E2145;
  --ink-2: #3D4170;
  --muted: #5F6286;
  --line: #E8E3F3;
  --brand: #5B5BD6;
  --brand-ink: #4343B8;
  --brand-soft: #ECECFF;
  --coral: #FF7A59;
  --coral-soft: #FFE9E2;
  --mint: #22B391;
  --mint-soft: #DDF7EE;
  --sun: #FFBF3C;
  --sun-soft: #FFF3D6;
  --pink: #EC4899;
  --danger: #C5282F;
  --danger-soft: #FFE5E6;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(30, 33, 69, .05), 0 8px 24px -8px rgba(30, 33, 69, .12);
  --shadow-lg: 0 2px 4px rgba(30, 33, 69, .05), 0 24px 48px -16px rgba(30, 33, 69, .22);
  --font: 'Rubik', 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --emoji: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.15em; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-coral { background: var(--coral); color: var(--ink); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--coral) 70%, transparent); }
.btn-mint { background: var(--mint); color: var(--ink); }
.btn-outline { border-color: var(--line); background: var(--card); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: .3em .85em; font-size: .875rem; }
.btn-lg { min-height: 54px; padding: .7em 1.6em; font-size: 1.1rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }

/* ---------- טפסים ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: .55em .9em; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.check { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #D9D6E8; transition: .2s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--mint); }
.switch input:checked + i::after { right: 23px; }
.switch input:focus-visible + i { outline: 3px solid var(--brand-soft); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 16px; background: var(--bg-2); }
.seg button { border: 0; background: transparent; padding: .45em .95em; border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--ink-2); min-height: 38px; }
.seg button.on { background: #fff; color: var(--brand-ink); box-shadow: var(--shadow); }

.chip { display: inline-flex; align-items: center; gap: .35em; padding: .2em .7em; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-size: .8rem; font-weight: 600; }
.chip.mint { background: var(--mint-soft); color: #11795F; }
.chip.coral { background: var(--coral-soft); color: #A8360A; }
.chip.sun { background: var(--sun-soft); color: #9A6100; }
.chip.gray { background: #F0EEF5; color: var(--muted); }

/* ---------- כרטיסים ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }

/* ---------- תמונות מילים ---------- */
.pic-emoji { font-family: var(--emoji); line-height: 1; display: inline-block; }
.pic-img { object-fit: contain; display: block; }
.pic-multi { display: inline-flex; align-items: center; justify-content: center; gap: .08em; line-height: 1; }
.pic-multi .pic-emoji { font-size: 1em; }
.pic-multi.n2 .pic-emoji { font-size: .78em; }
.pic-multi.n3 .pic-emoji { font-size: .62em; }
.pic-letter { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: .32em; background: linear-gradient(140deg, var(--brand-soft), var(--coral-soft)); line-height: 1; }
.pic-letter span { font-size: .62em; font-weight: 800; color: var(--brand-ink); font-family: var(--font); }
.hl { color: var(--coral); text-decoration: underline; text-decoration-thickness: .12em; text-underline-offset: .18em; }

/* ---------- חלונות ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 26px; box-shadow: var(--shadow-lg); max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--card); color: var(--ink); }
dialog.modal::backdrop { background: rgba(30, 33, 69, .45); backdrop-filter: blur(4px); }
.modal-body { padding: 26px; max-height: calc(100vh - 80px); overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; margin-top: 18px; }

.login-card { padding: 34px 28px 26px; text-align: center; display: grid; gap: 12px; }
.login-badge { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 4px; display: grid; place-items: center; font-size: 36px; font-family: var(--emoji); background: linear-gradient(135deg, var(--brand-soft), var(--coral-soft)); }
.login-card h2 { margin: 0; }
.login-card p { margin: 0; }
.code-input { font-size: 2rem; text-align: center; letter-spacing: .35em; padding: .3em; border-radius: 16px; border: 2px solid var(--line); direction: ltr; }
.code-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.login-err { color: var(--danger); min-height: 1.4em; font-size: .9rem; }
.login-card .check { justify-content: center; color: var(--muted); font-size: .9rem; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* ---------- הודעות ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .25s ease; }
.toast.error { background: var(--danger); }
.toast.ok { background: #0F7F68; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- קונפטי ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti-layer i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }

/* ---------- חסום ---------- */
.blocked { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.blocked-card { text-align: center; background: var(--card); border-radius: 28px; padding: 40px 28px; box-shadow: var(--shadow-lg); max-width: 420px; }
.blocked-card .big { font-size: 64px; font-family: var(--emoji); }

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

/* לוגו קטן בראש מסכי המשחקים */
.brand-mini img { height: 26px; width: auto; display: block; opacity: .95; }
.brand-mini:hover img { opacity: 1; }
