@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;600;700;900&display=swap');

:root {
  --bg: #1a0533;
  --bg2: #2d0a4e;
  --gold: #ffd700;
  --gold2: #ffb300;
  --pink: #ff69b4;
  --pink2: #e91e8c;
  --white: #fff;
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,215,0,0.3);
  --radius: 18px;
}

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

html, body {
  min-height: 100vh;
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  background: radial-gradient(ellipse at top, #3d0f6b 0%, #1a0533 60%);
  color: var(--white);
  overflow-x: hidden;
}

/* ===== FLOATING HEARTS BACKGROUND ===== */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hearts-bg span {
  position: absolute;
  bottom: -80px;
  font-size: 1.5rem;
  opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(-10deg) scale(0.8); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) rotate(15deg) scale(1.2); opacity: 0; }
}

/* ===== STARS ===== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  width: 3px; height: 3px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%,100% { opacity: 0.1; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.5); }
}

/* ===== LAYOUT ===== */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.room-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  text-align: center;
  margin-bottom: 10px;
}

.room-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  text-align: center;
  margin-bottom: 30px;
}

/* ===== GLASS CARD ===== */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 30px;
  width: 100%;
  max-width: 820px;
}

/* ===== HEART VIDEO / AUDIO CONTAINER ===== */
.heart-wrap {
  position: relative;
  width: 340px;
  height: 310px;
  margin: 0 auto 20px;
}
.heart-clip {
  width: 340px;
  height: 310px;
  clip-path: path('M 170 300 C 170 300 15 195 15 95 C 15 35 55 5 105 5 C 135 5 160 22 170 44 C 180 22 205 5 235 5 C 285 5 325 35 325 95 C 325 195 170 300 170 300 Z');
  overflow: hidden;
  background: #000;
}
.heart-clip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.heart-outline {
  position: absolute;
  top: 0; left: 0;
  width: 340px;
  height: 310px;
  pointer-events: none;
}

/* Video controls bar */
.video-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.btn-play {
  background: linear-gradient(135deg, var(--gold), var(--pink));
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  color: #1a0533;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-play:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(255,215,0,0.5); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 50px;
  padding: 14px 36px;
  color: #1a0533;
  font-family: 'Heebo', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.5px;
}
.btn:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(255,215,0,0.45); }
.btn-secondary {
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  color: #fff;
}

/* ===== PASSWORD INPUT ===== */
.password-section {
  margin-top: 30px;
  text-align: center;
}
.password-section p {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.password-hint {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 14px;
  line-height: 1.2;
  direction: rtl;
}
.password-hint .pw-word { white-space: nowrap; }
.password-hint .pw-gap { display: inline-block; width: 30px; }

.password-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.password-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 12px 20px;
  color: var(--white);
  font-family: 'Heebo', sans-serif;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s;
}
.password-input:focus { border-color: var(--gold); }
.password-input.error { border-color: #ff4466; animation: shake 0.4s; }
.password-input.success { border-color: #44ff88; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-8px); }
  40%,80%  { transform: translateX(8px); }
}
.password-msg {
  margin-top: 10px;
  font-size: 0.95rem;
  min-height: 22px;
}
.password-msg.err { color: #ff6688; }
.password-msg.ok  { color: #66ffaa; }

/* ===== CONFETTI ===== */
.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
  z-index: 9999;
  pointer-events: none;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(110vh) rotate(720deg); }
}

/* ===== VICTORY IMAGE ===== */
.victory-img {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  border: 3px solid var(--gold);
  box-shadow: 0 0 30px rgba(255,215,0,0.4);
  display: block;
  margin: 0 auto 20px;
}

/* ===== PROGRESS DOTS ===== */
.progress-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,215,0,0.3);
  transition: background 0.3s;
}
.dot.done { background: var(--gold); border-color: var(--gold); }
.dot.active { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 8px var(--pink); }

/* ===== VIDEO PLACEHOLDER (video not provided yet) ===== */
.video-placeholder {
  background: rgba(0,0,0,0.35);
  border: 1px dashed rgba(255,215,0,0.4);
  border-radius: 16px;
  padding: 28px 24px;
  margin: 10px auto 0;
  max-width: 420px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}
.video-placeholder .vp-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
}

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ===== GOLD TEXT ===== */
.gold { color: var(--gold); }
.glitter {
  background: linear-gradient(90deg, #ffd700, #ffb300, #fff176, #ffd700);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0%; }
  100% { background-position: 200%; }
}

/* ===== MULTIPLE CHOICE (Room 3) ===== */
.mc-question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 20px;
  line-height: 1.5;
}
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mc-option {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,215,0,0.2);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 1.05rem;
  text-align: right;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.mc-option:hover { background: rgba(255,215,0,0.1); border-color: var(--gold); transform: translateX(-3px); }
