:root{
  --bg1:#0b1020;
  --bg2:#1b0b2a;
  --glass: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --accent:#ff4d8d;
  --accent2:#ffb3cc;
  --ok:#39d98a;
  --bad:#ff5b5b;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  color:var(--text);
  min-height:100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,77,141,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(122,76,255,.22), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
}

/* floating hearts layer */
.hearts{ position:fixed; inset:0; pointer-events:none; overflow:hidden; z-index:0; }
.heart{
  --s: 20px;
  position:absolute;
  bottom:-10vh;
  font-size:var(--s);
  line-height:1;
  opacity:.85;
  animation: floatUp linear infinite;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
  user-select:none;
}
@keyframes floatUp{
  0%{ transform: translate(0,0) rotate(var(--rot-from)) scale(.85); opacity:0; }
  10%{ opacity:.9; }
  50%{ transform: translate(var(--sway, 24px), -60vh) rotate(calc((var(--rot-from) + var(--rot-to)) / 2)) scale(1); }
  85%{ opacity:.75; }
  100%{ transform: translate(0, -120vh) rotate(var(--rot-to)) scale(1.15); opacity:0; }
}

.wrap{ position:relative; z-index:1; max-width:1100px; margin:0 auto; padding:24px 16px 80px; }
.card{
  background: var(--glass);
  border:1px solid var(--stroke);
  border-radius:20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* gate */
.gate{ min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.gate .box{ width:min(560px, 100%); padding:22px; text-align:center; }
h1,h2,h3{margin:0 0 10px}
h1{ font-size:28px; letter-spacing:.2px; }
.subtitle{color:var(--muted); margin-top:6px}
.row{ display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; justify-content:center; }
input{
  flex:1 1 260px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.2);
  outline:none;
  background: rgba(0,0,0,.18);
  color:var(--text);
  font-size:16px;
  font-family:inherit;
}
button{
  padding:12px 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg, rgba(255,77,141,.95), rgba(255,179,204,.85));
  color:#2b0b1b;
  font-weight:800;
  cursor:pointer;
  font-family:inherit;
  transition: transform .12s ease, filter .12s ease;
}
button:hover{ transform: translateY(-1px); filter:brightness(1.03); }
button:active{ transform: translateY(0px) scale(.99); }
.hint{ margin-top:10px; color:var(--muted); font-size:14px; }
.error{ margin-top:10px; color:var(--bad); font-weight:800; display:none; }
.success{ margin-top:10px; color:var(--ok); font-weight:800; display:none; }
.shake{ animation: shake .35s ease; }
@keyframes shake{
  10%,90%{ transform: translateX(-2px); }
  20%,80%{ transform: translateX(4px); }
  30%,50%,70%{ transform: translateX(-8px); }
  40%,60%{ transform: translateX(8px); }
}

/* hero */
header.hero{ padding:22px; margin-top:10px; overflow:hidden; position:relative; }
.glow{
  position:absolute; inset:-80px;
  background:
    radial-gradient(420px 190px at 80% 25%, rgba(255,77,141,.35), transparent 60%),
    radial-gradient(380px 160px at 20% 80%, rgba(122,76,255,.26), transparent 60%);
  filter: blur(6px);
  opacity:.9;
  z-index:0;
}
header.hero .content{ position:relative; z-index:1; }
.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.16);
  color:var(--muted);
  font-size:14px;
  margin-bottom:10px;
  flex-wrap:wrap;
}
.big{ font-size:34px; margin-bottom:8px; }
.loveLine{ color:var(--muted); font-size:16px; line-height:1.9; max-width:75ch; }

/* nav */
.topNav{ margin-top:14px; display:flex; flex-wrap:wrap; gap:10px; }
.chip{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.16);
  color:var(--text);
  text-decoration:none;
  font-size:14px;
  transition: transform .12s ease, filter .12s ease;
}
.chip:hover{ transform: translateY(-1px); filter:brightness(1.05); }

/* sections */
.section{ padding:18px; margin-top:16px; }
.mini{ color:var(--muted); font-size:14px; line-height:1.9; }

/* reveal-on-scroll */
.reveal{ opacity:0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity:1; transform:none; }

/* messages */
.messages{ display:grid; gap:10px; margin-top:10px; }
.msg{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  transform: translateY(6px);
  opacity:0;
  animation: popIn .6s ease forwards;
}
.msg:nth-child(2){ animation-delay:.12s;}
.msg:nth-child(3){ animation-delay:.24s;}
.msg:nth-child(4){ animation-delay:.36s;}
.msg:nth-child(5){ animation-delay:.48s;}
.msg:nth-child(6){ animation-delay:.60s;}
@keyframes popIn{ to{ transform: translateY(0); opacity:1; } }

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
  margin-top:16px;
}
@media (min-width: 900px){
  .grid{ grid-template-columns: 1.2fr .8fr; }
}

