/* ================= Sevgilimə — Romantic Interactive Page ================= */
:root {
  --pink: #ff5c8a;
  --pink-deep: #d6336c;
  --purple: #a855f7;
  --cream: #fff5f7;
  --text: #3a2233;
  --text-dim: #7a5a68;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(160deg, #ffe3ec 0%, #ffd1e0 35%, #ffc9e0 60%, #f3c4ff 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.hidden { display: none !important; }

body.night {
  background: linear-gradient(160deg, #1a1030 0%, #2b1240 35%, #3a1550 60%, #4a1a5c 100%);
  color: #ffe3ec;
  --text: #ffe3ec;
  --text-dim: #d8b7d0;
}
body.night .letter-card,
body.night .surprise-card,
body.night .peace-card,
body.night .admin-card,
body.night .counter-box,
body.night .stage,
body.night .btn-secondary {
  background: #2a1740;
  color: #ffe3ec;
  border-color: #a855f7;
}
body.night .impact-text,
body.night .letter-header h1,
body.night .surprise-card h2,
body.night .game-title,
body.night .love-label,
body.night .achievements-title { color: #ff8fc4; }

.top-controls { position: fixed; top: 1rem; right: 1rem; z-index: 60; display: flex; gap: 0.5rem; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--pink);
  background: #fff; font-size: 1.1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.icon-btn:hover { transform: scale(1.1); }

/* Animated blobs */
.blob-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.45; }
.blob1 { width: 320px; height: 320px; background: #ff9ec4; top: -80px; left: -80px; animation: blobMove 14s ease-in-out infinite; }
.blob2 { width: 280px; height: 280px; background: #c084fc; bottom: -60px; right: -60px; animation: blobMove 18s ease-in-out infinite reverse; }
.blob3 { width: 220px; height: 220px; background: #ff5c8a; top: 40%; left: 60%; animation: blobMove 10s ease-in-out infinite; }
@keyframes blobMove {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px,-30px) scale(1.15); }
}

.confetti-canvas { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

.mouse-heart {
  position: fixed; z-index: 65; pointer-events: none; font-size: 1rem;
  animation: mouseHeartFade 0.8s ease forwards;
  transform: translate(-50%, -50%);
}
@keyframes mouseHeartFade {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.4); }
}

.typewriter-caret { display: inline-block; width: 2px; background: var(--pink-deep); animation: caretBlink 0.8s step-end infinite; margin-left: 1px; }
@keyframes caretBlink { 50% { opacity: 0; } }

.toast-container { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.toast {
  background: #fff; border: 2px solid var(--pink); color: var(--pink-deep);
  padding: 0.75rem 1.5rem; border-radius: 100px; font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2); animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-15px); } }

/* Floating hearts background */
.hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floating-heart {
  position: absolute; bottom: -50px; font-size: 1.5rem; opacity: 0.6;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.7; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

.page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }

