/* Base Theme: rose red, black, white, purple */
:root{
  --bg:#0b0a0d;           /* nearly black */
  --panel:#17131e;        /* deep purple-black */
  --rose:#ff2a68;         /* vibrant rose */
  --rose-2:#ff4d88;       /* lighter rose */
  --purple:#7b4dff;       /* accent purple */
  --white:#f7f6fb;        /* soft white */
  --muted:#b9a9d6;        /* soft lavender */
  --glow: 0 0 24px rgba(255,42,104,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 50% -10%, rgba(123,77,255,.18), transparent 60%),
              radial-gradient(800px 600px at 80% 20%, rgba(255,42,104,.12), transparent 50%),
              linear-gradient(180deg, #0b0a0d 0%, #0b0a0d 100%);
  color:var(--white);
  overflow-x:hidden;
  scroll-behavior:smooth;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  position:relative;
}

body::before{
  content:'';
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:radial-gradient(circle at 20% 80%, rgba(255,42,104,.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(123,77,255,.03) 0%, transparent 50%);
  pointer-events:none;
  z-index:-1;
}

/* Animated background: floating rose petals + pulsing heart */
.bg{position:fixed; inset:0; overflow:hidden; z-index:-1}
.petals{position:absolute; inset:0; background:radial-gradient(circle at 30% 30%, rgba(255,77,136,.25), transparent 40%)}
.petals:before,.petals:after{content:"❤"; position:absolute; width:14px; height:18px; color:var(--rose); font-size:16px; filter:blur(.2px)}
.petals:before{top:110%; left:10%; animation:fall 16s linear infinite;}
.petals:after{top:120%; left:80%; animation:fall 22s linear infinite;}
.petals:nth-child(2):before{left:25%; animation-duration:19s}
.petals:nth-child(2):after{left:60%; animation-duration:27s}
.petals:nth-child(3):before{left:40%; animation-duration:21s}
.petals:nth-child(3):after{left:35%; animation-duration:24s}
.petals:nth-child(4):before{left:70%; animation-duration:18s}
.petals:nth-child(4):after{left:15%; animation-duration:20s}
.petals:nth-child(5):before{left:85%; animation-duration:26s}
.petals:nth-child(5):after{left:50%; animation-duration:23s}

@keyframes fall{ 0%{transform:translateY(0) scale(1)} 100%{transform:translateY(-220vh) scale(1.1)} }

.heart{position:fixed; left:50%; top:18vh; transform:translateX(-50%); pointer-events:none}
.heart-svg{width:120px; height:120px; fill:var(--rose); filter:drop-shadow(0 0 18px rgba(255,42,104,.55)); animation:beat 1.8s ease-in-out infinite}
@keyframes beat{0%,100%{transform:scale(1)} 25%{transform:scale(1.06)} 50%{transform:scale(0.98)} 75%{transform:scale(1.08)}}
@keyframes pulse{0%,100%{opacity:1; transform:scale(1)} 50%{opacity:0.8; transform:scale(1.05)}}

/* Modern Navigation */
.nav{position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; padding:20px 32px; background:linear-gradient(180deg, rgba(0,0,0,.98), rgba(23,19,30,.95)); backdrop-filter:blur(20px); border-bottom:2px solid rgba(255,42,104,.3); box-shadow:0 4px 20px rgba(0,0,0,.3); z-index:100}
.nav.dark{background:linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.9))}
.nav .brand{font-weight:800; color:var(--rose); letter-spacing:.5px; font-size:1.2rem; text-shadow:0 0 10px rgba(255,42,104,.3)}
.nav nav{display:flex; gap:8px}
.nav nav a{color:var(--muted); text-decoration:none; padding:12px 18px; border-radius:12px; transition:all .3s cubic-bezier(0.4, 0, 0.2, 1); font-weight:500; position:relative; overflow:hidden}
.nav nav a::before{content:''; position:absolute; top:0; left:-100%; width:100%; height:100%; background:linear-gradient(90deg, transparent, rgba(255,255,255,.1), transparent); transition:left .5s}
.nav nav a:hover{color:var(--white); background:rgba(255,42,104,.15); transform:translateY(-2px); box-shadow:0 4px 12px rgba(255,42,104,.2)}
.nav nav a:hover::before{left:100%}
.nav nav a.active{color:var(--white); background:linear-gradient(135deg, rgba(255,42,104,.4), rgba(123,77,255,.3)); box-shadow:0 0 20px rgba(255,42,104,.3), 0 4px 12px rgba(0,0,0,.2); transform:translateY(-1px)}

