/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #181818;
  --surface: #222222;
  --accent: #C0A062;
  --text: #EAEAEA;
  --text2: #888888;
  --error: #CF6679;
  --success: #4CAF50;
  --warning: #FFA726;
  --match: #7B9EC6;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  max-width: 600px;
  margin: 0 auto;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ===== LANDING ===== */
.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 32px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.landing-top {
  padding-top: 15vh;
}

.landing-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}

.landing-title {
  font-family: 'EB Garamond', serif;
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 20px;
}

.landing-rule {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 20px;
}

.landing-subtitle {
  font-size: 15px;
  font-weight: 300;
  color: var(--text2);
  line-height: 1.7;
  max-width: 340px;
}

.landing-bottom {
  text-align: center;
}

.landing-time {
  font-size: 12px;
  color: var(--text2);
  margin-top: 12px;
}

.landing-privacy {
  font-size: 11px;
  color: rgba(136,136,136,0.6);
  margin-top: 8px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  border: none;
  padding: 14px 36px;
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: opacity 0.3s;
  width: 100%;
  max-width: 320px;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { opacity: 0.8; }

.btn-small {
  padding: 10px 24px;
  width: auto;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(192,160,98,0.3);
  padding: 12px 24px;
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  max-width: 320px;
}

.btn-secondary:hover {
  background: rgba(192,160,98,0.08);
  border-color: var(--accent);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text2);
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

/* ===== QUIZ ===== */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(234,234,234,0.08);
  position: relative;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-text {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.5px;
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

.quiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
  -webkit-overflow-scrolling: touch;
}

.category-title {
  font-family: 'EB Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.category-hint {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 20px;
}

.limit-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--error);
  color: var(--error);
  font-size: 9px;
  font-weight: 700;
  vertical-align: -2px;
}

/* Kink card grid */
.kink-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kink-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid rgba(234,234,234,0.06);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.kink-card.selected {
  border-color: var(--accent);
  background: rgba(192,160,98,0.06);
}

.kink-card.hard-limit {
  border-color: var(--error);
  background: rgba(207,102,121,0.06);
}

