/* ==========================================================================
   מגרש — עיצוב ספורטיבי: דשא מכוסח, קווי מגרש, כדורגל, דגל ישראל.
   מובייל-first. זהות מוצר עצמאית (לא מותג העסק).
   ========================================================================== */

:root {
  --pitch-deep: #14591f;
  --pitch: #1e7a2e;
  --pitch-bright: #2fa54a;
  --grass-a: #1e7a2e;
  --grass-b: #22862f;
  --il-blue: #0038b8;
  --il-blue-soft: #2563eb;
  --ball-yellow: #ffd21e;
  --ink: #12261a;
  --ink-soft: #4b5f52;
  --muted: #7c8c82;
  --line: #e2ece5;
  --bg: #f2f7f3;
  --tint: #e8f3ec;      /* משטח רך (תגיות, כפתור-רפאים) — נצבע ע"י הערכה האישית */
  --tint2: #f7fbf8;     /* משטח רך מאוד (כרטיסי-משנה, תאי לוח־שנה) */
  --ring: 47, 165, 74;  /* טבעת פוקוס (RGB) */
  --shadow-rgb: 20, 89, 31;
  --card: #ffffff;
  --danger: #d64545;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(var(--shadow-rgb), 0.10);
  --shadow-lg: 0 12px 34px rgba(var(--shadow-rgb), 0.16);
  --font: "Rubik", "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* קריטי: כשאלמנט מקבל display ב-CSS (כמו .sheet{display:flex}), התכונה hidden מתבטלת
   וה"חלון" נשאר תקוע גלוי. הכלל הזה מכריח hidden=מוסתר תמיד, בכל האלמנטים. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  padding-bottom: 84px; /* מקום ל-tabbar */
}

a { color: inherit; text-decoration: none; }