/* Mobile menu (3 dots) - Hidden on desktop, visible on mobile */
.nav .menu-toggle{display:none; background:rgba(255,255,255,.08); color:var(--white); border:1px solid rgba(255,42,104,.4); padding:8px 10px; border-radius:10px; cursor:pointer; transition:all .3s ease}
.nav .menu-toggle:hover{background:rgba(255,42,104,.2); transform:scale(1.05)}
.nav.nav-open nav{display:block}

.container{max-width:1080px; margin:0 auto; padding:32px 20px}
.hero{padding-top:48px; text-align:center}
.title{font-size:56px; margin:0 0 14px; background:linear-gradient(180deg, var(--white), var(--rose-2)); -webkit-background-clip:text; background-clip:text; color:transparent; text-shadow:var(--glow)}
.lead{color:#e7e3f3; margin:0 auto; max-width:760px; line-height:1.8}
/* Fluid media defaults for responsiveness */
img,video,svg,iframe{max-width:100%; height:auto; display:block}
/* Allow nav to scroll horizontally if links overflow */
.nav nav{overflow-x:auto; -webkit-overflow-scrolling:touch}
.nav nav a{white-space:nowrap}
/* Envelope letter widget (centered) */
.letter-widget{display:flex; justify-content:center; margin:120px auto 8px; pointer-events:auto}
.letter-card{position:relative; width:320px; height:220px; cursor:pointer;}
.envelope-base{position:absolute; inset:0; border-radius:16px; background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,235,255,.86)); border:1px solid rgba(123,77,255,.25); box-shadow:0 10px 30px rgba(0,0,0,.45)}
.envelope-flap{position:absolute; inset:0; clip-path:polygon(0 0, 100% 0, 50% 58%); background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(225,215,255,.8)); border-top-left-radius:16px; border-top-right-radius:16px}
.paper{position:absolute; left:12px; right:12px; bottom:16px; height:0; background:#ffffff; border-radius:10px; border:1px solid rgba(0,0,0,.08); overflow:hidden; box-shadow:0 8px 20px rgba(0,0,0,.25); transform-origin:bottom center; transition:height .6s cubic-bezier(.2,.8,.2,1)}
.paper .inner{padding:14px; color:#1c1730; line-height:1.8; white-space:pre-line}
.letter-card.open .paper{height:160px}
.letter-hint{position:absolute; left:0; right:0; bottom:-26px; text-align:center; color:var(--muted); font-size:12px}

.cards{display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:20px; margin-top:32px}
.card{display:block; background:linear-gradient(135deg, rgba(123,77,255,.15), rgba(255,42,104,.1)); border:1px solid rgba(123,77,255,.3); padding:24px; border-radius:20px; text-decoration:none; color:var(--white); box-shadow:0 8px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.05) inset; transition:all .3s cubic-bezier(0.4, 0, 0.2, 1); position:relative; overflow:hidden; backdrop-filter:blur(10px)}
.card::before{content:''; position:absolute; top:0; left:0; right:0; bottom:0; background:linear-gradient(135deg, rgba(255,255,255,.05), transparent); opacity:0; transition:opacity .3s ease; pointer-events:none}
.card:hover{transform:translateY(-6px) scale(1.02); box-shadow:0 20px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.1) inset, 0 0 20px rgba(255,42,104,.2)}
.card:hover::before{opacity:1}
.card .emoji{font-size:32px; margin-bottom:8px; filter:drop-shadow(0 0 10px rgba(255,42,104,.3))}
.card h3{margin:8px 0 6px; font-weight:600; color:var(--white)}
.card p{margin:0; color:var(--muted); line-height:1.6}

/* Modern Footer - Thinner */
.footer{padding:24px 32px; text-align:center; color:var(--muted); border-top:2px solid rgba(255,42,104,.3); background:linear-gradient(180deg, rgba(0,0,0,.9), rgba(11,10,13,.98)); backdrop-filter:blur(10px); position:relative; overflow:hidden}
.footer::before{content:''; position:absolute; top:0; left:0; right:0; height:1px; background:linear-gradient(90deg, transparent, rgba(255,42,104,.5), transparent)}
.footer.dark{background:linear-gradient(180deg, rgba(0,0,0,.85), rgba(0,0,0,.95))}
.footer div:first-child{font-size:1rem; font-weight:600; color:var(--rose); margin-bottom:4px; text-shadow:0 0 10px rgba(255,42,104,.3)}
.footer div:last-child{font-size:0.85rem; opacity:0.8}