.mc-option.correct { background: rgba(68,255,136,0.15); border-color: #44ff88; }
.mc-option.wrong   { background: rgba(255,68,102,0.15); border-color: #ff4466; }
.mc-option.disabled { pointer-events: none; }

/* ===== DRAG AND DROP (Room 1) ===== */
.baby-game {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.baby-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-content: flex-start;
}
.baby-photo {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid rgba(255,215,0,0.3);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.3s;
  user-select: none;
}
.baby-photo:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(255,215,0,0.4); }
.baby-photo.dragging { opacity: 0.4; cursor: grabbing; }
.baby-photo.matched { opacity: 0.3; pointer-events: none; cursor: default; border-color: #44ff88; }

.name-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.name-slot {
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,215,0,0.35);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.name-slot.drag-over { border-color: var(--gold); background: rgba(255,215,0,0.1); }
.name-slot.correct   { border-color: #44ff88; background: rgba(68,255,136,0.1); border-style: solid; }
.name-slot .slot-label { color: var(--gold); font-weight: 700; }
.name-slot .slot-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #44ff88;
}
.name-slot .check { color: #44ff88; font-size: 1.3rem; }

/* ===== CROSSWORD (Room 2) ===== */
.crossword-layout {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}
.crossword-grid-wrap {
  overflow: auto;
}
.crossword-grid {
  display: grid;
  gap: 2px;
  direction: ltr;
}
.cell {
  width: 36px; height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cell.black { background: #0d0020; border-radius: 3px; }
.cell.white {
  background: rgba(255,255,255,0.92);
  border-radius: 3px;
}
.cell.white input {
  width: 100%; height: 100%;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #1a0533;
  font-family: 'Heebo', sans-serif;
  cursor: text;
  direction: rtl;
  text-transform: uppercase;
}
.cell-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 0.45rem;
  font-weight: 700;
  color: #555;
  line-height: 1;
  pointer-events: none;
}
.cell.highlight { background: rgba(255,215,0,0.5); }
.cell.correct-cell { background: rgba(68,255,136,0.5); }
.cell.correct-cell input { color: #006622; }

.clues-panel {
  min-width: 220px;
  max-width: 300px;
  font-size: 0.88rem;
}
.clues-panel h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 700;
}
.clue-item {
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1.4;
  margin-bottom: 4px;
}
.clue-item:hover { background: rgba(255,215,0,0.1); }
.clue-item.active { background: rgba(255,215,0,0.2); color: var(--gold); }
.clue-item.solved { color: #44ff88; }
.clue-num { font-weight: 700; color: var(--gold); margin-left: 4px; }

/* ===== AUDIO ROOM (Room 4) ===== */
.audio-player-wrap {
  text-align: center;
  margin-bottom: 20px;
}
.custom-audio {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: rgba(255,255,255,0.08);
  border-radius: 50px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.audio-play-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #1a0533;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.audio-play-btn:hover { transform: scale(1.1); }
.audio-progress-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}
.audio-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  border-radius: 3px;
  width: 0%;
  transition: width 0.25s;
}
.audio-time {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}
.subtitle-box {
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.7;
  min-height: 60px;
  margin-bottom: 20px;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,215,0,0.15);
}
.sync-image {
  max-width: 320px;
  border-radius: 14px;
  border: 3px solid var(--pink);
  box-shadow: 0 0 20px rgba(255,105,180,0.4);
  display: block;
  margin: 15px auto;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s, transform 0.6s;
}
.sync-image.show { opacity: 1; transform: scale(1); }

/* ===== LETTER ROOM (Room 5) ===== */
.letter-text {
  background: rgba(0,0,0,0.3);
  border-radius: 16px;
  padding: 28px 30px;
  font-size: 1.1rem;
  line-height: 2;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
  text-align: center;
  border: 1px solid rgba(255,215,0,0.25);
  min-height: 120px;
  white-space: pre-line;
}
.letter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--gold);
  animation: blink 0.7s step-end infinite;
  vertical-align: text-bottom;
  margin-right: 2px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.finale-msg {
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* ===== FIREWORKS ===== */
.firework {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
}
.spark {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: sparkFly linear forwards;
}
@keyframes sparkFly {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: var(--tx) scale(0.2); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 650px) {
  .baby-game { grid-template-columns: 1fr; }
  .crossword-layout { flex-direction: column; }
  .heart-wrap, .heart-clip, .heart-outline { width: 280px; height: 255px; }
  .heart-clip { clip-path: path('M 140 248 C 140 248 12 160 12 78 C 12 28 46 4 86 4 C 112 4 132 18 140 36 C 148 18 168 4 194 4 C 234 4 268 28 268 78 C 268 160 140 248 140 248 Z'); }
  .room-title { font-size: 1.5rem; }
  .card { padding: 18px; }
}