/* ===== Envelope ===== */
.envelope-section { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; min-height: 80vh; justify-content: center; }
.envelope {
  width: 220px; height: 150px; position: relative; cursor: pointer;
  filter: drop-shadow(0 20px 40px rgba(214,51,108,0.35));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.envelope-body {
  position: absolute; inset: 0; background: linear-gradient(160deg, #fff, #ffe3ec);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--pink); overflow: hidden;
}
.envelope-heart { font-size: 3rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 90px;
  background: linear-gradient(160deg, var(--pink), var(--pink-deep));
  clip-path: polygon(0 0, 100% 0, 50% 75%);
  transform-origin: top center; transition: transform 0.6s ease;
  z-index: 2;
}
.envelope.open .envelope-flap { transform: rotateX(180deg); }
.envelope-hint { font-family: 'Dancing Script', cursive; font-size: 1.4rem; color: var(--pink-deep); }

/* ===== Letter ===== */
.letter-section { width: 100%; display: flex; justify-content: center; padding: 2rem 0; }
.letter-card {
  background: #fffafc; border-radius: 24px; max-width: 620px; width: 100%;
  padding: 2.5rem 2rem; box-shadow: 0 25px 60px rgba(214,51,108,0.25);
  border: 1px solid #ffd6e5;
  animation: popIn 0.6s cubic-bezier(0.16,1,0.3,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.letter-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.letter-heart { font-size: 1.8rem; }
.letter-header h1 { font-family: 'Dancing Script', cursive; font-size: 2.2rem; color: var(--pink-deep); }
.letter-body {
  white-space: pre-line; line-height: 1.9; font-size: 1.05rem; color: var(--text);
  margin-bottom: 2rem;
}
.btn {
  display: inline-block; font-family: 'Quicksand', sans-serif; font-weight: 700;
  padding: 0.9rem 2rem; border-radius: 100px; border: none; cursor: pointer;
  font-size: 1rem; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff;
  box-shadow: 0 10px 25px rgba(214,51,108,0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(214,51,108,0.45); }
.btn-secondary {
  background: #fff; color: var(--pink-deep); border: 2px solid var(--pink);
}
.btn-secondary:hover { background: var(--pink); color: #fff; }

/* ===== Game ===== */
.game-section { width: 100%; max-width: 720px; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; padding: 1rem 0 3rem; }
.game-title { font-family: 'Dancing Script', cursive; font-size: 2.4rem; color: var(--pink-deep); text-align: center; }
.game-sub { color: var(--text-dim); text-align: center; }

.love-meter-wrap { width: 100%; max-width: 380px; text-align: center; }
.love-label { font-weight: 700; color: var(--pink-deep); font-size: 0.85rem; }
.love-meter { width: 100%; height: 16px; background: #ffe0ea; border-radius: 100px; overflow: hidden; margin-top: 0.4rem; border: 1px solid #ffc2d6; }
.love-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff5c8a, #a855f7); transition: width 0.4s ease; border-radius: 100px; }

.combo-badge {
  font-family: 'Dancing Script', cursive; font-size: 1.8rem; font-weight: 700;
  color: #ff3860; animation: comboPop 0.4s ease;
}
@keyframes comboPop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }

.stage {
  position: relative; width: 100%; max-width: 480px; height: 320px;
  background: radial-gradient(circle at 50% 30%, #fff, #ffe3ec 80%);
  border-radius: 24px; border: 2px dashed var(--pink);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: box-shadow 0.1s ease;
}
.stage.shake { animation: screenShake 0.4s ease; }
@keyframes screenShake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(4px, -2px); }
}

.character {
  position: relative; width: 170px; height: 220px;
  display: flex; align-items: flex-end; justify-content: center;
  transition: width 0.4s ease, height 0.4s ease, transform 0.15s ease;
  filter: contrast(1.1) saturate(1.25);
}
.char-photo {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.25));
}

/* Horse / ride mode sizing */
.character.riding-mode {
  width: 92%; height: 200px;
}

.dust-layer { position: absolute; bottom: 8px; left: 0; right: 0; height: 40px; pointer-events: none; }
.dust-puff {
  position: absolute; bottom: 0; font-size: 1.4rem; opacity: 0.8;
  animation: dustPop 0.6s ease forwards;
}
@keyframes dustPop {
  0% { transform: translateY(0) scale(0.5); opacity: 0.9; }
  100% { transform: translateY(-25px) scale(1.3); opacity: 0; }
}

.flash-overlay {
  position: absolute; inset: 0; background: rgba(255,140,190,0.35);
  opacity: 0; pointer-events: none; border-radius: 24px;
  animation: flashPulse 0.35s ease;
}
@keyframes flashPulse {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}

.love-particle {
  position: absolute; bottom: 20%; font-size: 1.3rem; pointer-events: none;
  animation: loveFloat 0.9s ease forwards;
}
@keyframes loveFloat {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-90px) scale(1.2); opacity: 0; }
}

.impact-layer { position: absolute; inset: 0; pointer-events: none; }
.impact-text {
  position: absolute; font-family: 'Dancing Script', cursive; font-weight: 700;
  font-size: 2rem; color: var(--pink-deep); animation: impactFloat 0.9s ease forwards;
  left: 50%; top: 40%;
}
@keyframes impactFloat {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
  30% { transform: translate(-50%, -20px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(1); opacity: 0; }
}

@keyframes hugSqueeze {
  0%,100% { transform: scale(1) rotate(0); }
  30% { transform: scale(0.92, 1.05) rotate(-3deg); }
  60% { transform: scale(1.05, 0.95) rotate(3deg); }
}
.character.hug { animation: hugSqueeze 0.5s ease; }

@keyframes kissPop {
  0%,100% { transform: scale(1) rotate(0); filter: contrast(1.1) saturate(1.25) brightness(1); }
  40% { transform: scale(1.08) rotate(-2deg); filter: contrast(1.1) saturate(1.4) brightness(1.1); }
  70% { transform: scale(1.02) rotate(2deg); }
}
.character.kiss { animation: kissPop 0.5s ease; }

@keyframes shakeHit {
  0%,100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-14px) rotate(-8deg); }
  40% { transform: translateX(12px) rotate(6deg); }
  60% { transform: translateX(-8px) rotate(-4deg); }
  80% { transform: translateX(6px) rotate(3deg); }
}
.character.hit { animation: shakeHit 0.5s ease; }