/* Media frame */
.frame{margin:20px auto 0; width:min(560px, 90%); border-radius:18px; padding:10px; background:linear-gradient(180deg, rgba(255,42,104,.15), rgba(123,77,255,.12)); border:1px solid rgba(123,77,255,.35); box-shadow:0 10px 30px rgba(0,0,0,.5)}
.frame .media{width:100%; height:320px; object-fit:cover; border-radius:12px; display:block}

/* Modern Music Player */
.music-player{position:fixed; right:16px; bottom:16px; display:flex; align-items:center; gap:12px; padding:12px 16px; background:rgba(23,19,30,.95); border:1px solid rgba(255,42,104,.4); border-radius:20px; box-shadow:0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05) inset; backdrop-filter:blur(20px); z-index:20; transition:all .3s ease}
.music-player:hover{box-shadow:0 12px 40px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.1) inset, 0 0 20px rgba(255,42,104,.3)}
.music-player .btn{border:0; background:rgba(255,42,104,.2); color:var(--white); padding:10px 12px; border-radius:12px; cursor:pointer; transition:all .2s ease; font-size:14px}
.music-player .btn:hover{background:rgba(255,42,104,.3); transform:scale(1.05)}
.music-player .btn.primary{background:linear-gradient(135deg, var(--rose), var(--purple)); box-shadow:0 0 20px rgba(255,42,104,.4); font-weight:600}
.music-player .btn.primary:hover{box-shadow:0 0 25px rgba(255,42,104,.6); transform:scale(1.08)}
.music-player .btn.icon{padding:10px; font-size:16px}
.music-player .btn.track-nav{
  background:linear-gradient(135deg, rgba(123,77,255,.2), rgba(123,77,255,.1));
  border:1px solid rgba(123,77,255,.4);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding:12px 8px;
  min-width:60px;
}
.music-player .btn.track-nav:hover{
  background:linear-gradient(135deg, rgba(123,77,255,.3), rgba(123,77,255,.2));
  transform:scale(1.05);
  box-shadow:0 4px 15px rgba(123,77,255,.3);
}
.music-player .btn.track-nav .btn-icon{
  font-size:18px;
  line-height:1;
}
.music-player .btn.track-nav .btn-text{
  font-size:11px;
  font-weight:600;
  opacity:0.9;
  letter-spacing:0.3px;
}
.music-player .btn[data-action="stop"]{
  background:rgba(220,38,38,.2);
  border:1px solid rgba(220,38,38,.4);
}
.music-player .btn[data-action="stop"]:hover{
  background:rgba(220,38,38,.3);
  transform:scale(1.05);
}
.music-player .seek{width:160px; height:6px; background:rgba(255,255,255,.1); border-radius:3px; outline:none; cursor:pointer}
.music-player .seek::-webkit-slider-thumb{appearance:none; width:16px; height:16px; background:linear-gradient(135deg, var(--rose), var(--purple)); border-radius:50%; cursor:pointer; box-shadow:0 0 10px rgba(255,42,104,.5)}
.music-player .volume{width:88px; height:6px; background:rgba(255,255,255,.1); border-radius:3px; outline:none; cursor:pointer}
.music-player .volume::-webkit-slider-thumb{appearance:none; width:16px; height:16px; background:linear-gradient(135deg, var(--rose), var(--purple)); border-radius:50%; cursor:pointer; box-shadow:0 0 10px rgba(255,42,104,.5)}
.music-player .meta{min-width:150px; font-size:12px; color:var(--muted); font-weight:500}
.music-player .toggle{background:rgba(255,255,255,.08); border-radius:12px; padding:8px 10px; margin-right:4px; font-weight:600}
.music-player.min{padding:10px 12px; gap:10px}
.music-player.min .seek,.music-player.min .volume,.music-player.min .meta,[data-action="prev"],[data-action="next"]{display:none}

