/* ── StringMatch — Main Styles ──────────────────────────────────────────────── */

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --surface:     #161616;
  --surface2:    #1e1e1e;
  --border:      rgba(255, 255, 255, 0.08);
  --border2:     rgba(255, 255, 255, 0.15);
  --text:        #f0ede8;
  --muted:       #7a7672;
  --accent:      #c8f050;
  --accent-dark: #9bbf2a;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --radius:       12px;
  --radius-sm:    8px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height:  100vh;
  line-height: 1.6;
}

/* ── Landing ───────────────────────────────────────────────────────────────── */
#landing {
  min-height:      100vh;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  text-align:      center;
  padding:         2rem;
  position:        relative;
  overflow:        hidden;
}
#landing::before {
  content:        '';
  position:       absolute;
  inset:          0;
  background:     radial-gradient(ellipse 60% 50% at 50% 0%, rgba(200,240,80,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.logo {
  font-family:   var(--font-display);
  font-size:     clamp(3rem, 8vw, 6rem);
  color:         var(--text);
  letter-spacing:-0.02em;
  line-height:   1;
  margin-bottom: 0.5rem;
}
.logo span { color: var(--accent); font-style: italic; }

.tagline {
  font-size:     1rem;
  color:         var(--muted);
  letter-spacing:0.12em;
  text-transform:uppercase;
  margin-bottom: 3rem;
}

.sport-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   12px;
  width:                 100%;
  max-width:             480px;
  margin-bottom:         2rem;
}
.sport-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.5rem 1rem;
  cursor:        pointer;
  transition:    all 0.2s;
  text-align:    center;
}
.sport-card:hover   { border-color: var(--border2); background: var(--surface2); transform: translateY(-2px); }
.sport-card.selected{ border-color: var(--accent);  background: rgba(200,240,80,0.06); }
.sport-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.sport-name { font-size: 0.85rem; font-weight: 500; color: var(--text); }

.start-btn {
  background:    var(--accent);
  color:         #0d0d0d;
  border:        none;
  border-radius: var(--radius-sm);
  padding:       0.9rem 2.5rem;
  font-family:   var(--font-body);
  font-size:     0.95rem;
  font-weight:   500;
  cursor:        pointer;
  transition:    all 0.2s;
  opacity:       0.3;
  pointer-events:none;
}
.start-btn.active                { opacity: 1; pointer-events: all; }
.start-btn.active:hover          { background: #d8ff60; transform: translateY(-1px); }

/* ── Quiz ──────────────────────────────────────────────────────────────────── */
#quiz {
  display:         none;
  min-height:      100vh;
  padding:         2rem;
  align-items:     center;
  justify-content: center;
}
.quiz-inner { width: 100%; max-width: 540px; margin: 0 auto; }

.progress-track {
  height:        2px;
  background:    var(--border);
  border-radius: 1px;
  margin-bottom: 3rem;
}
.progress-fill {
  height:        100%;
  background:    var(--accent);
  border-radius: 1px;
  transition:    width 0.4s ease;
}

.step-meta {
  font-size:     0.75rem;
  color:         var(--muted);
  letter-spacing:0.1em;
  text-transform:uppercase;
  margin-bottom: 0.75rem;
}
.question {
  font-family:   var(--font-display);
  font-size:     clamp(1.6rem, 4vw, 2.2rem);
  color:         var(--text);
  margin-bottom: 2rem;
  line-height:   1.25;
}