@keyframes whipShake {
  0%,100% { transform: scale(1) rotate(0); filter: contrast(1.1) saturate(1.25) brightness(1); }
  25% { transform: scale(1.05) rotate(-5deg); filter: contrast(1.1) saturate(1.4) brightness(1.3) hue-rotate(-10deg); }
  50% { transform: scale(0.97) rotate(5deg); }
  75% { transform: scale(1.03) rotate(-3deg); }
}
.character.whip { animation: whipShake 0.6s ease; }

@keyframes gallopRun {
  0%   { transform: translateX(-38%) scaleX(1) translateY(0); }
  12%  { transform: translateX(-20%) scaleX(1) translateY(-14px); }
  25%  { transform: translateX(0%)   scaleX(1) translateY(0); }
  37%  { transform: translateX(20%)  scaleX(1) translateY(-14px); }
  49%  { transform: translateX(38%)  scaleX(1) translateY(0); }
  50%  { transform: translateX(38%)  scaleX(-1) translateY(0); }
  62%  { transform: translateX(20%)  scaleX(-1) translateY(-14px); }
  75%  { transform: translateX(0%)   scaleX(-1) translateY(0); }
  87%  { transform: translateX(-20%) scaleX(-1) translateY(-14px); }
  99%  { transform: translateX(-38%) scaleX(-1) translateY(0); }
  100% { transform: translateX(-38%) scaleX(1) translateY(0); }
}
.character.ride { animation: gallopRun var(--gallop-duration, 3.2s) linear infinite; }

.speed-row { display: flex; align-items: center; gap: 0.75rem; font-size: 1.2rem; }
.speed-row input[type="range"] { accent-color: var(--pink-deep); width: 160px; }

.counter-row { display: flex; gap: 1rem; }
.counter-box {
  background: #fff; border: 2px solid var(--pink); border-radius: 16px;
  padding: 0.75rem 1.25rem; text-align: center; min-width: 90px;
}
.counter-box span { display: block; font-size: 1.6rem; font-weight: 700; color: var(--pink-deep); }
.counter-box small { color: var(--text-dim); font-size: 0.75rem; }