/* Player launcher (open button) */
.player-launcher{position:fixed; right:16px; bottom:16px; width:52px; height:52px; border-radius:50%; display:none; align-items:center; justify-content:center; background:linear-gradient(135deg, var(--rose), var(--purple)); color:#fff; border:1px solid rgba(255,42,104,.6); box-shadow:0 10px 30px rgba(0,0,0,.6), 0 0 20px rgba(255,42,104,.4); z-index:19; cursor:pointer}
.player-launcher.show{display:flex}

/* Square modern player layout */
.music-player.square{
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto auto auto auto;
  gap:10px;
  width:min(360px, calc(100vw - 24px));
  padding:14px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(23,19,30,.96), rgba(11,10,13,.96));
  border:1px solid rgba(255,42,104,.35);
}
.music-player.square .mp-top{display:flex; align-items:center; justify-content:space-between}
.music-player.square .mp-title{font-weight:700; color:var(--white); letter-spacing:.3px}
.music-player.square .mp-controls{display:grid; grid-template-columns:repeat(4, 1fr); gap:10px}
.music-player.square .mp-controls .btn{width:100%; justify-content:center}
.music-player.square .seek{width:100%}
.music-player.square .meta{display:flex; align-items:center; gap:8px; min-width:0}
.music-player.square .time{font-size:12px; color:var(--muted)}

/* Letter Popup Modal */
.letter-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.letter-popup.show {
  display: flex;
}

.popup-container {
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  position: relative;
}

.popup-letter {
  background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
  border: 3px solid #d4c4a8;
  border-radius: 20px;
  box-shadow: 
    0 0 30px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.popup-letter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(139, 69, 19, 0.1) 24px,
      rgba(139, 69, 19, 0.1) 25px
    );
  pointer-events: none;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 2px solid #d4c4a8;
  position: relative;
  z-index: 1;
}

.popup-header h2 {
  color: #8b4513;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.close-popup {
  background: #d4c4a8;
  border: 2px solid #8b4513;
  color: #8b4513;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-popup:hover {
  background: #8b4513;
  color: #f4f1e8;
  transform: scale(1.1);
}

.popup-content {
  padding: 30px;
  max-height: 75vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  min-height: 200px;
}

.letter-text {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.8;
  color: #000000;
  text-align: left;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-height: 100px;
}

/* Password Protection Modal */
.password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.password-modal.show {
  display: flex;
}

.password-container {
  width: 100%;
  max-width: 400px;
  position: relative;
}

.password-box {
  background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
  border: 3px solid #d4c4a8;
  border-radius: 20px;
  box-shadow: 
    0 0 30px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  padding: 30px;
  text-align: center;
}

.password-header h2 {
  color: #8b4513;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  margin: 0 0 10px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.password-hint {
  color: #8b4513;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin: 0 0 20px 0;
  font-style: italic;
}

.password-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#passwordInput {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #d4c4a8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #5d4037;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

#passwordInput:focus {
  border-color: #8b4513;
  box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

.submit-btn, .cancel-btn {
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  border: 2px solid;
}

.submit-btn {
  background: linear-gradient(135deg, #8b4513, #a0522d);
  color: #f4f1e8;
  border-color: #654321;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.submit-btn:hover {
  background: linear-gradient(135deg, #a0522d, #8b4513);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.cancel-btn {
  background: transparent;
  color: #8b4513;
  border-color: #8b4513;
}

.cancel-btn:hover {
  background: #8b4513;
  color: #f4f1e8;
}

.password-error {
  color: #d32f2f;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  margin-top: 10px;
  min-height: 20px;
}

/* Full-screen Letter Overlay */
.letter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.letter-overlay.show {
  display: flex;
}

.parchment-container {
  width: 100%;
  max-width: 800px;
  height: 90vh;
  max-height: 600px;
  position: relative;
}

.parchment-paper {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
  border: 3px solid #d4c4a8;
  border-radius: 15px;
  box-shadow: 
    0 0 30px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.parchment-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(139, 69, 19, 0.1) 24px,
      rgba(139, 69, 19, 0.1) 25px
    );
  pointer-events: none;
}

.parchment-content {
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #d4c4a8;
  padding-bottom: 15px;
}

.letter-header h2 {
  color: #8b4513;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.close-letter {
  background: #d4c4a8;
  border: 2px solid #8b4513;
  color: #8b4513;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.close-letter:hover {
  background: #8b4513;
  color: #f4f1e8;
  transform: scale(1.1);
}

.letter-body {
  flex: 1;
  margin-bottom: 20px;
}

#letterText {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
  color: #5d4037;
  resize: none;
  padding: 0;
  box-sizing: border-box;
}

#letterText::placeholder {
  color: #a1887f;
  font-style: italic;
}

