/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
  --yellow:     #E8A020;
  --terracotta: #D85A30;
  --cognac:     #B5611A;
  --sand:       #F5E6D3;
  --dark:       #2C2A24;
  --mahogany:   #6B3F2A;
  --sand-light: #FBF3EA;
  --font-display: 'Cormorant Garamond', serif;
  --font-body:    'DM Sans', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--sand);
  color: var(--dark);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ===========================
   GRAIN
   =========================== */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===========================
   SCREEN SYSTEM
   =========================== */
.screen {
  position: fixed; inset: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  z-index: 1; background: var(--sand);
  display: flex; flex-direction: column; overflow: hidden;
}
.screen.active { opacity: 1; pointer-events: all; transform: translateY(0); }

/* ===========================
   MAIN SCREEN
   =========================== */
.main-scroll {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 20px 100px; gap: 28px;
}

/* ===========================
   PROFILE
   =========================== */
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: fadeUp 0.7s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-photo-wrap {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 2px var(--sand), 0 0 0 4px var(--terracotta), 0 8px 24px rgba(44,42,36,0.14);
}
.profile-photo { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.profile-info { text-align: center; background: transparent; }

.name {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2.2rem, 8vw, 3rem); letter-spacing: 0.06em;
  color: var(--dark); line-height: 1; margin-bottom: 6px;
  background: transparent;
}
.tagline {
  font-family: var(--font-body); font-weight: 300;
  font-size: 0.88rem; color: var(--mahogany); font-style: italic;
  background: transparent;
}

/* ===========================
   DATING CARD
   =========================== */
.single-card {
  width: 100%; max-width: 300px;
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}
.dating-card {
  background: var(--sand-light); border-radius: 20px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(44,42,36,0.13);
}
.dating-photo-wrap {
  width: 100%; aspect-ratio: 1; overflow: hidden; cursor: pointer;
}
.dating-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.dating-photo-wrap:hover .dating-photo { transform: scale(1.03); }

.dating-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 16px;
}
.dating-name {
  font-family: var(--font-display); font-weight: 300;
  font-size: 1.6rem; letter-spacing: 0.06em; color: var(--dark);
  flex: 1; text-align: center;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-cross, .btn-heart {
  border: none; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent; flex-shrink: 0;
}
.btn-cross { width: 48px; height: 48px; background: #fff; color: #bbb; box-shadow: 0 3px 12px rgba(44,42,36,0.1); }
.btn-cross svg { width: 18px; height: 18px; }
.btn-heart { width: 48px; height: 48px; background: var(--terracotta); color: #fff; box-shadow: 0 4px 16px rgba(216,90,48,0.32); }
.btn-heart svg { width: 18px; height: 18px; }

.btn-cross:hover  { transform: scale(1.08); }
.btn-heart:hover  { transform: scale(1.08); box-shadow: 0 6px 22px rgba(216,90,48,0.44); }
.btn-cross:active,
.btn-heart:active { transform: scale(0.93); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1.5deg); }
  40% { transform: translateX(7px) rotate(1.5deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake 0.42s ease both; }

/* ===========================
   OOPS
   =========================== */
.oops-msg {
  font-size: 0.82rem; color: var(--mahogany);
  opacity: 0; transform: translateY(5px);
  transition: opacity 0.3s, transform 0.3s;
  text-align: center; font-style: italic; min-height: 18px;
}
.oops-msg.visible { opacity: 1; transform: translateY(0); }
.try-again { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-style: normal; font-weight: 500; color: var(--terracotta); }

/* ===========================
   FOOTER
   =========================== */
.footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  z-index: 10;
  background: linear-gradient(transparent, var(--sand) 40%);
}
.footer-static { position: static; background: none; margin-top: 8px; padding: 16px 24px 24px; }

.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a, .btn-notify {
  color: var(--mahogany); opacity: 0.5; transition: opacity 0.2s, transform 0.2s;
  display: flex; align-items: center; text-decoration: none;
  background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.footer-links a svg, .btn-notify svg { width: 17px; height: 17px; }
.footer-links a:hover, .btn-notify:hover { opacity: 1; transform: translateY(-2px); }
.footer-copy { font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mahogany); opacity: 0.3; }

/* ===========================
   MATCH SCREEN
   =========================== */
#screen-match { background: var(--dark); justify-content: center; align-items: center; }

.match-stage {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 32px 20px;
}
.match-header { display: flex; align-items: center; gap: 14px; }
.match-sparkle { font-size: 1rem; color: var(--yellow); animation: pulse-star 2s ease-in-out infinite; }
@keyframes pulse-star {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.4; transform: scale(0.8); }
}
.match-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2.2rem, 9vw, 3.2rem); color: var(--yellow);
  letter-spacing: 0.04em;
}
.match-photo-wrap { position: relative; width: 130px; height: 130px; }
.match-photo { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; object-position: center top; display: block; position: relative; z-index: 1; }
.match-photo-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--yellow); opacity: 0.4;
  animation: ring-pulse 2.5s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%,100% { transform: scale(1); opacity: 0.4; }
  50%     { transform: scale(1.06); opacity: 0.15; }
}
.match-subtitle {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 1.3rem; color: var(--sand); opacity: 0.65; letter-spacing: 0.04em;
}