/* ---------- Topbar עם דשא + קו מגרש ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    repeating-linear-gradient(90deg, var(--grass-a) 0 26px, var(--grass-b) 26px 52px);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.25rem; }
.brand-logo { position: relative; display: inline-flex; width: 1.5rem; height: 1.95rem; align-items: flex-end; justify-content: center; }
.brand-ball { font-size: 1.35rem; animation: spin 9s linear infinite; }
/* כתר SVG (מחליף את התו ♕ שנראה שונה בכל מכשיר) — פידבק יואב 24.7 */
.crown-svg { display: block; }
.brand-crown {
  position: absolute; top: -0.2rem; width: 1.45rem; height: auto; z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.brand-name { letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.il-flag { font-size: 1rem; }
.logout { font-size: .85rem; opacity: .92; background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; }
.pitch-stripe { height: 4px; background: #fff; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Wrap ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

/* ---------- Flash ---------- */
.flash {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 12px;
  font-weight: 600; border: 1px solid transparent;
}
.flash.success { background: #e5f6ea; color: #14591f; border-color: #b7e2c3; }
.flash.error { background: #fbe6e6; color: #9a2727; border-color: #f0bcbc; }

/* ---------- Hero (דשבורד) ---------- */
.hero-card {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright));
  color: #fff; border-radius: var(--radius); padding: 22px 20px;
  box-shadow: var(--shadow-lg); margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 30px, transparent 30px 60px);
}
.hero-text { position: relative; z-index: 1; }
.hero-text .hello { margin: 0 0 4px; opacity: .9; font-weight: 600; }
.hero-text h1 { margin: 0; font-size: 1.7rem; font-weight: 800; }
.hero-sub { margin: 6px 0 0; opacity: .9; }
.hero-ball { font-size: 3rem; position: relative; z-index: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }

/* ---------- Stat tiles ---------- */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-tile {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; gap: 2px;
  border: 2px solid transparent;
}
.stat-tile .stat-num { font-size: 2rem; font-weight: 800; color: var(--pitch); }
.stat-tile .stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-tile.ghost .stat-num { color: var(--il-blue); }

/* ---------- Panels ---------- */
.panel {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel-title { margin: 0 0 12px; font-size: 1.05rem; font-weight: 800; }
.muted-panel { color: var(--ink-soft); }
.muted-panel p { margin: 0; }

/* ---------- ימי הולדת ---------- */
.bday-list { list-style: none; margin: 0; padding: 0; }
.bday-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.bday-item:last-child { border-bottom: none; }
.bday-name { font-weight: 700; }
.bday-when { color: var(--muted); font-size: .9rem; }
.bday-item.today { background: #fff9e0; margin: 0 -8px; padding: 10px 8px; border-radius: 10px; border-bottom: none; }
.bday-item.today .bday-when { color: #b8860b; font-weight: 800; }

/* ---------- Action grid ---------- */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-card {
  background: var(--tint2); border: 2px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 4px; transition: transform .08s, border-color .12s;
}
.action-card:active { transform: scale(.97); }
.action-card .ac-icon { font-size: 1.7rem; }
.action-card .ac-title { font-weight: 800; }
.action-card .ac-sub { color: var(--muted); font-size: .82rem; }
.action-card.soon { opacity: .55; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 800; }

/* ---------- Roster ---------- */
.roster { display: flex; flex-direction: column; gap: 10px; }
.player-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  border-right: 5px solid var(--pitch-bright); transition: transform .08s;
}
.player-card:active { transform: scale(.98); }
.jersey {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25);
}
.player-main { flex: 1; min-width: 0; }
.player-name { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.muted { color: var(--muted); font-size: .85rem; }
.chev { color: var(--muted); font-size: 1.6rem; line-height: 1; }

.pill { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill-pos { background: var(--tint); color: var(--pitch); }
.pill-bday { background: #fff3cf; color: #b8860b; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-ball { font-size: 3.5rem; display: block; margin-bottom: 10px; }
.empty p { margin: 0 0 18px; }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.card-form {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
label { font-weight: 700; font-size: .92rem; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); }
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pitch-bright); box-shadow: 0 0 0 3px rgba(var(--ring),.15); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea { resize: vertical; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
  padding: 12px 18px; border-radius: 999px; border: none; transition: transform .08s, filter .12s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--tint); color: var(--pitch); }
.btn-danger { background: #fbe6e6; color: var(--danger); width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 1.08rem; width: 100%; }
.danger-form { margin-top: 14px; }

/* ---------- Login ---------- */
.login-hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.14), transparent 60%),
    repeating-linear-gradient(90deg, var(--grass-a) 0 34px, var(--grass-b) 34px 68px);
}
.login-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 28px 24px; width: 100%; max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .ball-big { font-size: 3.2rem; display: inline-block; position: relative; }
.login-logo .crown-big {
  position: absolute; top: -2.05rem; left: 50%; transform: translateX(-50%);
  width: 3.3rem; height: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.22));
}
.login-logo h1 { margin: 6px 0 2px; font-size: 2rem; font-weight: 800; color: var(--pitch); }
.login-logo .tagline { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 18px rgba(var(--shadow-rgb),.06);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 12px; color: var(--muted); font-size: .72rem; font-weight: 700;
}
.tabbar a .icon { font-size: 1.35rem; }
.tabbar a.active { color: var(--pitch); }
.tabbar a.active .icon { transform: translateY(-2px); transition: transform .15s; }

