/* landing.css — דף הבית: בית ספר ← קבוצה ← סיסמה */
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 16px 20px 6px; max-width: 900px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-text); font-size: 1.45rem; }
.brand .logo-mark { transition: transform var(--t-med) var(--spring); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
/* minmax(0, 1fr): בלי זה, רכיב אחד רחב (שורת השלבים, שם ארוך) מרחיב את כל הדף בטלפונים צרים */
main { max-width: 800px; margin: 0 auto; padding: 8px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
main > * { animation: rise 420ms var(--ease) both; }
main > *:nth-child(2) { animation-delay: 50ms } main > *:nth-child(3) { animation-delay: 100ms } main > *:nth-child(4) { animation-delay: 150ms } main > *:nth-child(n+5) { animation-delay: 200ms }

/* פעם ראשונה כאן? */
.hello { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff4cf; border: 2px solid #f1d27a; border-radius: 6px 16px 16px 16px; padding: 10px 14px; color: #33290a; font-size: .95rem; }
.hello .grow { flex: 1 1 190px; }
.hello-wave { font-size: 1.5rem; display: inline-block; transform-origin: 70% 80%; animation: wiggle 1.1s ease-in-out 3; }
.hello-x { background: none; border: none; width: 38px; height: 38px; border-radius: 50%; color: #7a5a00; display: grid; place-items: center; }
.hello-x:hover { background: rgba(0,0,0,.07); }

/* שלבי הכניסה */
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; align-items: center; gap: 0; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--c-muted); font-weight: 800; font-size: .92rem; flex: 0 0 auto; min-width: 0; transition: color var(--t-med); }
.steps li + li { flex: 0 1 auto; }
.steps li + li::before { content: ''; flex: 1 1 0; min-width: 8px; max-width: 56px; height: 3px; border-radius: 2px; background: var(--c-border); margin: 0 10px; transition: background var(--t-med); }
.steps li b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c-surface); border: 2px solid var(--c-border); font-family: var(--font-display); font-weight: 400; font-size: 1rem; transition: background var(--t-med), border-color var(--t-med), color var(--t-med), transform var(--t-med) var(--spring); }
/* המילים לא מתקצרות; מה שמתכווץ במסך צר הוא הקו שבין השלבים */
.steps li span { white-space: nowrap; flex-shrink: 0; }
.steps li.on { color: var(--c-text); }
.steps li.on b { background: var(--c-primary); border-color: var(--c-primary); color: #fff; transform: scale(1.12); }
.steps li.done { color: var(--c-primary); }
.steps li.done b { background: var(--c-accent); border-color: var(--c-primary); color: var(--c-primary); }
.steps li.done + li::before, .steps li.on + li.on::before { background: var(--c-primary); }
.steps li.done + li::before { background: var(--c-primary); }

.panel-hero { display: grid; grid-template-columns: 1fr 250px; gap: 22px; align-items: center; padding: 26px 26px 24px; position: relative; }
.panel-teams { grid-template-columns: 1fr; }
.hero-text { min-width: 0; }
.panel-hero h1 { font-size: clamp(1.6rem, 4.4vw, 2.15rem); margin: 0 0 4px; line-height: 1.2; overflow-wrap: anywhere; }
.panel-hero .lead { color: var(--c-muted); margin: 0 0 16px; font-size: 1.02rem; }
.search-wrap { position: relative; text-align: right; }
.search-wrap .input-lg { padding-right: 48px; }
.search-wrap .search-icon { position: absolute; right: 16px; top: 18px; color: var(--c-muted); pointer-events: none; transition: color var(--t-fast), transform var(--t-med) var(--spring); }
.search-wrap:focus-within .search-icon { color: var(--c-primary); transform: scale(1.15) rotate(-8deg); }

/* הציור: שולחן המשחק מלמעלה */
.field { width: 100%; height: auto; }
.f-table { fill: var(--c-bg); stroke: var(--c-border); stroke-width: 3; }
.f-home { fill: none; stroke: var(--c-primary); stroke-width: 3; stroke-dasharray: 6 6; opacity: .55; }
.f-route { fill: none; stroke: var(--c-secondary); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 2 9; animation: route-flow 1.2s linear infinite; }
@keyframes route-flow { to { stroke-dashoffset: -22 } }
.f-m circle { fill: var(--c-surface); stroke: var(--c-border); stroke-width: 3; }
.f-m path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.f-m { transform-box: fill-box; transform-origin: center; }
.f-m1 { animation: m-pop 8s linear infinite; } .f-m1 circle { animation: m-fill 8s linear infinite; } .f-m1 path { animation: m-tick 8s linear infinite; }
.f-m2 { animation: m-pop 8s linear 1.9s infinite; } .f-m2 circle { animation: m-fill 8s linear 1.9s infinite; } .f-m2 path { animation: m-tick 8s linear 1.9s infinite; }
.f-m3 { animation: m-pop 8s linear 3.7s infinite; } .f-m3 circle { animation: m-fill 8s linear 3.7s infinite; } .f-m3 path { animation: m-tick 8s linear 3.7s infinite; }
@keyframes m-pop { 0%, 24% { transform: scale(1) } 27% { transform: scale(1.3) } 31%, 100% { transform: scale(1) } }
@keyframes m-fill { 0%, 25% { fill: var(--c-surface); stroke: var(--c-border) } 27%, 92% { fill: var(--c-leaf); stroke: var(--c-leaf) } 96%, 100% { fill: var(--c-surface); stroke: var(--c-border) } }
@keyframes m-tick { 0%, 25% { opacity: 0 } 27%, 92% { opacity: 1 } 96%, 100% { opacity: 0 } }
.f-bot { offset-path: path('M244 138 C204 140 196 92 152 86 S92 112 62 62 S124 28 204 42'); offset-rotate: auto; animation: drive 8s cubic-bezier(.45, .05, .35, 1) infinite; }
.f-bot rect { fill: var(--c-primary); }
.f-bot circle { fill: var(--c-ink); }
@keyframes drive { 0%, 6% { offset-distance: 0% } 76%, 90% { offset-distance: 100%; opacity: 1 } 95% { offset-distance: 100%; opacity: 0 } 96% { offset-distance: 0%; opacity: 0 } 100% { offset-distance: 0%; opacity: 1 } }
@supports not (offset-path: path('M0 0')) { .f-bot { transform: translate(244px, 138px); animation: none; } }

.back-btn { background: none; border: none; color: var(--c-primary); font-weight: 700; padding: 6px 8px; margin: -6px -8px 6px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; }
.back-btn:hover { background: var(--c-accent); }
.back-btn:hover .i { animation: nudge-back .6s ease-in-out infinite; }
@keyframes nudge-back { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(4px) } }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.team-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 12px 10px; border-radius: 14px; border: 2px solid var(--c-border); background: var(--c-surface); font-weight: 800; font-size: 1rem; transition: transform var(--t-fast) var(--spring), border-color var(--t-fast), box-shadow var(--t-fast); overflow-wrap: anywhere; animation: pop 380ms var(--ease) both; }
.team-btn:nth-child(2) { animation-delay: 50ms } .team-btn:nth-child(3) { animation-delay: 100ms } .team-btn:nth-child(4) { animation-delay: 150ms } .team-btn:nth-child(n+5) { animation-delay: 200ms }
.team-btn:hover, .team-btn:focus-visible { transform: translateY(-4px) rotate(-1deg); border-color: var(--c-primary); box-shadow: 3px 5px 0 rgba(28,43,34,.08); }
.team-btn .avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .95rem; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.links-row { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; font-size: .9rem; }
.links-row button { background: none; border: none; color: var(--c-primary); text-decoration: underline dotted; padding: 8px 0; font-weight: 700; min-height: 38px; }
.modal .links-row { justify-content: center; }
.panel-mine { padding: 16px 20px; }
.panel-mine h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; }
.my-teams { display: flex; gap: 10px; flex-wrap: wrap; }
.team-chip { display: inline-flex; align-items: center; gap: 10px; background: var(--c-surface); border: 2px solid var(--c-border); border-radius: 14px; padding: 6px 6px 6px 14px; font-weight: 800; transition: transform var(--t-fast) var(--spring), border-color var(--t-fast); max-width: 100%; animation: pop 380ms var(--ease) both; }
.team-chip:hover { transform: translateY(-2px); border-color: var(--c-primary); }
.team-chip .t-name { display: block; overflow-wrap: anywhere; text-align: right; }
.team-chip .avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 900; overflow: hidden; flex-shrink: 0; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.team-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-chip .t-meta { font-size: .74rem; color: var(--c-muted); font-weight: 600; display: block; text-align: right; }
.team-chip .forget { background: none; border: none; color: var(--c-muted); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.team-chip .forget:hover { color: var(--c-danger); background: #fde8e8; }
.whats-inside { display: grid; gap: 14px; padding: 4px 0 0; }
.new-team { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border: 2px dashed var(--c-border); border-radius: var(--radius); padding: 14px 18px; background: color-mix(in srgb, var(--c-surface) 70%, transparent); }
.new-team b { display: block; font-size: 1.05rem; }
.new-team .btn:hover { animation: wiggle .5s ease-in-out; }
.inside-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.inside-chips li { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 5px 12px; font-size: .86rem; font-weight: 700; transition: transform var(--t-fast) var(--spring); }
.inside-chips li:hover { transform: translateY(-2px) rotate(-1.5deg); }
/* השלמה אוטומטית */
.ac-list { position: absolute; top: calc(100% + 6px); right: 0; left: 0; background: var(--c-surface); border: 2px solid var(--c-primary); border-radius: 14px; z-index: 50; max-height: 290px; overflow-y: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; text-align: right; animation: unfold var(--t-med) var(--ease); }
.ac-item { background: none; border: none; text-align: right; padding: 11px 14px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--c-border); font-size: 1rem; min-height: 46px; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item:focus { background: var(--c-accent); outline: none; }
.ac-item .ac-meta { color: var(--c-muted); font-size: .78rem; }
.ac-other { color: var(--c-primary); font-weight: 800; justify-content: flex-start; gap: 6px; }
/* חלון סיסמה */
.pw-team { display: flex; align-items: center; gap: 12px; background: var(--c-accent); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.pw-team .avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 900; flex-shrink: 0; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.pw-team b { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.pw-team small { color: var(--c-muted); }
/* הקבוצה נוצרה */
.created-hero { text-align: center; padding: 6px 0 14px; }
.created-hero .big { font-size: 3rem; line-height: 1; animation: pop .5s var(--ease), bob 2.6s ease-in-out .6s infinite; }
.created-hero h3 { margin: 6px 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }
.secret-row { background: #fffbea; border: 1px solid #efdf9a; border-radius: 12px; padding: 12px 14px; margin-top: 14px; color: #33290a; }
.secret-row label { font-size: .86rem; font-weight: 700; display: block; margin-bottom: 6px; }
.secret-row .row { margin-top: 8px; }
/* איך זה עובד */
.how-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.how-list li { display: flex; gap: 12px; align-items: flex-start; animation: rise 420ms var(--ease) both; }
.how-list li:nth-child(2) { animation-delay: 140ms } .how-list li:nth-child(3) { animation-delay: 280ms }
.how-n { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.15rem; }
.how-list b { font-size: 1.02rem; }
.how-list p { margin: 2px 0 0; color: var(--c-muted); font-size: .92rem; }
.how-inside { background: var(--c-accent); border-radius: 12px; padding: 10px 14px; font-size: .92rem; margin: 0 0 14px; }

@media (max-width: 700px) {
  .panel-hero { grid-template-columns: 1fr; padding: 20px 16px 18px; }
  .field { max-width: 230px; margin: 0 auto; order: -1; }
  .panel-teams .field { display: none; }
  .teams-grid { grid-template-columns: 1fr 1fr; }
  .steps li span { font-size: .84rem; }
  .steps li + li { flex: 1 1 auto; }
  .steps li + li::before { margin: 0 6px; }
  .new-team { flex-direction: column; align-items: stretch; text-align: center; }
  .topbar { padding: 12px 14px 4px; }
  .brand { font-size: 1.25rem; }
}
@media (max-width: 360px) { .teams-grid { grid-template-columns: 1fr; } .steps li { gap: 5px; } .steps li b { width: 26px; height: 26px; font-size: .9rem; } .steps li span { font-size: .78rem; } .steps li + li::before { margin: 0 4px; } }