.action-row { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-top: 0.5rem; }
.action-btn {
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 0.95rem;
  padding: 0.85rem 1.4rem; border-radius: 100px; border: none; cursor: pointer;
  color: #fff; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.action-btn:active { transform: scale(0.92); }
.hug-btn { background: linear-gradient(135deg, #ff9ec4, #ff5c8a); }
.kiss-btn { background: linear-gradient(135deg, #ff5c8a, #d6336c); }
.hit-btn { background: linear-gradient(135deg, #ff8a00, #ff3860); }
.whip-btn { background: linear-gradient(135deg, #a855f7, #d6336c); }
.ride-btn { background: linear-gradient(135deg, #38b6ff, #a855f7); }
.reset-btn { background: #fff; color: var(--pink-deep); border: 2px solid var(--pink); }
.action-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

/* ===== Achievements ===== */
.achievements-wrap { width: 100%; margin-top: 1.5rem; text-align: center; }
.achievements-title { font-family: 'Dancing Script', cursive; font-size: 1.6rem; color: var(--pink-deep); margin-bottom: 0.75rem; }
.achievements-list { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.badge {
  padding: 0.6rem 1rem; border-radius: 14px; font-size: 0.8rem; font-weight: 700;
  background: #ffe0ea; color: #d8a0b5; border: 2px solid #ffc2d6; opacity: 0.55;
  transition: all 0.3s ease;
}
.badge.unlocked { background: linear-gradient(135deg, #ff5c8a, #a855f7); color: #fff; opacity: 1; border-color: transparent; }

/* ===== Surprise ===== */
.surprise-section { width: 100%; max-width: 500px; display: flex; justify-content: center; padding: 1rem 0 3rem; }
.surprise-card {
  background: #fffafc; border-radius: 24px; padding: 2.5rem 2rem; text-align: center;
  box-shadow: 0 25px 60px rgba(214,51,108,0.25); border: 1px solid #ffd6e5; width: 100%;
  animation: popIn 0.6s cubic-bezier(0.16,1,0.3,1);
}
.surprise-emoji { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.surprise-card h2 { font-family: 'Dancing Script', cursive; font-size: 2rem; color: var(--pink-deep); margin-bottom: 0.5rem; }
.surprise-card p { color: var(--text-dim); margin-bottom: 1.25rem; }
.compliment-box {
  background: #ffe0ea; border-radius: 16px; padding: 1.25rem; margin-bottom: 1.25rem;
  font-family: 'Dancing Script', cursive; font-size: 1.4rem; color: var(--pink-deep);
  min-height: 60px; display: flex; align-items: center; justify-content: center;
}

/* ===== Peace popup ===== */
.peace-overlay {
  position: fixed; inset: 0; background: rgba(255,92,138,0.35); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 1rem;
}
.peace-card {
  background: #fff; border-radius: 24px; padding: 2.5rem; text-align: center;
  max-width: 340px; animation: popIn 0.5s ease;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.peace-emoji { font-size: 3.5rem; display: block; margin-bottom: 0.5rem; }
.peace-card h3 { font-family: 'Dancing Script', cursive; font-size: 1.8rem; color: var(--pink-deep); margin-bottom: 0.5rem; }
.peace-card p { color: var(--text-dim); margin-bottom: 1.5rem; }
.peace-btn-row { display: flex; flex-direction: column; gap: 0.75rem; }

/* ===== Owner panel (hidden, Ctrl+Alt+P) ===== */
.admin-panel {
  position: fixed; inset: 0; background: rgba(20,10,30,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 95; padding: 1rem;
}
.admin-card {
  background: #fff; border-radius: 20px; padding: 1.75rem; max-width: 420px; width: 100%;
  max-height: 85vh; display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
.admin-header { display: flex; align-items: center; justify-content: space-between; }
.admin-header h3 { font-family: 'Dancing Script', cursive; font-size: 1.6rem; color: var(--pink-deep); }
.admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; font-size: 0.9rem; font-weight: 700; color: var(--pink-deep); }
.admin-log-wrap { display: flex; flex-direction: column; gap: 0.5rem; overflow: hidden; flex: 1; }
.admin-log-wrap h4 { font-size: 0.85rem; color: var(--text-dim); }
.admin-log-list { overflow-y: auto; display: flex; flex-direction: column; gap: 0.35rem; max-height: 240px; }
.log-entry { font-size: 0.78rem; background: #ffe0ea; border-radius: 10px; padding: 0.5rem 0.7rem; color: var(--text); }

@media (max-width: 480px) {
  .letter-card { padding: 1.75rem 1.25rem; }
  .stage { height: 250px; }
  .character { width: 130px; height: 170px; }
}
