:root {
  --aqua: #14b8c4;
  --aqua-deep: #0e8a93;
  --teal: #06b6a4;
  --coral: #ff6b6b;
  --coral-deep: #f0457f;
  --sun: #ffd23f;
  --sand: #fff4dd;
  --sky-1: #2ec5d6;
  --sky-2: #4fd1c5;
  --ink: #0d3b45;
  --muted: #5b7c83;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(13, 59, 69, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--aqua-deep); }
h1, h2, h3 { margin: 0; line-height: 1.15; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--sky-1) 0%, var(--aqua) 45%, var(--teal) 100%);
  color: #fff;
  padding: 54px 16px 90px;
  text-align: center;
  overflow: hidden;
}
.hero .sun {
  position: absolute;
  top: 24px; left: 28px;
  width: 84px; height: 84px;
  background: radial-gradient(circle, var(--sun) 60%, rgba(255,210,63,0) 70%);
  border-radius: 50%;
  filter: drop-shadow(0 0 22px rgba(255,210,63,.7));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.hero h1 {
  font-size: clamp(30px, 8vw, 52px);
  font-weight: 800;
  text-shadow: 0 3px 0 rgba(6,182,164,.35);
}
.hero p.sub { font-size: clamp(15px, 4vw, 20px); opacity: .96; margin-top: 10px; font-weight: 500; }
.hero .emojis { font-size: 30px; margin-bottom: 6px; letter-spacing: 6px; }

.countdown { display: flex; gap: 10px; justify-content: center; margin: 22px auto 0; flex-wrap: wrap; }
.cd-box {
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 16px;
  padding: 10px 14px; min-width: 70px;
}
.cd-box b { display: block; font-size: 30px; font-weight: 800; }
.cd-box span { font-size: 12px; opacity: .9; }
.cd-done { font-size: 22px; font-weight: 700; }

/* wave divider */
.wave { position: absolute; bottom: -1px; left: 0; width: 100%; line-height: 0; }
.wave svg { width: 100%; height: 70px; display: block; }

/* ---------- SECTIONS ---------- */
section { padding: 30px 0 6px; }
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 24px; font-weight: 800; margin-bottom: 16px;
}
.sec-title .ic { font-size: 28px; }
.sec-title small { font-weight: 500; color: var(--muted); font-size: 14px; }

