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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 64px;
}

.site-header {
  width: 100%;
  max-width: 680px;
  padding: 24px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.title-hand {
  height: 36px;
  width: auto;
}

.title-hand--flip {
  transform: scaleX(-1);
}

.site-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #6c63ff, #e040fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#app {
  width: 100%;
  max-width: 680px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover  { transform: scale(1.03); }
.btn:active { transform: scale(0.98); }

.btn-start {
  background: #6c63ff;
  color: #fff;
  font-size: 16px;
  padding: 14px 40px;
  box-shadow: 0 4px 14px rgba(108,99,255,0.35);
}
.btn-start:hover { box-shadow: 0 6px 18px rgba(108,99,255,0.45); }

.btn-human {
  background: #e8f5e9;
  color: #2e7d32;
  border: 2px solid #a5d6a7;
  flex: 1;
}
.btn-human:hover { background: #c8e6c9; }

.btn-ai {
  background: #fce4ec;
  color: #c62828;
  border: 2px solid #f48fb1;
  flex: 1;
}
.btn-ai:hover { background: #f8bbd0; }

.btn-next {
  background: #fff;
  color: #333;
  border: 2px solid #ddd;
  flex: 1;
}
.btn-next:hover { background: #f5f5f5; }

.btn-score {
  background: #6c63ff;
  color: #fff;
  flex: 1;
  box-shadow: 0 2px 8px rgba(108,99,255,0.3);
}
.btn-score:hover { box-shadow: 0 4px 12px rgba(108,99,255,0.4); }

.btn-share {
  background: #fff;
  color: #6c63ff;
  border: 2px solid #6c63ff;
  width: 100%;
  font-size: 15px;
}
.btn-share:hover { background: #f3f2ff; }

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-share-primary {
  width: 100%;
  font-size: 16px;
}

.btn-try-again {
  background: transparent;
  color: #999;
  border: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.12s;
}
.btn-try-again:hover {
  color: #555;
  transform: none;
}

.btn-score--locked {
  background: #e0e0e0;
  color: #aaa;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-score--locked:hover {
  transform: none;
  box-shadow: none;
}

/* ── Intro ────────────────────────────────────────────────────────────────── */

.intro {
  text-align: center;
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.intro-icon { font-size: 56px; margin-bottom: 16px; }
.intro-hand-icon { width: 56px; height: 56px; mix-blend-mode: multiply; }

.intro h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.intro-desc {
  color: #555;
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 16px;
}

.intro-rules {
  list-style: none;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-rules li {
  background: #f7f7fa;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 16px;
  color: #444;
  text-align: left;
}

.intro-rules-challenge {
  font-size: 18px !important;
  color: #222 !important;
}

.tier-low {
  font-weight: 700;
  color: #e53935;
}

.tier-high {
  font-weight: 700;
  background: linear-gradient(90deg, #6c63ff, #e040fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Game ─────────────────────────────────────────────────────────────────── */

.game { display: flex; flex-direction: column; gap: 16px; }

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.progress-track {
  height: 8px;
  display: flex;
  gap: 3px;
}

.progress-segment {
  flex: 1;
  border-radius: 99px;
  transition: background 0.2s ease;
}
.progress-segment--correct { background: #4caf50; }
.progress-segment--wrong   { background: #f44336; }
.progress-segment--empty   { background: #e0e0e0; }

.type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  align-self: flex-start;
}

.type-badge--tweet    { background: #e8f4fd; color: #1da1f2; }
.type-badge--linkedin { background: #e8f0fb; color: #0a66c2; }
.type-badge--blog     { background: #f5f5f5; color: #555;    }
.type-badge--book     { background: #fef3e2; color: #b45309; }

/* Card feedback highlight wrapper */
.card-wrap { border-radius: 12px; transition: box-shadow 0.2s; }
.card-wrap.card-correct { box-shadow: 0 0 0 3px #4caf50; }
.card-wrap.card-wrong   { box-shadow: 0 0 0 3px #f44336; }

/* ── Cards: shared ────────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* ── Tweet card ───────────────────────────────────────────────────────────── */

.card--tweet {
  border-left: 4px solid #1da1f2;
  max-width: 500px;
}

.tweet-header {
  background: #15202b;
  padding: 8px 16px;
  font-size: 18px;
}

.tweet-body { padding: 16px; }

.tweet-text {
  font-size: 15px;
  line-height: 1.6;
  color: #14171a;
  margin-bottom: 14px;
}

.tweet-actions {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #8899a6;
}

/* ── LinkedIn card ────────────────────────────────────────────────────────── */

.card--linkedin {
  border-top: 4px solid #0a66c2;
  border: 1px solid #e0e0e0;
  border-top: 4px solid #0a66c2;
}

.li-text {
  font-size: 14px;
  line-height: 1.65;
  color: #1a1a1a;
  padding: 16px 16px 12px;
}

.li-actions {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
  padding: 10px 16px 14px;
  border-top: 1px solid #f0f0f0;
}

/* ── Blog card ────────────────────────────────────────────────────────────── */

.card--blog {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.blog-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  background: #f0f0f0;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  margin: 16px 16px 0;
}

.blog-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.78;
  color: #1a1a1a;
  padding: 12px 24px 24px;
  border-left: 2px solid #e0e0e0;
  margin: 10px 16px 16px;
}

/* ── Feedback ─────────────────────────────────────────────────────────────── */

.feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
}

.feedback--correct { background: #e8f5e9; color: #2e7d32; }
.feedback--wrong   { background: #fce4ec; color: #c62828; }

.feedback-icon { font-size: 20px; font-weight: 700; }

.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Vote / Next actions ──────────────────────────────────────────────────── */

.vote-actions, .next-actions {
  display: flex;
  gap: 12px;
}

.accuracy-bar-wrap { display: flex; flex-direction: column; gap: 8px; }

.accuracy-bar {
  display: flex;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
}

.accuracy-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.35s ease;
}

.accuracy-segment--correct { background: #4caf50; }
.accuracy-segment--wrong   { background: #f44336; }

.accuracy-nudge {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: 0;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-action {
  display: flex;
}
.score-action .btn-score { flex: 1; }

/* ── Results ──────────────────────────────────────────────────────────────── */

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

.results-top {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  width: 100%;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.tier-badge { width: 80px; height: 80px; margin-bottom: 8px; mix-blend-mode: multiply; }

.big-pct {
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  color: #6c63ff;
}

.tier-label {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  color: #222;
}

.results-sub {
  margin-top: 10px;
  color: #666;
  font-size: 15px;
}

.stat-cards {
  display: flex;
  gap: 12px;
  width: 100%;
}

.stat-card {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  text-align: center;
}

.stat-type {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 8px;
}

.stat-fraction {
  font-size: 20px;
  font-weight: 800;
  color: #222;
  margin-bottom: 8px;
}

.stat-nodata {
  font-size: 13px;
  color: #bbb;
  margin-top: 8px;
}

.mini-track {
  height: 4px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.mini-fill {
  height: 100%;
  background: #6c63ff;
  border-radius: 99px;
  min-width: 3px;
}

.stat-pct {
  font-size: 14px;
  font-weight: 700;
  color: #6c63ff;
}

/* ── Error breakdown ──────────────────────────────────────────────────────── */

.error-breakdown {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.error-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 14px;
}

.error-rows { display: flex; flex-direction: column; gap: 10px; }

.error-row {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  align-items: center;
  gap: 10px;
}

.error-label { font-size: 14px; color: #333; }

.error-bar-wrap {
  background: #f0f0f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.error-bar {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 3px;
  transition: width 0.4s ease;
}

.error-bar--missed { background: #f44336; }
.error-bar--false  { background: #ff9800; }

.error-pct {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  text-align: right;
}

.error-note {
  font-size: 12px;
  color: #aaa;
  margin-top: 10px;
}

/* ── Tidbit ───────────────────────────────────────────────────────────────── */

.tidbit {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tidbit-msg {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
}

.tidbit-quote {
  font-size: 13px;
  color: #78350f;
  font-style: italic;
  line-height: 1.55;
}

.streak-note {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}

.strength-insight {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin: 0;
}

.error-perfect {
  font-size: 14px;
  color: #888;
  font-style: italic;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 500px) {
  .intro { padding: 32px 20px; }
  .big-pct { font-size: 60px; }
  .stat-cards { flex-direction: column; }
  .card--tweet { max-width: 100%; }
  .error-row { grid-template-columns: 1fr 80px 32px; }

  .game { padding-bottom: 140px; }

  .game-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f4f5f7;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
    z-index: 10;
  }

  .results { padding-bottom: 120px; }

  .results-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f4f5f7;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
    z-index: 10;
  }
}

/* ── Stats page ───────────────────────────────────────────────────────────── */

.stats-loading {
  text-align: center;
  padding: 80px 0;
  color: #999;
  font-size: 15px;
}

.stats-page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 48px;
}

.stats-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  padding: 8px 4px 0;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.stat-card--personal {
  border-left: 3px solid #4a9eff;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 6px;
}

.stat-card-headline {
  font-size: 17px;
  color: #1a1a1a;
  line-height: 1.4;
}

.stat-card-sub {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

.stat-card--hero {
  background: #1a1a1a;
  color: #fff;
}

.stat-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.stat-hero-item { text-align: center; }

.stat-hero-divider {
  width: 1px;
  height: 36px;
  background: #444;
}

.stat-big {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stat-hero-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 5px;
}

.stats-play-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 8px;
}

.stats-link {
  display: block;
  text-align: center;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  margin-top: 12px;
  padding: 4px;
}

.stats-link:hover { color: #333; }

.stats-updated {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}