.letter-footer {
  display: flex;
  gap: 15px;
  justify-content: center;
  border-top: 2px solid #d4c4a8;
  padding-top: 15px;
}

.save-letter, .print-letter {
  background: linear-gradient(135deg, #8b4513, #a0522d);
  color: #f4f1e8;
  border: 2px solid #654321;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.save-letter:hover, .print-letter:hover {
  background: linear-gradient(135deg, #a0522d, #8b4513);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile three-dots menu behavior */
@media (max-width:600px){
  .nav{position:sticky}
  .nav .menu-toggle{display:inline-flex; align-items:center; justify-content:center}
  .nav nav{display:none; position:absolute; top:56px; right:12px; flex-direction:column; gap:8px; background:rgba(23,19,30,.96); border:1px solid rgba(255,42,104,.35); padding:10px; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.5)}
  .nav.nav-open nav{display:flex}
}

/* Modern Memories Grid */
.grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:20px}
.tile{position:relative; background:linear-gradient(135deg, rgba(255,42,104,.1), rgba(123,77,255,.08)); border:1px solid rgba(123,77,255,.3); border-radius:18px; padding:12px; overflow:hidden; transition:all .3s cubic-bezier(0.4, 0, 0.2, 1); backdrop-filter:blur(10px); box-shadow:0 8px 32px rgba(0,0,0,.3)}
.tile:hover{transform:translateY(-4px) scale(1.02); box-shadow:0 16px 40px rgba(0,0,0,.5), 0 0 20px rgba(255,42,104,.2); border-color:rgba(255,42,104,.5)}
.tile img{width:100%; height:220px; object-fit:cover; border-radius:14px; display:block; transition:transform .3s ease}
.tile:hover img{transform:scale(1.05)}
.tile .caption{padding:12px 8px 4px; color:var(--muted); font-weight:500; text-align:center}

/* Lightbox */
.lightbox{position:fixed; inset:0; background:rgba(0,0,0,.85); display:none; align-items:center; justify-content:center; z-index:50}
.lightbox.open{display:flex}
.lightbox img{max-width:90vw; max-height:80vh; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,.8)}
.lightbox .close{position:absolute; top:20px; right:24px; background:rgba(255,255,255,.08); color:var(--white); border:0; padding:10px 12px; border-radius:10px; cursor:pointer}

/* Modern WhatsApp-style Messages */
.chat{max-width:820px; margin:0 auto; display:flex; flex-direction:column; gap:16px; padding:20px 0}
.bubble{max-width:75%; padding:16px 18px; border-radius:18px; position:relative; box-shadow:0 2px 8px rgba(0,0,0,.1)}
.bubble.me{align-self:flex-end; background:linear-gradient(135deg, rgba(255,42,104,.4), rgba(123,77,255,.35)); border:1px solid rgba(255,42,104,.3); box-shadow:0 4px 12px rgba(255,42,104,.2)}
.bubble.her{align-self:flex-start; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.15); backdrop-filter:blur(10px)}
.bubble .message-content{font-size:1rem; line-height:1.5; margin-bottom:4px}
.bubble .message-time{font-size:11px; color:var(--muted); opacity:0.7; text-align:right; margin-top:4px}
.bubble.her .message-time{text-align:left}

