/* حكايتنا - blush pink theme (design direction 2) */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { scroll-behavior:smooth; }
body {
  font-family:'Noto Sans Arabic','Segoe UI',Tahoma,sans-serif;
  background:#fff6f3; color:#5c2333; min-height:100vh; min-height:100dvh;
  padding-bottom:110px; position:relative; overflow-x:hidden;
}
.blob { position:fixed; border-radius:50%; filter:blur(46px); z-index:-1; }
.b1 { width:220px; height:220px; background:#ffd3e0; top:-60px; right:-70px; }
.b2 { width:180px; height:180px; background:#ffe9ef; top:40vh; left:-70px; }
.loading { display:flex; align-items:center; justify-content:center; min-height:70vh; font-size:44px; color:#e0497a; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform:scale(1.25); opacity:.6; } }

/* ===== lock / setup screens ===== */
.gate { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px; }
.gate .heart { font-size:52px; color:#e0497a; animation:pulse 1.6s ease-in-out infinite; }
.gate h1 { font-weight:800; font-size:34px; color:#c2255c; margin:10px 0 4px; }
.gate p { color:#96607a; font-size:14px; margin-bottom:22px; text-align:center; line-height:1.8; }
.gate .card { background:#fff; border:1px solid #ffe3ec; border-radius:24px; padding:22px; width:100%; max-width:340px; box-shadow:0 12px 32px rgba(224,73,122,.14); }
.field { margin-bottom:14px; }
.field label { display:block; font-size:13px; font-weight:700; color:#86274a; margin-bottom:6px; }
.field input, .field textarea {
  width:100%; padding:12px 14px; border:2px solid #ffe3ec; border-radius:14px; font-size:16px;
  font-family:inherit; color:#5c2333; background:#fffafa; outline:none; transition:border-color .2s;
}
.field input:focus, .field textarea:focus { border-color:#ff8fab; }
.field textarea { resize:vertical; min-height:70px; }
.btn {
  width:100%; padding:14px; border:none; border-radius:16px; font-size:16px; font-weight:800; font-family:inherit;
  color:#fff; background:linear-gradient(135deg,#ff8fab,#e0497a); cursor:pointer;
  box-shadow:0 8px 20px rgba(224,73,122,.35); transition:transform .12s;
}
.btn:active { transform:scale(.97); }
.btn:disabled { opacity:.5; }
.err { color:#c2255c; font-size:13px; font-weight:700; text-align:center; margin-top:10px; min-height:18px; }
.hint { font-size:12px; color:#b76e88; text-align:center; margin-top:12px; line-height:1.8; }

/* ===== main header ===== */
header { text-align:center; padding:40px 24px 4px; position:relative; }
.heartline { font-size:18px; color:#e0497a; letter-spacing:6px; }
header h1 { font-weight:800; font-size:38px; color:#c2255c; margin:4px 0 2px; }
.names { font-size:17px; color:#86274a; font-weight:600; }
.icon-edit { background:none; border:none; cursor:pointer; font-size:14px; color:#d98aa5; padding:4px; vertical-align:middle; }

.counter { margin:20px 24px 0; background:linear-gradient(135deg,#ff8fab,#e0497a); border-radius:26px;
  padding:18px; text-align:center; color:#fff; box-shadow:0 12px 30px rgba(224,73,122,.35); }
.counter .num { font-weight:800; font-size:30px; }
.counter .lbl { font-size:13px; opacity:.95; margin-top:3px; }

.sec { margin:28px 24px 14px; display:flex; align-items:baseline; justify-content:space-between; }
.sec .t { font-weight:800; font-size:19px; color:#c2255c; }
.sec .hearts { font-size:10px; color:#f0a6c0; letter-spacing:3px; margin-top:3px; }
.add-mini { background:#fff; border:1.5px solid #ffb3c6; color:#e0497a; border-radius:999px; padding:5px 14px;
  font-size:13px; font-weight:800; font-family:inherit; cursor:pointer; }
.add-mini:active { transform:scale(.95); }

/* ===== timeline ===== */
.timeline { margin:0 24px; position:relative; padding-right:30px; }
.timeline::before { content:''; position:absolute; right:8px; top:8px; bottom:8px; width:3px; border-radius:3px;
  background:repeating-linear-gradient(#f0a6c0 0 8px, transparent 8px 14px); }
.ev { position:relative; margin-bottom:14px; background:#fff; border-radius:18px; padding:12px 14px;
  box-shadow:0 6px 18px rgba(194,37,92,.10); border:1px solid #ffe3ec; }
.ev::before { content:'♥'; position:absolute; right:-30px; top:12px; width:19px; height:19px; font-size:11px;
  background:#e0497a; color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 0 3px #fff6f3; }
.ev .d { font-size:12px; color:#e0497a; font-weight:700; }
.ev .ti { font-size:15px; font-weight:800; color:#86274a; margin:1px 0; }
.ev .tx { font-size:13px; color:#96607a; line-height:1.7; white-space:pre-wrap; }
.ev .tools { position:absolute; left:10px; top:10px; display:flex; gap:6px; }
.ev .tools button { background:#fff0f5; border:none; border-radius:8px; width:26px; height:26px; font-size:13px;
  color:#c2255c; cursor:pointer; }
.empty { text-align:center; color:#d98aa5; font-size:14px; padding:18px 24px; background:#fff; border:1.5px dashed #ffd3e0;
  border-radius:18px; margin:0 24px; }

/* ===== gallery ===== */
.grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:0 24px; }
.gphoto { position:relative; aspect-ratio:3/4; border-radius:18px; overflow:hidden; box-shadow:0 8px 18px rgba(224,73,122,.18);
  cursor:pointer; background:linear-gradient(150deg,#ffe3ec,#ffd3e0); border:none; padding:0; }
.gphoto img { width:100%; height:100%; object-fit:cover; display:block; }
.gphoto .cap { position:absolute; bottom:0; right:0; left:0; padding:14px 8px 6px; font-size:10px; color:#fff; font-weight:700;
  background:linear-gradient(transparent, rgba(92,35,51,.75)); text-align:center; }

/* ===== viewer overlay ===== */
.overlay { position:fixed; inset:0; background:rgba(60,15,32,.92); z-index:50; display:flex; flex-direction:column;
  align-items:center; justify-content:center; padding:20px; }
.overlay img { max-width:100%; max-height:70vh; border-radius:18px; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.overlay .cap { color:#ffd3e0; margin-top:14px; font-size:15px; text-align:center; }
.overlay .row { display:flex; gap:10px; margin-top:18px; }
.overlay .row button { border:none; border-radius:12px; padding:10px 18px; font-family:inherit; font-size:14px; font-weight:800; cursor:pointer; }
.ov-close { background:#fff; color:#86274a; }
.ov-danger { background:#e0497a; color:#fff; }
.ov-danger.armed { background:#fff; color:#c2255c; animation:pulse 1s infinite; }

/* ===== song bar & fab ===== */
.song { position:fixed; bottom:calc(18px + env(safe-area-inset-bottom)); right:24px; left:92px; display:flex; align-items:center; gap:12px;
  padding:11px 14px; border-radius:999px; background:#fff; border:1px solid #ffd3e0;
  box-shadow:0 10px 26px rgba(224,73,122,.25); z-index:40; }
.song .play { width:38px; height:38px; border:none; border-radius:50%; background:linear-gradient(135deg,#ff8fab,#e0497a);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:13px; flex-shrink:0; cursor:pointer; }
.song .meta { flex:1; min-width:0; }
.song .st { font-size:13px; font-weight:800; color:#c2255c; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.song .ss { font-size:11px; color:#b76e88; }
.song .chg { background:none; border:none; color:#d98aa5; font-size:13px; cursor:pointer; padding:4px; }
.song.playing .play { animation:pulse 1.4s infinite; }
.fab { position:fixed; bottom:calc(18px + env(safe-area-inset-bottom)); left:24px; width:54px; height:54px; border:none; border-radius:50%;
  background:linear-gradient(135deg,#ff8fab,#e0497a); color:#fff; font-size:30px; font-weight:300; z-index:40;
  display:flex; align-items:center; justify-content:center; box-shadow:0 10px 26px rgba(224,73,122,.45); cursor:pointer; }
.fab:active { transform:scale(.93); }

/* ===== modal ===== */
.modal-bg { position:fixed; inset:0; background:rgba(60,15,32,.5); z-index:60; display:flex; align-items:flex-end; }
.modal { background:#fff6f3; border-radius:26px 26px 0 0; width:100%; padding:22px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow:0 -12px 40px rgba(0,0,0,.2); max-height:86vh; overflow-y:auto; }
.modal h3 { color:#c2255c; font-size:18px; font-weight:800; margin-bottom:16px; text-align:center; }
.modal .row { display:flex; gap:10px; margin-top:6px; }
.modal .row .btn { flex:1; }
.btn-ghost { background:#fff; color:#c2255c; border:2px solid #ffb3c6; box-shadow:none; }
.toast { position:fixed; top:18px; right:50%; transform:translateX(50%); background:#5c2333; color:#fff; padding:10px 20px;
  border-radius:999px; font-size:13px; font-weight:700; z-index:80; box-shadow:0 10px 24px rgba(0,0,0,.25); animation:drop .25s ease-out; }
@keyframes drop { from { transform:translate(50%,-30px); opacity:0; } }

/* ===== pinned edit-mode bar ===== */
body { padding-top:64px; }
.topbar { position:fixed; top:0; right:0; left:0; z-index:70; display:flex; justify-content:center; padding:10px 16px; pointer-events:none; }
.topbar > * { pointer-events:auto; }
.pill { border:none; border-radius:999px; padding:10px 22px; font-family:inherit; font-size:14px; font-weight:800;
  color:#c2255c; background:rgba(255,255,255,.92); border:1.5px solid #ffb3c6; box-shadow:0 8px 22px rgba(224,73,122,.25);
  cursor:pointer; backdrop-filter:blur(8px); }
.pill:active { transform:scale(.95); }
.editbar-on { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; max-width:520px;
  padding:9px 10px 9px 18px; border-radius:999px; background:linear-gradient(135deg,#ff8fab,#e0497a); color:#fff;
  font-size:14px; font-weight:800; box-shadow:0 10px 26px rgba(224,73,122,.45); }
.editbar-on button { border:none; border-radius:999px; padding:8px 18px; font-family:inherit; font-size:14px; font-weight:800;
  background:#fff; color:#c2255c; cursor:pointer; }
.editbar-on button:active { transform:scale(.95); }

/* ===== edit mode visuals ===== */
body.editing .ev.ed { outline:2px dashed #ffb3c6; outline-offset:3px; }
body.editing .gphoto.ed { outline:2px dashed #ffb3c6; outline-offset:2px; cursor:grab; }
.tile-add { display:block; margin:12px 24px 0; padding:13px; border:2px dashed #ffb3c6; border-radius:16px;
  background:#fff; color:#e0497a; font-family:inherit; font-size:14px; font-weight:800; cursor:pointer; }
.tile-add:active { transform:scale(.98); }
.tile-add.wide { width:calc(100% - 48px); }
.ev .tools { position:absolute; left:10px; top:10px; display:flex; gap:6px; }
.ev .tools button { background:#fff0f5; border:none; border-radius:8px; width:28px; height:28px; font-size:13px;
  color:#c2255c; cursor:pointer; }
.gphoto .ord { position:absolute; top:6px; right:6px; background:rgba(92,35,51,.8); color:#fff; font-size:11px; font-weight:800;
  border-radius:999px; min-width:22px; height:22px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.gphoto .ctl { position:absolute; bottom:6px; width:28px; height:28px; border-radius:10px; background:rgba(255,255,255,.95);
  color:#c2255c; font-size:14px; font-weight:800; display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.25); }
.gphoto .ctl-rep { right:6px; }
.gphoto .ctl-del { left:6px; }
.song .chg { background:#fff0f5; border:none; border-radius:10px; color:#c2255c; font-size:12px; font-weight:800;
  font-family:inherit; cursor:pointer; padding:8px 10px; white-space:nowrap; }
.song .chg.del { background:#ffe3ec; }

/* ===== drag & drop ===== */
.drag-src { opacity:.25; }
.drag-ghost { position:fixed; z-index:90; pointer-events:none; opacity:.92; transform:scale(1.05) rotate(2deg);
  box-shadow:0 18px 44px rgba(194,37,92,.45); }
.drop-target { outline:3px solid #e0497a !important; outline-offset:2px; }

/* ===== date-locked gate with floating cover photo ===== */
.gate.lock { padding-top:34px; }
.float-wrap { margin-bottom:18px; }
.float-photo { width:150px; height:150px; border-radius:50%; overflow:hidden; position:relative;
  border:4px solid #fff; box-shadow:0 16px 40px rgba(224,73,122,.35), 0 0 0 6px rgba(255,143,171,.25);
  animation:floaty 5s ease-in-out infinite alternate; background:linear-gradient(135deg,#ffb3c6,#e0497a); }
.float-photo img { width:100%; height:100%; object-fit:cover; display:block; }
.float-photo .ph { position:absolute; inset:0; display:none; align-items:center; justify-content:center;
  font-size:52px; color:#ffffffcc; }
.float-photo.empty .ph { display:flex; }
@keyframes floaty {
  0%   { transform:translate(0,0) rotate(-1.5deg); }
  25%  { transform:translate(9px,-10px) rotate(1deg); }
  50%  { transform:translate(-8px,-3px) rotate(-1deg); }
  75%  { transform:translate(6px,9px) rotate(1.5deg); }
  100% { transform:translate(-9px,4px) rotate(-1deg); }
}
.lock-label { display:block; font-size:13px; font-weight:700; color:#86274a; margin-bottom:8px; text-align:center; }
.lock-fields { display:flex; gap:10px; margin-bottom:14px; }
.lock-fields .lf { flex:1; }
.lock-fields input { width:100%; padding:13px; border:2px solid #ffe3ec; border-radius:14px; font-size:20px; font-weight:800;
  font-family:inherit; color:#5c2333; background:#fffafa; outline:none; text-align:center; transition:border-color .2s; }
.lock-fields input:focus { border-color:#ff8fab; }
.lock-fields input::placeholder { font-size:13px; font-weight:600; color:#d98aa5; }
.or-line { display:flex; align-items:center; gap:10px; color:#d98aa5; font-size:12px; font-weight:700; margin:12px 0; }
.or-line::before, .or-line::after { content:''; flex:1; height:1px; background:#ffe3ec; }

/* ===== youtube mini player ===== */
.yt-box { position:fixed; bottom:calc(86px + env(safe-area-inset-bottom)); right:24px; left:24px; z-index:39;
  border-radius:18px; overflow:hidden; box-shadow:0 14px 38px rgba(92,35,51,.4); background:#000;
  aspect-ratio:16/9; }
.yt-box iframe { width:100%; height:100%; border:0; display:block; }

/* number inputs: hide desktop spinners */
.lock-fields input::-webkit-outer-spin-button, .lock-fields input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.lock-fields input { -moz-appearance:textfield; appearance:textfield; }


/* live ticking counter */
.counter .tick { display:flex; gap:7px; justify-content:center; flex-wrap:wrap; margin:10px 0 6px; }
.tick .tk { background:#fff; border:1.5px solid #ffd3e0; border-radius:14px; padding:7px 6px; min-width:50px; box-shadow:0 2px 8px #f8c8d866; }
.tick .tk b { display:block; font-size:19px; color:#d6336c; line-height:1.2; }
.tick .tk span { font-size:11px; color:#a0637c; }

/* love letters */
.letters { display:flex; flex-direction:column; gap:10px; margin:4px 0 14px; }
.letter { position:relative; }
.letter-open { width:100%; background:linear-gradient(135deg,#fff,#fff0f5); border:1.5px solid #ffc9dd; border-radius:16px; padding:14px 16px; font-size:16px; font-weight:700; color:#c2255c; cursor:pointer; box-shadow:0 3px 10px #f8c8d855; font-family:inherit; }
.letter-open:active { transform:scale(.98); }
.letter.ed .letter-open { padding-left:70px; }
.ctl2 { position:absolute; top:50%; transform:translateY(-50%); width:26px; height:26px; border-radius:50%; background:#e0497a; color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; cursor:pointer; z-index:2; }
.ctl-ldel { left:8px; }
.ctl-ledit { left:40px; background:#fff; color:#e0497a; border:1.5px solid #e0497a; }
.letter-body { font-size:17px; line-height:1.9; color:#7a4055; background:#fff5f8; border-radius:14px; padding:16px; white-space:pre-wrap; }

/* wrong-code shake */
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
.card.shake { animation: shake .45s; }

/* subtitle under names + counter title line */
.subtitle { margin-top:4px; font-size:14px; color:#b76e88; font-weight:600; }
.counter .ct { font-size:16px; font-weight:800; color:#a61e4d; margin-bottom:2px; }

/* checkbox rows in forms */
.chk { display:flex; align-items:center; gap:8px; margin-top:8px; font-size:13px; color:#a0637c; font-weight:600; cursor:pointer; }
.chk input { width:18px; height:18px; accent-color:#e0497a; }