.kink-checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(234,234,234,0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.kink-card.selected .kink-checkbox {
  border-color: var(--accent);
  background: var(--accent);
}

.kink-card.hard-limit .kink-checkbox {
  border-color: var(--error);
  background: var(--error);
}

.kink-checkbox svg {
  opacity: 0;
  transition: opacity 0.2s;
}

.kink-card.selected .kink-checkbox svg,
.kink-card.hard-limit .kink-checkbox svg {
  opacity: 1;
}

.kink-name {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.kink-card.hard-limit .kink-name {
  color: var(--error);
  text-decoration: line-through;
  text-decoration-color: rgba(207,102,121,0.4);
}

.kink-limit-btn {
  background: none;
  border: 1px solid rgba(207,102,121,0.3);
  color: var(--error);
  width: 24px;
  height: 24px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.kink-card:hover .kink-limit-btn,
.kink-card.hard-limit .kink-limit-btn {
  opacity: 1;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(234,234,234,0.06);
  flex-shrink: 0;
}

/* ===== IMPORTANCE SCREEN ===== */
.importance-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
  -webkit-overflow-scrolling: touch;
}

.section-title {
  font-family: 'EB Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.importance-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.importance-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid rgba(234,234,234,0.06);
}

.importance-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

/* Shared toggle button styles (role + importance use same base) */
.toggle-group {
  display: flex;
  flex: 1;
}

.toggle-group button {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(234,234,234,0.12);
  color: var(--text2);
  font-family: 'Work Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 7px 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  margin-left: -1px;
}

.toggle-group button:first-child { margin-left: 0; }

.toggle-group button.active {
  background: rgba(192,160,98,0.12);
  border-color: var(--accent);
  color: var(--accent);
  z-index: 1;
}

/* Per-kink importance item with role */
.importance-item {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.importance-row {
  display: flex;
  align-items: center;
  gap: 0;
}

/* ===== RESULTS ===== */
.results-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.results-header {
  text-align: center;
  padding: 48px 24px 0;
}

.results-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}

.results-title {
  font-family: 'EB Garamond', serif;
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1px;
}

.results-radar {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.results-radar canvas {
  max-width: 100%;
  height: auto !important;
}

/* Results sections */
.results-section {
  padding: 0 24px;
  margin-bottom: 40px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.section-number {
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.section-label {
  font-family: 'EB Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.section-desc-sm {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 440px;
}

/* Role Spectrum Strip */
.spectrum-box {
  background: var(--surface);
  border: 1px solid rgba(192,160,98,0.2);
  padding: 24px;
}

.spectrum-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.spectrum-labels span {
  font-size: 9px;
  color: var(--text2);
  letter-spacing: 1.25px;
  text-transform: uppercase;
  font-weight: 600;
}

.spectrum-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent), #555 40%, #555 60%, var(--match));
  margin-bottom: 12px;
}

.spectrum-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translate(-50%, -50%);
  transition: left 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(192,160,98,0.4);
}

.spectrum-reading {
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* Dimension Summary Cards */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dim-card {
  background: var(--surface);
  border: 1px solid rgba(192,160,98,0.2);
  padding: 20px;
}

.dim-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.25px;
  color: var(--text2);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.dim-value {
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.dim-desc {
  font-size: 10px;
  color: var(--text2);
}

/* Breadth arc — canvas drawn */
.arc-container {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px auto;
}

.arc-container canvas {
  width: 80px;
  height: 80px;
}

/* Depth bars */
.depth-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 50px;
  margin-bottom: 8px;
}

.depth-bar {
  flex: 1;
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tall visual area for role + boundary cards */
.dim-card-visual-tall {
  height: 50px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

/* Mini spectrum in card */
.mini-spectrum {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent), #555 40%, #555 60%, var(--match));
  margin-bottom: 8px;
}

.mini-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  transform: translate(-50%, -50%);
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Boundary bar in card */
.boundary-bar {
  display: flex;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
}

.boundary-seg {
  height: 100%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.boundary-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.boundary-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text2);
}

.boundary-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.results-divider {
  width: 60px;
  height: 1px;
  background: rgba(192,160,98,0.3);
  margin: 40px auto;
}

.results-rings {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.results-rings canvas {
  max-width: 100%;
  height: auto !important;
}

.rings-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 16px;
}

.legend-chip {
  font-size: 9px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-swatch {
  width: 12px;
  height: 6px;
  flex-shrink: 0;
}

.results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}

.results-cta {
  text-align: center;
  padding: 48px 24px 64px;
}

.cta-text {
  font-family: 'EB Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.4;
}

.btn-cta {
  text-decoration: none;
  max-width: 240px;
}

/* ===== COMPARE ===== */
.compare-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 48px;
  -webkit-overflow-scrolling: touch;
}

.compare-input-group {
  margin-top: 8px;
  margin-bottom: 32px;
}

.input-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.25px;
  color: var(--text2);
  display: block;
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid rgba(234,234,234,0.1);
  color: var(--text);
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: var(--accent);
}

.text-input::placeholder {
  color: rgba(136,136,136,0.5);
}

.compare-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mutual-kinks {
  margin-top: 24px;
}

.mutual-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.25px;
  color: var(--accent);
  margin-bottom: 12px;
}

.mutual-tag {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 6px 6px 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  background: rgba(192,160,98,0.08);
  border: 1px solid rgba(192,160,98,0.2);
}

.mutual-none {
  font-size: 13px;
  color: var(--text2);
  font-style: italic;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(192,160,98,0.3);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.toast.show {
  bottom: 32px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .landing-title { font-size: 80px; }
  .results-title { font-size: 56px; }
  .kink-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (min-width: 900px) {
  .kink-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,160,98,0.2); }