/* ---------- Attendance: רשימת אימונים ---------- */
.new-session-row { display: flex; gap: 10px; }
.new-session-row input[type="date"] { flex: 1; }
.pill-warn { background: #fff3cf; color: #b8860b; }

.session-list { display: flex; flex-direction: column; gap: 10px; }
.session-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px;
  border-right: 5px solid var(--il-blue-soft);
}
.session-main { flex: 1; padding: 8px; }
.session-date { font-weight: 800; }
.session-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.icon-btn { background: none; border: none; font-size: 1.15rem; cursor: pointer; padding: 8px; border-radius: 10px; }
.icon-btn:active { background: #f2f2f2; }

/* ---------- Attendance: מסך סימון ---------- */
.att-form { padding-bottom: 84px; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px;
}
.att-name { font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.att-jersey {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; font-size: .8rem; color: #fff;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright));
}
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.seg-opt { position: relative; cursor: pointer; margin: 0; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; }
.seg-opt span {
  display: block; text-align: center; padding: 11px 4px; border-radius: 10px;
  font-weight: 800; font-size: .92rem; border: 2px solid var(--line); background: #fafafa; color: var(--muted);
  transition: transform .06s;
}
.seg-opt:active span { transform: scale(.96); }
.seg-present input:checked + span { background: #e5f6ea; border-color: #43a047; color: #14591f; }
.seg-late input:checked + span { background: #fff3cf; border-color: #e6b800; color: #9a6b00; }
.seg-absent input:checked + span { background: #fbe6e6; border-color: #d64545; color: #9a2727; }

/* הערה + טלפון מקדים לכל שחקן */
.att-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.att-note {
  font-size: .9rem; padding: 9px 12px; border: 2px dashed var(--line); border-radius: 10px; background: #fcfdfc;
}
.att-note:focus { border-style: solid; }
.call-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.ct-opt { position: relative; cursor: pointer; margin: 0; }
.ct-opt input { position: absolute; opacity: 0; inset: 0; }
.ct-opt span {
  display: inline-block; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: .82rem;
  border: 2px solid var(--line); background: #fafafa; color: var(--muted);
}
.ct-yes input:checked + span { background: #e5f6ea; border-color: #43a047; color: #14591f; }
.ct-no input:checked + span { background: #fbe6e6; border-color: #d64545; color: #9a2727; }
/* הדגשה עדינה: כשנעדר — אזור ההערה בולט יותר */
.att-row[data-status="absent"] .att-note { border-color: #f0bcbc; background: #fff8f8; }

.sticky-save {
  position: fixed; bottom: 76px; left: 0; right: 0; padding: 10px 16px;
  max-width: 720px; margin: 0 auto;
}
.sticky-save .btn { box-shadow: var(--shadow-lg); }

/* ---------- Attendance: דוח ---------- */
.period-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.period-tabs a {
  flex: 1; text-align: center; padding: 10px; border-radius: 999px; font-weight: 800;
  background: var(--tint); color: var(--pitch);
}
.period-tabs a.on { background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff; }
.report-range { color: var(--muted); font-size: .9rem; margin: 0 0 12px; text-align: center; }

.report-table { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.report-head, .report-row {
  display: grid; grid-template-columns: 1fr 62px 40px 40px 40px; align-items: center; gap: 4px;
  padding: 10px 12px;
}
.report-head { background: var(--bg); font-weight: 800; font-size: .8rem; color: var(--ink-soft); }
.report-row { border-top: 1px solid var(--line); }
.report-row .rr-name { font-weight: 700; }
.col-rate, .col-tag { text-align: center; }
.col-tag { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.rate-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-weight: 800; font-size: .82rem; }
.rate-badge.good { background: #e5f6ea; color: #14591f; }
.rate-badge.mid { background: #fff3cf; color: #9a6b00; }
.rate-badge.bad { background: #fbe6e6; color: #9a2727; }
.report-row.low { background: #fff8f8; }
.report-note { color: var(--muted); font-size: .82rem; margin: 12px 2px 0; }

/* ---------- מקטע 3: יום משחק ---------- */
.action-card.flag { background: linear-gradient(135deg, var(--tint2), #d8f5e0); border-color: #a5e0b6; }
.pill-live { background: #ffe3e3; color: #c62828; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* בחירת הרכב */
.pick-row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer;
  border: 2px solid transparent; color: var(--ink); flex-direction: row;
}
.pick-row input { position: absolute; opacity: 0; }
.pick-jersey {
  width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: var(--pitch);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto;
}
.pick-name { font-weight: 700; flex: 1; }
.pick-check { opacity: 0; font-weight: 900; color: var(--pitch-bright); font-size: 1.3rem; }
.pick-row:has(input:checked) { border-color: var(--pitch-bright); background: var(--tint2); }
.pick-row:has(input:checked) .pick-jersey { background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff; }
.pick-row:has(input:checked) .pick-check { opacity: 1; }

/* לוח תוצאה */
.scoreboard {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: center;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff;
  border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow-lg); margin-bottom: 14px;
}
.score-side { text-align: center; }
.score-label { font-size: .8rem; opacity: .9; font-weight: 700; margin-bottom: 2px; }
.score-num { font-size: 2.6rem; font-weight: 800; line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,.25); }
.score-btn {
  margin-top: 8px; background: rgba(255,255,255,.18); color: #fff; border: none;
  padding: 7px 12px; border-radius: 999px; font-weight: 800; font-size: .82rem; cursor: pointer;
}
.score-btn:active { transform: scale(.95); }
.score-center { text-align: center; }
.live-clock { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.clock-btn {
  margin-top: 6px; background: #fff; color: var(--pitch-deep); border: none;
  padding: 8px 14px; border-radius: 999px; font-weight: 800; cursor: pointer; font-size: .85rem;
}
.fairness { margin-top: 8px; font-size: .72rem; opacity: .92; }

/* באנר חילוף הוגן */
.fair-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff8e1; border: 2px solid #ffe08a; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px;
}
.fair-banner b { color: var(--pitch-deep); }
.fair-banner .btn { padding: 8px 14px; font-size: .85rem; }

/* רשימות מגרש/ספסל */
.pitch-section { margin-bottom: 14px; }
.live-h { font-size: 1rem; font-weight: 800; margin: 0 0 8px; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-row {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: right;
  background: var(--card); border: 2px solid transparent; border-radius: 14px; box-shadow: var(--shadow);
  padding: 10px 14px; cursor: pointer; font-family: inherit; color: var(--ink);
  border-right: 5px solid var(--pitch-bright);
}
.live-row:active { transform: scale(.98); }
.live-list.bench .live-row { border-right-color: var(--muted); opacity: .95; }
.lr-jersey {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; font-weight: 800; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright));
}
.live-list.bench .lr-jersey { background: linear-gradient(135deg, #7c8c82, #9fb0a6); }
.lr-name { flex: 1; font-weight: 800; }
.lr-mins { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; color: var(--pitch-deep); }
.live-row.selected { border-color: var(--il-blue); background: #eef3ff; }
.live-row.suggest-off { border-color: #e6b800; }
.live-row.suggest-off .lr-mins { color: #b8860b; }
.live-row.suggest-on { border-color: var(--pitch-bright); }

.live-actions { margin: 16px 0 6px; }
.sub-hint { color: var(--muted); font-size: .82rem; text-align: center; }

/* סרגל אירועים */
.live-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.tool-btn {
  flex: 1; background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 11px; font-weight: 800; font-family: inherit; cursor: pointer; font-size: .92rem; color: var(--ink);
}
.tool-btn:active { transform: scale(.97); }

/* bottom-sheet */
.sheet {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-inner {
  background: var(--bg); width: 100%; max-width: 720px; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.3);
}
.sheet-title { font-weight: 800; font-size: 1.15rem; text-align: center; margin-bottom: 14px; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-opt {
  width: 100%; text-align: right; background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 14px 16px; font-weight: 700; font-family: inherit; font-size: 1rem;
  cursor: pointer; color: var(--ink);
}
.sheet-opt:active { transform: scale(.98); background: var(--tint); }
.sheet-close {
  width: 100%; margin-top: 12px; background: var(--tint); color: var(--ink-soft); border: none;
  border-radius: 999px; padding: 12px; font-weight: 800; font-family: inherit; cursor: pointer;
}

/* סיכום */
.recap-score {
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff;
  border-radius: var(--radius); padding: 22px 16px; text-align: center; box-shadow: var(--shadow-lg); margin-bottom: 16px;
}
.rs-line { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rs-team { font-weight: 700; opacity: .92; }
.rs-num { font-size: 2.4rem; font-weight: 800; }
.rs-date { margin: 8px 0 0; opacity: .9; font-size: .85rem; }

.minutes-list { display: flex; flex-direction: column; gap: 8px; }
.min-row { display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: 8px; }
.min-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-bar-wrap { background: var(--tint); border-radius: 999px; height: 14px; overflow: hidden; }
.min-bar { height: 100%; background: linear-gradient(90deg, var(--pitch-bright), var(--pitch-deep)); border-radius: 999px; }
.min-val { text-align: left; font-variant-numeric: tabular-nums; font-weight: 800; font-size: .85rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.tl-min { font-weight: 800; color: var(--pitch); min-width: 34px; }
.tl-ico { font-size: 1.1rem; }

.qr-details summary { cursor: pointer; font-weight: 700; color: var(--pitch); padding: 6px 0; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 12px; }
.qr-cell { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.qr-cell img { width: 100%; max-width: 120px; height: auto; }
.qr-cell span { display: block; font-size: .78rem; font-weight: 700; margin-top: 4px; }

/* מסך הורה */
.parent-live { max-width: 440px; margin: 0 auto; padding-top: 10px; }
.pl-badge { text-align: center; color: var(--muted); font-weight: 700; font-size: .8rem; margin-bottom: 10px; }
.pl-card {
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff;
  border-radius: 24px; padding: 26px 20px; text-align: center; box-shadow: var(--shadow-lg);
}
.pl-jersey {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; box-shadow: inset 0 0 0 3px rgba(255,255,255,.3);
}
.pl-name { margin: 0 0 8px; font-size: 1.6rem; font-weight: 800; }
.pl-status .on { background: rgba(255,255,255,.22); padding: 4px 12px; border-radius: 999px; font-weight: 800; }
.pl-status .off { background: rgba(0,0,0,.18); padding: 4px 12px; border-radius: 999px; font-weight: 800; }
.pl-minutes-label { margin-top: 16px; opacity: .9; font-weight: 700; }
.pl-minutes { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pl-score { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; margin-top: 16px; text-align: center; }
.pls-line { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
.pls-line b { font-size: 1.5rem; color: var(--pitch-deep); }
.pls-dash { color: var(--muted); }
.pls-clock { margin-top: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pls-state { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.pl-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* ---------- מקטע 4: לוח שנה ---------- */
.btn-sm { padding: 8px 14px; font-size: .85rem; }

.cal-panel { padding: 14px 12px; }
.cal-monthbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-monthtitle { font-weight: 800; font-size: 1.15rem; }
.cal-navbtn {
  background: var(--tint); color: var(--pitch); border: none; width: 40px; height: 40px;
  border-radius: 12px; font-size: 1.5rem; font-weight: 800; cursor: pointer; line-height: 1;
}
.cal-navbtn:active { transform: scale(.94); }

.cal-note {
  background: #fff8e1; border: 1px solid #ffe08a; color: #9a6b00;
  border-radius: 10px; padding: 8px 12px; font-size: .82rem; font-weight: 600; margin-bottom: 10px;
}

.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: .78rem; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-dow .sat { color: var(--il-blue); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; min-height: 42px;
  background: var(--tint2); border: 2px solid transparent; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 5px 2px 2px; cursor: pointer; font-family: inherit; color: var(--ink);
}
.cal-cell:active { transform: scale(.95); }
.cal-cell .cc-num { font-weight: 800; font-size: .92rem; }
.cal-cell .cc-dots { display: flex; gap: 3px; margin-top: auto; margin-bottom: 3px; flex-wrap: wrap; justify-content: center; }
.cal-cell .cc-dots i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-cell .cc-more { position: absolute; bottom: 1px; inset-inline-end: 4px; font-size: .6rem; color: var(--muted); font-weight: 800; }
.cal-cell.out { opacity: .38; }
.cal-cell.sat { background: #eef3ff; }
.cal-cell.today { background: #fff9e0; border-color: var(--ball-yellow); }
.cal-cell.today .cc-num { color: #b8860b; }
.cal-cell.sel { border-color: var(--pitch-bright); box-shadow: 0 0 0 3px rgba(var(--ring),.14); background: var(--tint2); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-lg { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.cal-lg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-load-err { text-align: center; color: var(--muted); padding: 20px; }

.cal-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.cal-day-head .panel-title { margin: 0; }
.cal-empty-day { color: var(--muted); font-size: .9rem; padding: 8px 2px; }

.cal-event {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: right;
  background: var(--card); border: 1px solid var(--line); border-inline-start: 5px solid var(--pitch-bright);
  border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; font-family: inherit; color: var(--ink);
}
.cal-event.ce-open { cursor: pointer; }
.cal-event.ce-open:active { transform: scale(.99); }
.cal-event .ce-emoji { font-size: 1.35rem; flex: 0 0 auto; }
.cal-event .ce-body { flex: 1; min-width: 0; }
.cal-event .ce-title { font-weight: 800; }
.cal-event .ce-meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.cal-event .ce-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--pitch); font-size: .9rem; }

/* מקטע בחירת סוג אירוע (3 אפשרויות) */
.kind-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.ks-opt { position: relative; cursor: pointer; margin: 0; }
.ks-opt input { position: absolute; opacity: 0; inset: 0; }
.ks-opt span {
  display: block; text-align: center; padding: 11px 4px; border-radius: 10px;
  font-weight: 800; font-size: .88rem; border: 2px solid var(--line); background: #fafafa; color: var(--muted);
}
.ks-opt:active span { transform: scale(.96); }
.ks-opt input:checked + span { background: var(--tint2); border-color: var(--pitch-bright); color: var(--pitch-deep); }

/* ---------- מקטע 5: משוב, שיחה, מצב-עריכה ---------- */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.tb-feedback {
  position: relative; background: rgba(255,255,255,.16); color: #fff;
  width: 36px; height: 32px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.05rem;
}
.tb-badge {
  position: absolute; top: -5px; inset-inline-start: -5px; background: var(--ball-yellow); color: #6b4e00;
  font-size: .68rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.team-ribbon {
  background: #0b3d16; color: #d8f5e0; font-size: .78rem; font-weight: 700;
  text-align: center; padding: 6px 12px;
}
.team-ribbon a { text-decoration: underline; color: #fff; }

/* כפתור עיצוב צף */
.design-fab {
  position: fixed; bottom: 92px; inset-inline-start: 16px; z-index: 40;
  width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ffd21e, #f0a500); color: #3a2a00; font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.design-fab:active { transform: scale(.92); }
.design-hint { color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.design-kinds { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.design-kinds label { position: relative; cursor: pointer; margin: 0; }
.design-kinds input { position: absolute; opacity: 0; inset: 0; }
.design-kinds span {
  display: block; text-align: center; padding: 9px 4px; border-radius: 10px; font-weight: 800;
  font-size: .82rem; border: 2px solid var(--line); background: #fafafa; color: var(--muted);
}
.design-kinds input:checked + span { background: #fff8e1; border-color: #f0a500; color: #8a5a00; }
#designSheet textarea { width: 100%; }

/* toast */
.fb-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 700;
  font-size: .9rem; z-index: 80; opacity: 0; transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg);
  max-width: 90vw; text-align: center;
}
.fb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* לוח משוב / שיחה */
.fb-count { color: var(--muted); font-size: .82rem; font-weight: 700; }
.fb-intro { color: var(--ink-soft); font-size: .9rem; margin: 0 0 14px; }
.fb-filters { margin-bottom: 12px; }
.fb-filter-form { display: flex; gap: 8px; }
.fb-filter-form select { flex: 1; }

.fb-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 90px; }
.fb-msg {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px;
  max-width: 92%; border: 1px solid var(--line);
}
.fb-msg.from-coach { align-self: flex-start; border-inline-start: 5px solid var(--pitch-bright); }
.fb-msg.from-team { align-self: flex-end; border-inline-start: 5px solid var(--il-blue); background: #f3f7ff; }
.fb-msg.is-done { opacity: .62; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.fb-who { font-weight: 800; font-size: .9rem; }
.fb-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-tag { font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--ink-soft); }
.fb-tag.kind-design { background: #fff8e1; color: #8a5a00; }
.fb-tag.kind-bug { background: #fbe6e6; color: #9a2727; }
.fb-tag.kind-idea { background: #eef3ff; color: #274a9a; }
.fb-tag.screen { background: var(--tint); color: var(--pitch); }
.fb-body { font-weight: 500; white-space: pre-wrap; line-height: 1.5; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.fb-time { color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.fb-status {
  background: var(--tint); color: var(--pitch); border: none; border-radius: 999px;
  padding: 5px 12px; font-weight: 800; font-size: .78rem; cursor: pointer; font-family: inherit;
}
.fb-status.done { background: #e5f6ea; color: #14591f; }
.fb-status:active { transform: scale(.95); }

.fb-compose {
  position: fixed; bottom: 76px; left: 0; right: 0; z-index: 25;
  max-width: 720px; margin: 0 auto; padding: 10px 16px;
  background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 18px rgba(var(--shadow-rgb),.06);
}
.fb-compose-top { display: flex; gap: 8px; }
.fb-compose-top select { flex: 1; padding: 8px 10px; font-size: .88rem; }
.fb-compose textarea { width: 100%; }
.fb-compose .btn { padding: 11px; }

/* ---------- מקטע 5.5: התאמה אישית (ערכות צבע + פריסה) ---------- */
.settings-link { margin-bottom: 16px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.theme-card { position: relative; cursor: pointer; margin: 0; text-align: center; }
.theme-card input { position: absolute; opacity: 0; inset: 0; }
.theme-swatch {
  display: flex; height: 46px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line); box-shadow: var(--shadow);
}
.theme-swatch i { flex: 1; display: block; }
.theme-swatch i.acc { flex: 0 0 30%; }
.theme-label { display: block; font-size: .78rem; font-weight: 700; margin-top: 5px; color: var(--ink-soft); }
.theme-card input:checked + .theme-swatch { border-color: var(--pitch-bright); box-shadow: 0 0 0 3px rgba(var(--ring),.22); }
.theme-card input:checked ~ .theme-label { color: var(--pitch); }

.custom-colors { display: none; gap: 12px; margin-top: 14px; }
.custom-colors.on { display: flex; }
.custom-colors label { flex: 1; }
.custom-colors input[type="color"] { width: 100%; height: 44px; padding: 3px; border-radius: 10px; cursor: pointer; }

.theme-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tp-jersey {
  width: 48px; height: 48px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25);
}
.tp-score {
  background: linear-gradient(135deg, var(--pitch-deep), var(--pitch-bright)); color: #fff;
  font-weight: 800; font-size: 1.2rem; padding: 10px 18px; border-radius: 12px; letter-spacing: 1px;
}
.tp-btn { margin: 0; }

.layout-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.layout-opt { position: relative; cursor: pointer; margin: 0; }
.layout-opt input { position: absolute; opacity: 0; inset: 0; }
.lo-box {
  display: block; border: 2px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; background: #fafafa;
}
.layout-opt input:checked + .lo-box { border-color: var(--pitch-bright); background: var(--tint2); }
.lo-demo { display: grid; gap: 5px; margin-bottom: 8px; }
.lo-demo.rows { grid-template-columns: 1fr; }
.lo-demo.rows i { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--pitch-bright), var(--pitch-deep)); display: block; }
.lo-demo.tiles { grid-template-columns: 1fr 1fr; }
.lo-demo.tiles i { height: 26px; border-radius: 6px; background: linear-gradient(135deg, var(--pitch-bright), var(--pitch-deep)); display: block; }
.lo-name { font-weight: 800; font-size: .9rem; }

/* משחק חי — פריסת קוביות (חלופה לשורות) */
.live-list.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.live-list.tiles .live-row {
  flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 6px;
  border-right: none; border-top: 5px solid var(--pitch-bright);
}
.live-list.tiles.bench .live-row { border-top-color: var(--muted); }
.live-list.tiles .lr-jersey { width: 38px; height: 38px; }
.live-list.tiles .lr-name { font-size: .78rem; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-list.tiles .lr-mins { font-size: 1rem; }
.live-list.tiles .live-row.selected { border-color: var(--il-blue); }

@media (min-width: 560px) {
  .hero-text h1 { font-size: 2rem; }
  .cal-cell .cc-num { font-size: 1rem; }
  .live-list.tiles { grid-template-columns: repeat(4, 1fr); }
}