.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display:       flex;
  align-items:   center;
  gap:           14px;
  padding:       14px 16px;
  border:        1px solid var(--border);
  border-radius: var(--radius);
  background:    var(--surface);
  cursor:        pointer;
  transition:    all 0.15s;
  text-align:    left;
  width:         100%;
  color:         var(--text);
  font-family:   var(--font-body);
}
.opt:hover    { border-color: var(--border2); background: var(--surface2); }
.opt.selected { border-color: var(--accent);  background: rgba(200,240,80,0.06); }
.opt-icon  { width: 38px; height: 38px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.opt-title { font-size: 0.95rem; font-weight: 500; }
.opt-desc  { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.back-btn {
  background:    transparent;
  border:        1px solid var(--border);
  color:         var(--muted);
  border-radius: var(--radius-sm);
  padding:       0.7rem 1.4rem;
  font-family:   var(--font-body);
  font-size:     0.85rem;
  cursor:        pointer;
  transition:    all 0.15s;
}
.back-btn:hover { border-color: var(--border2); color: var(--text); }
.next-btn {
  background:    var(--accent);
  color:         #0d0d0d;
  border:        none;
  border-radius: var(--radius-sm);
  padding:       0.7rem 1.8rem;
  font-family:   var(--font-body);
  font-size:     0.85rem;
  font-weight:   500;
  cursor:        pointer;
  transition:    all 0.2s;
}
.next-btn:disabled            { opacity: 0.25; cursor: default; transform: none; }
.next-btn:not(:disabled):hover{ background: #d8ff60; }

/* ── Results ───────────────────────────────────────────────────────────────── */
#results {
  display:    none;
  min-height: 100vh;
  padding:    2rem;
}
.results-inner  { max-width: 680px; margin: 0 auto; padding-top: 3rem; }
.results-header { margin-bottom: 2rem; }
.results-eyebrow{
  font-size:     0.75rem;
  color:         var(--accent);
  letter-spacing:0.15em;
  text-transform:uppercase;
  margin-bottom: 0.5rem;
}
.results-title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }

.profile-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.5rem 0; }
.pill { font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

.rec-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.rec-top   { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.rec-badge { font-size: 0.7rem; background: rgba(200,240,80,0.12); color: var(--accent); border: 1px solid rgba(200,240,80,0.25); border-radius: 20px; padding: 3px 10px; white-space: nowrap; flex-shrink: 0; }
.rec-name  { font-family: var(--font-display); font-size: 1.7rem; color: var(--text); margin-bottom: 4px; }
.rec-brand { font-size: 0.85rem; color: var(--muted); }

.rec-specs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.spec      { padding: 1.2rem; text-align: center; border-right: 1px solid var(--border); }
.spec:last-child { border-right: none; }
.spec-val  { font-size: 1.1rem; font-weight: 500; color: var(--text); }
.spec-label{ font-size: 0.72rem; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.08em; }

.rec-bars  { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.bar-row   { display: flex; align-items: center; gap: 12px; }
.bar-name  { font-size: 0.78rem; color: var(--muted); width: 68px; flex-shrink: 0; }
.bar-track { flex: 1; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--accent); border-radius: 2px; width: 0; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.bar-pct   { font-size: 0.78rem; color: var(--muted); width: 32px; text-align: right; flex-shrink: 0; }

.rec-explain { padding: 1.5rem; font-size: 0.9rem; line-height: 1.8; color: #bbb; }

.alt-card   { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.alt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.alt-name   { font-weight: 500; font-size: 1rem; color: var(--text); }
.alt-tag    { font-size: 0.7rem; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; }
.alt-reason { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.alt-specs  { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.alt-spec   { font-size: 0.72rem; color: var(--muted); }
.alt-spec strong { color: var(--text); font-weight: 500; }

.restart-btn {
  display:       inline-flex;
  align-items:   center;
  gap:           8px;
  margin-top:    2rem;
  background:    transparent;
  border:        1px solid var(--border);
  color:         var(--muted);
  border-radius: var(--radius-sm);
  padding:       0.7rem 1.5rem;
  font-family:   var(--font-body);
  font-size:     0.85rem;
  cursor:        pointer;
  transition:    all 0.2s;
}
.restart-btn:hover { border-color: var(--border2); color: var(--text); }
.section-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; margin-top: 2rem; }

/* ── Feedback ──────────────────────────────────────────────────────────────── */
.feedback-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.5rem;
  margin-top:    1.5rem;
  text-align:    center;
}
.feedback-q { font-size: 0.95rem; color: var(--text); margin-bottom: 1.25rem; font-weight: 500; }
.thumb-row  { display: flex; justify-content: center; gap: 12px; }
.thumb-btn  {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       0.7rem 1.6rem;
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  background:    var(--surface2);
  color:         var(--muted);
  font-family:   var(--font-body);
  font-size:     0.9rem;
  cursor:        pointer;
  transition:    all 0.2s;
}
.thumb-btn:hover                       { border-color: var(--border2); color: var(--text); }
.thumb-btn.up:hover, .thumb-btn.up.active   { border-color: var(--accent); color: var(--accent); background: rgba(200,240,80,0.06); }
.thumb-btn.down:hover,.thumb-btn.down.active{ border-color: #f87171;     color: #f87171;     background: rgba(248,113,113,0.06); }
.feedback-done      { font-size: 0.9rem; color: var(--muted); padding: 0.5rem 0; }
.feedback-done span { color: var(--accent); }

/* ── Admin ─────────────────────────────────────────────────────────────────── */
#admin { display: none; min-height: 100vh; padding: 2rem; background: var(--bg); }
.admin-inner        { max-width: 900px; margin: 0 auto; padding-top: 2rem; }
.admin-title        { font-family: var(--font-display); font-size: 2rem; margin-bottom: 0.5rem; }
.admin-sub          { font-size: 0.85rem; color: var(--muted); margin-bottom: 2.5rem; }
.stat-grid          { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 2.5rem; }
.stat-box           { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat-val           { font-size: 1.8rem; font-weight: 500; color: var(--text); }
.stat-lbl           { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.admin-section      { margin-bottom: 2.5rem; }
.admin-section-title{ font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.pattern-row        { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.pattern-row:last-child{ border-bottom: none; }
.pattern-profile    { flex: 1; color: var(--text); }
.pattern-string     { color: var(--muted); font-size: 0.8rem; min-width: 160px; }
.pattern-votes      { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; }
.vote-up            { color: var(--accent); }
.vote-down          { color: #f87171; }
.rating-pill        { font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }
.rating-good        { background: rgba(200,240,80,0.12); color: var(--accent); }
.rating-bad         { background: rgba(248,113,113,0.1); color: #f87171; }
.rating-mixed       { background: var(--surface2); color: var(--muted); }
.log-row            { display: grid; grid-template-columns: 1fr 1.2fr 80px 100px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.log-row:last-child { border-bottom: none; }
.log-profile        { color: var(--muted); line-height: 1.5; }
.log-string         { color: var(--text); font-weight: 500; }
.log-score          { color: var(--muted); }
.log-time           { color: var(--muted); font-size: 0.72rem; }
.empty-state        { text-align: center; padding: 3rem; color: var(--muted); font-size: 0.9rem; }
.admin-clear {
  background:    transparent;
  border:        1px solid rgba(248,113,113,0.3);
  color:         #f87171;
  border-radius: var(--radius-sm);
  padding:       0.5rem 1rem;
  font-family:   var(--font-body);
  font-size:     0.8rem;
  cursor:        pointer;
  transition:    all 0.2s;
  margin-top:    1rem;
}
.admin-clear:hover { background: rgba(248,113,113,0.08); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .sport-grid { grid-template-columns: repeat(3, 1fr); }
  .rec-specs  { grid-template-columns: repeat(3, 1fr); }
  .stat-grid  { grid-template-columns: repeat(2, 1fr); }
  .log-row    { grid-template-columns: 1fr 1fr; }
}