/* ===========================
   FLEMME SCREEN
   =========================== */
.flemme-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.flemme-header {
  display: flex; align-items: center; padding: 16px 20px; gap: 12px;
  position: sticky; top: 0; background: var(--sand); z-index: 10;
  border-bottom: 1px solid rgba(107,63,42,0.08);
}
.back-top-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.8rem;
  color: var(--mahogany); opacity: 0.6; padding: 6px 0;
  transition: opacity 0.2s; -webkit-tap-highlight-color: transparent;
}
.back-top-btn:hover { opacity: 1; }
.back-top-btn svg { width: 16px; height: 16px; }
.flemme-header-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: 1.3rem; letter-spacing: 0.06em; color: var(--dark);
  flex: 1; text-align: center; margin-right: 48px;
}

.spotify-wrap { padding: 20px 20px 0; }

/* ===========================
   MOODBOARD — 2 colonnes x 3 lignes
   =========================== */
.moodboard { padding: 24px 20px 0; }
.moodboard-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: 1.6rem; letter-spacing: 0.08em; color: var(--dark); margin-bottom: 16px;
}

.moodboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mood-tile {
  background: var(--sand-light);
  border: 1px solid rgba(107,63,42,0.1);
  border-radius: 14px;
  padding: 14px 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 80px;
}
.mood-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(44,42,36,0.07); }

.tile-mood { background: var(--dark); border-color: transparent; }
.tile-mood .tile-label { color: rgba(245,230,211,0.4); }
.tile-mood .tile-value { color: var(--sand); }

.tile-label {
  font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--cognac); opacity: 0.7;
}
.tile-value {
  font-family: var(--font-display); font-weight: 300;
  font-size: 0.9rem; color: var(--dark); line-height: 1.35;
}

.tile-color-row { display: flex; align-items: center; gap: 8px; }
.color-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #E8A020; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(232,160,32,0.45);
}

/* ===========================
   LIGHTBOX
   =========================== */
.lightbox {
  position: fixed; inset: 0; background: rgba(44,42,36,0.82);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(6px);
}
.lightbox-inner {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 16px; max-width: 320px; width: 100%;
  animation: modalIn 0.3s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-img { width: 100%; border-radius: 16px; display: block; box-shadow: 0 20px 60px rgba(44,42,36,0.4); }
.lightbox-hint { font-size: 0.85rem; color: rgba(245,230,211,0.7); text-align: center; font-style: italic; }
.lightbox-close {
  position: absolute; top: -12px; right: -12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sand); color: var(--dark); border: none; cursor: pointer;
  font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(44,42,36,0.2); transition: background 0.2s;
}
.lightbox-close:hover { background: var(--terracotta); color: #fff; }

/* ===========================
   NOTIFY MODAL
   =========================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(44,42,36,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px; backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--sand-light); border-radius: 20px; padding: 36px 32px;
  max-width: 280px; width: 100%; text-align: center; position: relative;
  box-shadow: 0 20px 60px rgba(44,42,36,0.25); animation: modalIn 0.32s var(--ease) both;
}
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 0.85rem; color: var(--mahogany); opacity: 0.4; cursor: pointer; padding: 4px; transition: opacity 0.2s; }
.modal-close:hover { opacity: 0.8; }
.modal-text { font-family: var(--font-display); font-weight: 300; font-size: 1.15rem; color: var(--dark); line-height: 1.6; }
.modal-text span { font-style: italic; color: var(--cognac); font-size: 0.95rem; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (min-width: 480px) {
  .single-card { max-width: 320px; }
}
@media (max-height: 700px) {
  .profile-photo-wrap { width: 76px; height: 76px; }
  .main-scroll { gap: 18px; padding-top: 28px; }
}