/* reasons */
.reasonBox{
  margin-top:10px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  min-height:52px;
  display:flex;
  align-items:center;
  font-weight:700;
}

/* album */
.mediaGrid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
  margin-top:10px;
}
@media (min-width: 560px){
  .mediaGrid{ grid-template-columns: repeat(4, 1fr); }
}
.thumb{
  aspect-ratio: 3/4;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  overflow:hidden;
  position:relative;
  cursor:pointer;
  transition: transform .15s ease;
}
.thumb:hover{ transform: translateY(-3px); }
.thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb.landscape img{ object-fit:contain; background: rgba(0,0,0,.35); }
.thumb.missing{
  display:flex; align-items:center; justify-content:center; text-align:center;
  padding:10px; color:var(--muted); font-size:12px; line-height:1.7; cursor:default;
}

/* lightbox */
.lightbox{
  position:fixed; inset:0;
  background: rgba(0,0,0,.8);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}
.lightbox .box{
  width:min(980px, 100%);
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  position:relative;
}
.lightbox img{ width:100%; max-height:78vh; height:auto; object-fit:contain; display:block; background:#000; }
.lightbox .bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  color:var(--muted);
  font-size:14px;
}
.lightbox .bar button{
  background: rgba(255,255,255,.14);
  color: var(--text);
  border:1px solid rgba(255,255,255,.18);
  font-weight:700;
}
.lbNav{
  position:absolute; top:50%; transform:translateY(-50%);
  width:44px; height:44px; border-radius:50%;
  background: rgba(0,0,0,.4);
  border:1px solid rgba(255,255,255,.22);
  color:#fff; font-size:20px; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.lbNav.prev{ right:14px; }
.lbNav.next{ left:14px; }

/* videos */
.videoGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
  margin-top:10px;
}
@media (min-width: 900px){
  .videoGrid{ grid-template-columns: 1fr 1fr; }
}
video{
  width:100%;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.2);
}
.videoMissing{
  aspect-ratio: 16/9;
  border-radius:16px;
  border:1px dashed rgba(255,255,255,.2);
  background: rgba(0,0,0,.16);
  display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:13px; text-align:center; padding:10px;
}

/* countdown */
.countGrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-top:10px;
}
@media (min-width:480px){
  .countGrid{ grid-template-columns: repeat(4, 1fr); }
}
@media (min-width:720px){
  .countGrid{ grid-template-columns: repeat(7, 1fr); }
}
.countCell{
  padding:12px 6px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  text-align:center;
}
.countCell b{
  display:block;
  margin:0 auto;
  min-width:3ch;
  font-size:22px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color:var(--accent2);
}
.countCell span{
  font-size:12px;
  color:var(--muted);
}

/* timeline */
.timeline{ position:relative; margin-top:10px; padding-right:18px; }
.timeline:before{
  content:"";
  position:absolute;
  right:7px;
  top:0; bottom:0;
  width:2px;
  background: linear-gradient(to bottom, rgba(255,77,141,.9), rgba(122,76,255,.25));
  opacity:.7;
}
.tItem{ position:relative; padding:12px 12px 12px 0; margin-bottom:12px; }
.tDot{
  position:absolute;
  right:-2px;
  top:18px;
  width:16px;height:16px;
  border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,77,141,.18);
}
.tCard{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
}
.tTop{ display:flex; gap:10px; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; }
.tDate{ color:var(--accent2); font-weight:900; }
.tTitle{ font-weight:900; }
.tText{ color:var(--muted); margin-top:6px; line-height:1.9; }

.tMedia{
  margin-top:10px;
  display:grid;
  grid-template-columns: 120px 1fr;
  gap:10px;
  align-items:center;
}
.tMedia .miniThumb{
  width:120px; height:150px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  display:grid; place-items:center;
  cursor:pointer;
}
.tMedia img{ width:100%; height:100%; object-fit:cover; display:block; }
.tMedia video{ width:120px; height:150px; object-fit:cover; }
.tNote{ color:var(--muted); font-size:13px; line-height:1.8; }

/* music */
.musicRow{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:10px;
}
.musicBtn{
  background: linear-gradient(135deg, rgba(122,76,255,.95), rgba(255,77,141,.85));
  color:#f7f3ff;
  border:1px solid rgba(255,255,255,.2);
  font-weight:900;
}

