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

:root {
  --bg1: #f8a5c2;
  --bg2: #f9d776;
  --bg3: #a6e3e9;

  /* New button colors */
  --back-btn: #f8a5c2;      /* pink: back */
  --continue-btn: #f9d776;  /* yellow: continue */
  --ink-on-cta: #fff;       /* text stays white */
}

body {
  background:
    radial-gradient(
      80vw 80vh at 50% 50%,
      rgba(0,0,0,0.12) 0%,
      rgba(0,0,0,0.06) 60%,
      rgba(0,0,0,0) 100%
    ),
    linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: cover;
  background-attachment: fixed;
  font-family: 'Arial Rounded MT Bold', 'Arial', sans-serif;
  min-height: 100vh;
  padding: 20px;
}

@media (min-width: 900px) {
  body {
    background:
      radial-gradient(
        60vw 60vh at 50% 50%,
        rgba(0,0,0,0.22) 0%,
        rgba(0,0,0,0.14) 45%,
        rgba(0,0,0,0.06) 70%,
        rgba(0,0,0,0) 100%
      ),
      linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  }
}

/* Wrapper to center splash and app */
#wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

/* Phone frame */
.screen {
  background: white;
  width: 390px;
  height: 700px;
  border: 8px solid #ccc;
  border-radius: 36px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.screen-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Logo */
.logo {
  width: 120px;
  margin: 0 auto 20px auto; /* added 20px bottom margin */
  display: block;
}

/* Headings */
h1 {
  text-align: center;
  background: linear-gradient(135deg, #f8a5c2, #f9d776, #a6e3e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Category Labels */
.category-label {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  color: white;
  margin-bottom: 4px;
}

.intimacy { background: #f39ab5; }
.kink { background: #c084f5; }
.verbal { background: #81c7d4; }
.experimental { background: #f5a97f; }
.bondage { background: #b38dff; }
.sensory { background: #f9ca7d; }
.psychological { background: #e58080; }
.fetish { background: #7ed6df; }
.group { background: #70a1ff; }

/* Paragraphs */
p {
  font-size: 1.1em;
  color: #333;
  text-align: center;
}
.phone-instruction {
  color: #666;
  font-size: 1em;
  text-align: center;
  margin-top: 6px;
}
.screen-content p.question-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 1.3rem;
  font-weight: 700;
  color: #777 !important;   /* Softer than black */
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

/* Buttons */
button {
  background-color: #81c7d4;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s;
  width: 100%;
}

button:hover {
  background-color: #5daab5;
}

button + button {
  margin-top: 10px;
}

/* List Items */
ul {
  list-style: none;
  padding-left: 0;
}

li {
  background: #f2f2f2;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #333;
}

/* WebKit Scrollbar */
.screen-content::-webkit-scrollbar {
  width: 6px;
}

.screen-content::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 10px;
}

.screen-content::-webkit-scrollbar-track {
  background: transparent;
}

/* Modal Styles - CENTERED over phone screen */
#modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: none;
}

.modal h2 {
  font-size: 1.4em;
  text-align: center;
  margin-bottom: 16px;
  color: #333;
}

.modal input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ccc;
  margin-bottom: 16px;
  font-size: 1em;
  text-align: center;
}

/* Splash Screen */
#splash-screen {
  background: url('assets/splash-web.jpg') no-repeat center center;
  background-size: cover;
  width: 390px;
  height: 700px;
  border: 8px solid #ccc;
  border-radius: 36px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Fade-out Animation */
.fade-out {
  animation: fadeOut 1s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

/* ---------- MULTI-SELECT CHIPS (clearly selected) ---------- */
.option-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;     /* keeps text centered */
  background-color: #81c7d4;   /* base aqua */
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.95em;
  transition: background-color 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
  min-width: 140px;            /* ensures consistent size */
  gap: 8px;                    /* space between tick and text */
}

.option-btn:hover {
  background-color: #5daab5;
}

.option-btn:focus-visible {
  outline: 2px solid rgba(31,159,191,0.6);
  outline-offset: 2px;
}

/* Selected = darker, shadowed, tick left */
.option-btn.selected {
  background-color: #1f9fbf;   /* strong teal for contrast */
  box-shadow: 0 0 0 3px rgba(31,159,191,0.25), 0 6px 14px rgba(31,159,191,0.25);
  transform: translateY(-1px);
}

/* Tick on the left, text stays centered */
.option-btn.selected::before {
  content: "✓";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #1f9fbf;
  font-weight: 800;
  font-size: 0.95em;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5) inset;
}

/* Checkmark badge */
.option-btn.selected::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  color: #1f9fbf;
  font-weight: 800;
  font-size: 0.95em;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5) inset;
}

#options-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Helper text under multi-select questions */
.helper-text {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 6px;
  text-align: center;
}

/* --------- MOBILE-ONLY (pure white, stable) --------- */
@media (max-width: 600px) {
  html, body {
    height: 100%;
    overflow: hidden;   /* prevent page rubber-band revealing the page bg */
    padding: 0;
    background: #ffffff; /* not strictly required, but keeps things consistent */
  }

  .screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;     /* visible viewport on iOS */
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #ffffff !important;     /* force true white */
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;    /* no filters = no tint surprises */
    overflow: hidden;                    /* inner area scrolls */
    z-index: 1;
  }

  .screen-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;   /* scroll inside the app */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: transparent !important;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  #splash-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 9999;
  }

  #modal-container { width: 90vw; }
}

.desc-text {
  font-size: 0.95em;
  color: #666;
  line-height: 1.35;
  text-align: center;
  margin-top: -4px;   /* tucks closer to the question */
  margin-bottom: 6px;
}

/* ================== INTERACTION STATES (FINAL) ================== */

/* Desktop/laptop: keep hover highlight */
@media (hover: hover) and (pointer: fine) {
  button:hover,
  .option-btn:hover {
    background-color: #5daab5;
  }
}

/* Mobile/touch: neutralize sticky hover, keep tap feedback, keep selected state */
@media (hover: none), (pointer: coarse) {
  button:hover,
  .option-btn:hover {
    background-color: #81c7d4 !important;
  }
  button:active,
  .option-btn:active:not(.selected) {
    background-color: #6bb1bb !important;
    transform: scale(0.98);
    transition: transform 0.05s ease;
  }
  .option-btn.selected {
    background-color: #1f9fbf !important; /* keep the darker selected */
    box-shadow: 0 0 0 3px rgba(31,159,191,0.25), 0 6px 14px rgba(31,159,191,0.25) !important;
  }
}

/* ================== SAVED MATCHES SCREEN ================== */

/* Saved Matches title (use <h1 class="saved-title">Saved Matches</h1>) */
.screen-content h1.saved-title {
  font-size: 1.8em;
  margin-bottom: 18px;
  text-align: center;
}

/* Card */
.saved-match {
  background: #f9f9fb;
  border: 1px solid #e2e6ea;
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.saved-match:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.08);
}

/* Names INSIDE the card */
.saved-match .match-names {
  font-size: 1em;
  font-weight: 600;
  color: #777;          /* same tone as question text */
  margin-bottom: 8px;
  text-align: center;
}

/* Timestamp line etc. inside the card */
.saved-match p,
.saved-match strong {
  color: #777;          /* soften black */
}
.saved-match p {
  text-align: left;
  margin-bottom: 8px;
}

/* Buttons inside each card: inline, same shape */
.saved-match button {
  width: auto;                 /* override global 100% */
  display: inline-block;
  margin: 6px 6px 0 0;
  padding: 8px 14px;
  border-radius: 16px;
  border: none;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.2s ease;
}

/* View Match → pastel aqua (from --bg3) */
.saved-match button:first-of-type {
  background: var(--bg3);
  color: #fff;
}
.saved-match button:first-of-type:hover {
  background: #8bd5db; /* slightly deeper aqua */
}

/* Delete → pastel pink (from --bg1) */
.saved-match button:last-of-type {
  background: var(--bg1);
  color: #fff;
}
.saved-match button:last-of-type:hover {
  background: #f48cab; /* slightly deeper pink */
}

/* Optional: space above a Back-to-Home button on this screen */
.screen-content h1.saved-title ~ .back-home-btn {
  margin-top: 16px;
}

/* ================== NEW BACK & CONTINUE COLORS ================== */
button.back-btn {
  background-color: var(--back-btn) !important;
  color: var(--ink-on-cta) !important;
}

button.back-btn:hover {
  background-color: #f48cab !important;
}

button.continue-btn {
  background-color: var(--continue-btn) !important;
  color: var(--ink-on-cta) !important;
}

button.continue-btn:hover {
  background-color: #f2c94c !important;
}
/* --- iOS: prevent zoom on focus by keeping inputs >=16px on touch --- */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea,
  .modal input {
    font-size: 16px !important; /* key line to stop iOS zoom */
    line-height: 1.2;
  }

  /* Adjust padding if inputs feel too tall at 16px */
  .modal input {
    padding: 10px;
  }
}