/* Message animations */
.bubble{animation:messageSlideIn 0.3s ease-out}
@keyframes messageSlideIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Heart monitor styles */
.heart-container{display:flex; flex-direction:column; align-items:center; gap:24px; margin:32px 0}
.heart-monitor{background:linear-gradient(180deg, rgba(23,19,30,.95), rgba(11,10,13,.9)); border:2px solid #ff2a68; border-radius:18px; padding:20px; box-shadow:0 0 20px rgba(255,42,104,.3), 0 10px 30px rgba(0,0,0,.5)}
.heart-display{background:rgba(0,0,0,.8); border:1px solid #ff2a68; border-radius:12px; padding:16px; margin-bottom:16px; position:relative; overflow:hidden}
.monitor-grid{position:absolute; top:0; left:0; right:0; bottom:0; background-image:linear-gradient(rgba(255,42,104,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,42,104,.1) 1px, transparent 1px); background-size:20px 20px; pointer-events:none}
.heart-status{text-align:center}
.pulse-indicator{color:#ff2a68; font-family:'Courier New', monospace}
.pulse-text{display:block; margin-bottom:8px; font-size:14px; color:#ff2a68; text-shadow:0 0 5px rgba(255,42,104,.5)}
.pulse-bar{width:200px; height:6px; background:rgba(0,0,0,.5); border:1px solid #ff2a68; border-radius:3px; margin:0 auto; overflow:hidden}
.pulse-fill{height:100%; background:linear-gradient(90deg, #ff2a68, #ff4d88); border-radius:3px; transition:width .3s ease; box-shadow:0 0 10px rgba(255,42,104,.5)}
.monitor-info{display:flex; justify-content:space-between; margin-top:8px; font-size:12px; color:#ff2a68; text-shadow:0 0 5px rgba(255,42,104,.5)}
.message-container{margin-top:16px}
.message-card{background:linear-gradient(180deg, rgba(255,42,104,.15), rgba(123,77,255,.12)); border:1px solid rgba(123,77,255,.35); border-radius:16px; padding:20px; text-align:center; max-width:500px}
.message-card h3{margin:0 0 12px; color:var(--white)}
.message-card p{margin:0; color:var(--muted); line-height:1.6}

/* Birthday animation keyframes */
@keyframes messageAppear {
  0% { opacity: 0; transform: scale(0.5) translateY(50px); }
  50% { opacity: 0.8; transform: scale(1.1) translateY(-10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes initialMessageAppear {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

@keyframes initialTextAppear {
  0% { opacity: 0; transform: scale(0.5) translateY(50px); }
  50% { opacity: 0.8; transform: scale(1.1) translateY(-10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Modern Game Buttons */
.modern-game-btn {
  background: linear-gradient(135deg, rgba(255,42,104,0.15), rgba(123,77,255,0.12));
  border: 2px solid rgba(255,42,104,0.3);
  border-radius: 20px;
  padding: 20px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modern-game-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.modern-game-btn:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255,42,104,0.6);
  box-shadow: 0 16px 48px rgba(255,42,104,0.3), 0 0 20px rgba(255,42,104,0.2);
  background: linear-gradient(135deg, rgba(255,42,104,0.25), rgba(123,77,255,0.2));
}

.modern-game-btn:hover::before {
  left: 100%;
}

.modern-game-btn:active {
  transform: translateY(-2px) scale(1.01);
}

.modern-game-btn.active {
  background: linear-gradient(135deg, rgba(255,42,104,0.4), rgba(123,77,255,0.3));
  border-color: rgba(255,42,104,0.8);
  box-shadow: 0 0 30px rgba(255,42,104,0.4);
}

.modern-game-btn .btn-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(255,42,104,0.5));
  transition: transform 0.3s ease;
}

.modern-game-btn:hover .btn-icon {
  transform: scale(1.1) rotate(5deg);
}

.modern-game-btn .btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.modern-game-btn .btn-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--white);
  text-shadow: 0 0 10px rgba(255,42,104,0.3);
}

.modern-game-btn .btn-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.8;
  font-style: italic;
}

@media (max-width:600px){
  .title{font-size:34px}
  .nav{padding:16px 20px}
  .nav .brand{font-size:1rem}
  .nav{flex-wrap:wrap}
  .nav nav{gap:4px; width:100%; padding-bottom:6px}
  .nav nav a{padding:10px 14px; font-size:0.9rem; flex:0 0 auto}
  .footer{padding:20px 20px}
  .music-player{left:12px; right:12px; bottom:12px; justify-content:center; border-radius:14px}
  .music-player .seek{width:110px}
  .music-player .volume{width:72px}
  .heart-svg{width:90px; height:90px}
  .letter-widget{margin:60px auto 8px}
  .letter-card{width:300px; height:210px}
  .frame .media{height:220px}
  .tile img{height:180px}
  .chat{padding:10px 0}
  .bubble{max-width:90%}
  .music-player{flex-wrap:wrap; gap:10px}
  .music-player .meta{min-width:auto}
  .heart-monitor{padding:16px}
  .heart-display{padding:12px}
  .pulse-bar{width:160px}
  
  /* Mobile adjustments for rose animation */
  @keyframes textGrow {
    0% { font-size: 0; opacity: 0; transform: translateY(20px); }
    50% { font-size: 0; opacity: 0; transform: translateY(20px); }
    100% { font-size: 1.8rem; opacity: 1; transform: translateY(0); }
  }
}


@media (max-width:360px){
  .nav{padding:12px 14px}
  .nav nav a{padding:8px 12px; font-size:0.85rem}
  .music-player .seek{width:90px}
  .music-player .volume{width:60px}
}