/* secret */
.secret{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.secret .revealBtn{
  background: linear-gradient(135deg, rgba(122,76,255,.95), rgba(255,77,141,.85));
  color:#f7f3ff;
  border:1px solid rgba(255,255,255,.2);
  font-weight:900;
  align-self:flex-start;
}
.secretMsg{
  display:none;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  color:var(--text);
  line-height:1.95;
}

/* game */
.gameTabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.gameTab{
  padding:9px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.16);
  color:var(--muted);
  font-weight:700;
  font-size:14px;
}
.gameTab.active{
  background: linear-gradient(135deg, rgba(255,77,141,.95), rgba(255,179,204,.85));
  color:#2b0b1b;
  border-color: transparent;
}
.gamePanel[hidden]{ display:none; }
.gameBar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px;
}
.gameStat{
  padding:8px 12px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.16);
  font-size:14px;
  font-weight:700;
}
.gameArea{
  position:relative;
  margin-top:12px;
  height:360px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(300px 160px at 20% 20%, rgba(255,77,141,.16), transparent 60%),
    radial-gradient(260px 140px at 80% 70%, rgba(122,76,255,.16), transparent 60%),
    rgba(0,0,0,.22);
  touch-action: manipulation;
}
.gameHint{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:20px;
  color:var(--muted);
  font-size:15px;
}
.gameHeart{
  position:absolute;
  top:-48px;
  font-size:32px;
  line-height:1;
  cursor:pointer;
  background:none;
  border:none;
  padding:0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
  animation: gameFall linear forwards;
  user-select:none;
}
@keyframes gameFall{
  from{ transform: translateY(0) rotate(0deg); }
  to{ transform: translateY(420px) rotate(25deg); }
}
.gameHeart.popped{
  animation: none;
  transition: transform .22s ease, opacity .22s ease;
  transform: scale(1.7);
  opacity: 0;
  pointer-events:none;
}
.gamePlus{
  position:absolute;
  font-weight:900;
  color: var(--accent2);
  font-size:18px;
  pointer-events:none;
  animation: plusFloat .7s ease forwards;
}
@keyframes plusFloat{
  from{ transform: translateY(0); opacity:1; }
  to{ transform: translateY(-30px); opacity:0; }
}
.gameResult{
  margin-top:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.16);
  font-weight:800;
  text-align:center;
  display:none;
}

/* memory game */
.memoryGrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:8px;
  margin-top:12px;
}
.memoryCard{
  aspect-ratio: 1;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.24);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  cursor:pointer;
  user-select:none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.memoryCard:not(.flipped):not(.matched):active{ transform: scale(.94); }
.memoryCard.flipped,
.memoryCard.matched{
  background: linear-gradient(135deg, rgba(255,77,141,.28), rgba(122,76,255,.28));
  border-color: rgba(255,255,255,.28);
}
.memoryCard.matched{ opacity:.55; cursor:default; }

/* scroll to top */
.toTop{
  position:fixed;
  left:18px; bottom:18px;
  width:46px; height:46px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(255,77,141,.95), rgba(255,179,204,.85));
  color:#2b0b1b;
  font-weight:900;
  border:1px solid rgba(255,255,255,.22);
  cursor:pointer;
  opacity:0; pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  z-index:40;
}
.toTop.show{ opacity:1; pointer-events:auto; }

footer{ margin-top:16px; text-align:center; color:var(--muted); font-size:13px; }
#main{ display:block; }