/* day cards */
.days { display: grid; gap: 18px; }
.day {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid transparent;
}
.day-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; color: #fff;
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
}
.day:nth-child(2) .day-head { background: linear-gradient(120deg, var(--aqua), var(--aqua-deep)); }
.day:nth-child(3) .day-head { background: linear-gradient(120deg, #f59e0b, #f0457f); }
.day-head .d-emoji { font-size: 30px; }
.day-head h3 { font-size: 21px; }
.day-head .d-date { margin-inline-start: auto; font-weight: 600; opacity: .95; font-size: 14px; }

.timeline { list-style: none; margin: 0; padding: 10px 18px 18px; }
.timeline li {
  display: flex; gap: 14px; padding: 11px 0;
  border-bottom: 1px dashed #e7eef0;
}
.timeline li:last-child { border-bottom: none; }
.t-time {
  flex: 0 0 58px; font-weight: 800; color: var(--aqua-deep);
  font-variant-numeric: tabular-nums;
}
.t-time.empty::before { content: '•'; color: var(--coral); }
.t-text { flex: 1; padding-top: 1px; }

/* link cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.linkcard {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: var(--ink); border: 2px solid #eef6f7;
  transition: transform .12s ease, border-color .12s;
}
.linkcard:hover { transform: translateY(-3px); border-color: var(--aqua); }
.linkcard .lc-label { font-weight: 700; }
.linkcard .lc-note { font-size: 13px; color: var(--muted); }
.linkcard .lc-go { font-size: 13px; color: var(--aqua-deep); font-weight: 700; margin-top: auto; }

.subsec { margin-top: 22px; }
.subsec > h3 { font-size: 18px; margin-bottom: 10px; display:flex; gap:8px; align-items:center; }

/* cars */
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.car {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 14px 16px; border-inline-start: 6px solid var(--aqua);
}
.car .c-driver { font-weight: 700; }
.car .c-seats { font-size: 13px; color: var(--teal); font-weight: 600; }
.car .c-note { font-size: 13px; color: var(--muted); }
.car.empty-seats { border-inline-start-color: #d9e6e8; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 20px; color: #fff; background: var(--aqua);
  box-shadow: 0 6px 16px rgba(20,184,196,.35); transition: transform .1s, filter .1s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn.coral { background: var(--coral); box-shadow: 0 6px 16px rgba(255,107,107,.4); }
.btn.sun { background: var(--sun); color: #7a5a00; box-shadow: 0 6px 16px rgba(255,210,63,.45); }
.btn.ghost { background: #fff; color: var(--aqua-deep); box-shadow: var(--shadow); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.icon { padding: 9px 12px; }

/* floating actions */
.fab {
  position: fixed; bottom: 18px; left: 16px; z-index: 40;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}

/* CTA banner */
.cta {
  margin: 26px 0 8px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--coral), var(--coral-deep));
  color: #fff; padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.cta h3 { font-size: 22px; margin-bottom: 6px; }
.cta p { margin: 0 0 14px; opacity: .95; }

footer { text-align: center; color: var(--muted); padding: 28px 16px 110px; font-size: 13px; }

/* ---------- edit mode ---------- */
body.editing { background: #eef9fa; }
.edit-badge {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--sun); color: #7a5a00; text-align: center;
  font-weight: 700; padding: 7px; font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
body.editing { padding-top: 38px; }
[contenteditable="true"] {
  outline: 2px dashed var(--aqua); outline-offset: 2px;
  border-radius: 6px; padding: 2px 4px; background: #fff;
  min-width: 30px; min-height: 1em;
}
.del-btn {
  background: var(--coral); color: #fff; border: none; cursor: pointer;
  border-radius: 8px; width: 26px; height: 26px; font-size: 15px; line-height: 1;
  flex: 0 0 auto;
}
.add-row { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.edit-only { display: none; }
body.editing .edit-only { display: inline-flex; }
body.editing .edit-only.flex { display: flex; }

/* ---------- shirts page ---------- */
.shirts-wrap { padding-top: 20px; }
.family {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden; border: 2px solid #eef6f7;
}
.family-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: linear-gradient(120deg, var(--aqua), var(--teal)); color: #fff;
}
.family-head input.fam-name {
  flex: 1; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-family: inherit; font-weight: 700; font-size: 18px;
  border-radius: 10px; padding: 6px 10px;
}
.family-head input.fam-name::placeholder { color: rgba(255,255,255,.8); }
.members { padding: 8px 12px 14px; }
.member {
  display: grid; grid-template-columns: 1fr 90px 96px 30px; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed #eef2f3;
}
.member:last-child { border-bottom: none; }
.member input, .member select {
  font-family: inherit; font-size: 15px; padding: 9px 10px;
  border: 1.5px solid #d9e6e8; border-radius: 10px; width: 100%; background: #fff;
}
.member input:focus, .member select:focus { outline: none; border-color: var(--aqua); }
.member-head {
  display: grid; grid-template-columns: 1fr 90px 96px 30px; gap: 8px;
  font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0;
}
.fam-actions { padding: 0 12px 14px; }

/* summary table */
.summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #eef2f3; }
table.tbl th { background: #f0fbfc; color: var(--aqua-deep); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: #e7f9fb; color: var(--aqua-deep); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }

.galufa-manager {
  background: linear-gradient(135deg, #fff7e6, #fff0f0);
  border: 2px dashed var(--coral); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 18px;
}
.galufa-manager h4 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.galufa-manager .gm-sub { font-size: 13px; color: var(--muted); margin: 0; }
.gm-add { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.gm-add input {
  flex: 1; min-width: 170px; padding: 11px 13px; font-family: inherit; font-size: 15px;
  border: 1.5px solid #e6cfa0; border-radius: 11px; background: #fff;
}
.gm-add input:focus { outline: none; border-color: var(--coral); }
.gm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gm-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1.5px solid #dfe7e9; border-radius: 999px;
  padding: 6px 14px 6px 6px; font-weight: 700; font-size: 14px; color: var(--ink);
}
.gm-chip.extra { border-color: var(--coral); background: #fff4f4; }
.gm-chip.excluded { opacity: .65; text-decoration: line-through; }
.gm-chip button {
  border: none; cursor: pointer; border-radius: 50%; width: 23px; height: 23px;
  font-size: 13px; line-height: 1; background: #eef2f3; color: #556;
}
.gm-chip button.rm, .gm-chip.extra button { background: var(--coral); color: #fff; }
.gm-chip.excluded button { background: var(--teal); color: #fff; }
.gm-label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }

.galufa-stage { display: flex; justify-content: center; }
#galufaCanvas {
  width: 100%; max-width: 520px; height: auto;
  border-radius: 14px; box-shadow: 0 8px 22px rgba(13,59,69,.22);
}

.toast {
  position: fixed; bottom: 22px; right: 50%; transform: translateX(50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.topbar h1 { font-size: 24px; }
.topbar .spacer { margin-inline-start: auto; }

@media (max-width: 520px) {
  .member, .member-head { grid-template-columns: 1fr 72px 84px 28px; }
  .member input, .member select { padding: 8px 6px; font-size: 14px; }
}

@media print {
  .fab, .btn, .topbar .btn, .del-btn, .add-row, .fam-actions, .edit-badge { display: none !important; }
  body { background: #fff; }
  .summary, .family { box-shadow: none; border: 1px solid #ccc; }
}