:root {
  color-scheme: dark;
  --text: #fff4ec;
  --muted: #e3c8cf;
  --stroke: #ecc0b734;
  --accent: #ef8d9f;
  --accent2: #ffcfbc;
  --glass: #381b29a6;
  --shadow: 0 22px 64px #14071366;
}
body {
  background:
    radial-gradient(ellipse at 18% 2%, #6b293f 0%, transparent 44rem),
    radial-gradient(ellipse at 100% 42%, #3d1b36 0%, transparent 54rem),
    #1b101b;
}
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #ffd4c5;
  outline-offset: 4px;
}
button:disabled { cursor: wait; }
.card {
  border-radius: 28px;
  background: linear-gradient(145deg, #502a3cc9, var(--glass) 72%);
}
.wrap { padding-inline: clamp(14px, 3.2vw, 34px); }
.dedication {
  margin-bottom: 21px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 700;
  color: #ffd7bf;
}
.dedication span { margin-inline-start: 5px; }
header.hero {
  min-height: min(580px, 76svh);
  display: grid;
  align-content: center;
  padding: clamp(23px, 6vw, 78px);
  background:
    linear-gradient(90deg, #7c344445 0%, transparent 60%),
    radial-gradient(ellipse at 18% 50%, #b75c6233, transparent 58%),
    #351b2b;
  animation: story-enter .72s cubic-bezier(.19,.71,.28,1) both;
}
header.hero .content { max-width: 75%; }
header.hero .glow { opacity: .45; }
.big {
  font-size: clamp(2.65rem, 6.2vw, 5.3rem);
  line-height: 1.1;
  max-width: 13ch;
  margin: 18px 0;
  font-weight: 900;
  text-wrap: balance;
}
.loveLine { font-size: clamp(1rem, 2vw, 1.25rem); max-width: 41ch; }
.badge { font-weight: 700; background: #481d2e; }
.chip, .musicBtn { min-height: 44px; }
.chip { background: #311724; }
.hero-orbit {
  position: absolute;
  inset: 50% auto auto 14%;
  width: clamp(135px, 22vw, 270px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #f9bda94f;
  border-radius: 50%;
  transform: translate(-20%, -50%) rotate(-13deg);
  color: #ffd4bc;
  background: radial-gradient(circle at 35% 24%, #cd776b39, #48233965 69%);
  box-shadow: inset 0 0 42px #ffab9426, 0 20px 68px #180b17a6;
  pointer-events: none;
}
.hero-orbit::before, .hero-orbit::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid #f9bda945;
  border-radius: 50%;
}
.hero-orbit::after { inset: -10% 4%; transform: rotate(48deg); }
.hero-orbit span {
  font-family: Georgia, serif;
  font-size: clamp(3.4rem, 9vw, 8rem);
  line-height: 1;
  text-shadow: 0 0 42px #ff947b9e;
  animation: heart-beat 3.6s ease-in-out infinite;
}
.section { padding: clamp(17px, 3vw, 30px); scroll-margin-top: 22px; }
.section h2 { font-size: clamp(1.4rem, 3.3vw, 2.15rem); text-wrap: balance; }
.countCell b { font-variant-numeric: tabular-nums; }
.thumb, .miniThumb { padding: 0; }
.thumb img, .miniThumb img { transition: transform .35s ease; }
.thumb:hover img, .miniThumb:hover img { transform: scale(1.045); }
.secretMsg { animation: story-enter .35s ease both; }
.welcome-body { min-height: 100svh; }
.gate { min-height: 100svh; grid-template-columns: minmax(0, 1fr); }
.gate .welcome-card {
  width: min(100%, 500px);
  padding: clamp(24px, 6vw, 49px);
  border-color: #edb3a86b;
  background: radial-gradient(ellipse at 50% -25%, #af69565e, transparent 66%), #3a1e2f;
  animation: story-enter .7s cubic-bezier(.19,.71,.28,1) both;
}
.welcome-card h1 { font-size: clamp(3rem, 10vw, 5.1rem); line-height: 1; color: #ffe8d4; }
.envelope-heart {
  display: grid;
  place-items: center;
  width: 78px;
  aspect-ratio: 1;
  margin: 0 auto 25px;
  border-radius: 24px;
  border: 1px solid #ffc8b4aa;
  background: #622f41;
  color: #ffd0ad;
  font: 2.9rem Georgia, serif;
  box-shadow: 0 10px 35px #280a22a0, inset 0 0 20px #e9997e3d;
}
.gate-form { margin-top: 30px; text-align: start; }
.gate-form label { font-weight: 700; color: #ffe8d4; }
.gate-form .row { flex-wrap: nowrap; margin-top: 8px; }
.gate-form input { flex: 1 1 0; min-width: 0; }
.gate-form button { white-space: nowrap; }
.gate-status { min-height: 1.4em; margin: 12px 0 0; color: #ffd2c9; }
.welcome-card.opening { animation: gate-opening .43s ease both; }
.lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(900px, calc(100% - 24px));
  height: fit-content;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #edb3a86b;
  border-radius: 20px;
  color: var(--text);
  background: #2d1727;
}
.lightbox[open] { display: block; animation: story-enter .34s ease both; }
.lightbox::backdrop { background: #190a18cf; backdrop-filter: blur(8px); }
.lightbox .box { width: 100%; max-width: none; border: 0; box-shadow: none; }
body:has(.lightbox[open]) { overflow: hidden; }
@keyframes story-enter {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes gate-opening {
  to { opacity: 0; transform: translateY(-14px) scale(1.04); }
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  42% { transform: scale(1.075); }
}
@media (max-width: 650px) {
  header.hero { min-height: 0; padding-block-start: 36px; }
  header.hero .content { max-width: 100%; }
  .hero-orbit { inset: 35% auto auto 3%; opacity: .38; }
  .big { max-width: 12ch; }
  .hero .badge { max-width: calc(100% - 13px); }
}
@media (max-width: 360px) {
  .gate-form .row { flex-wrap: wrap; }
  .gate-form input, .gate-form button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hearts { display: none; }
  header.hero, .hero-orbit span, .secretMsg, .welcome-card, .welcome-card.opening,
  .lightbox[open], .shake { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal, .thumb img, .miniThumb img { transition: none; }
}
