/* ============================================================
   MEIWORD — TENSE TAP GAME
   Style: Simple, High-contrast, Natural Casing, No Emoji.
   ============================================================ */

:root {
  --ink: #1e1b4b;
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --indigo-soft: #eef2ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --gold: #b45309;
  --gold-soft: #fef3c7;
  --bg: #fdfbf7;
  --card: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
}

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

html, body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(#e2e8f0 1.1px, transparent 1.1px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
}

a {
  color: inherit;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 50px;
}

/* ---------- top nav & breadcrumb ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.backlink {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--indigo-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.backlink:hover {
  text-decoration: underline;
}

.player-chip {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--indigo-dark);
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- hero / header ---------- */
.hero {
  text-align: center;
  padding: 10px 0 24px;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--indigo-dark);
  background: var(--indigo-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
}

.hero h1 span {
  color: var(--indigo);
}

.hero-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- mode selection cards ---------- */
.mode-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.mode-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(30, 27, 75, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--indigo);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.1);
}

.mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mode-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.mode-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo-dark);
}

.mode-subtitle {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--indigo);
}

.mode-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.mode-action {
  margin-top: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--indigo-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- hud (heads-up display) ---------- */
.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.hud-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}

.hud-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.hud-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--ink);
  margin-top: 2px;
}

/* ---------- timer bar ---------- */
.timebar-wrap {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.timebar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--indigo-dark));
  border-radius: 999px;
  transition: width 0.1s linear, background-color 0.2s ease;
}

.timebar-fill.warning {
  background: #f59e0b;
}

.timebar-fill.danger {
  background: var(--red);
}

/* ---------- game question card ---------- */
.question-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 10px 28px rgba(30, 27, 75, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clue-pill {
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(180, 83, 9, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
}

.sentence-display {
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}

.blank-slot {
  display: inline-block;
  min-width: 100px;
  border-bottom: 3.5px solid var(--indigo);
  color: var(--indigo-dark);
  text-align: center;
  padding: 0 8px;
  font-weight: 700;
}

.blank-slot.is-filled {
  background: var(--indigo-soft);
  border-radius: 8px;
  border-bottom-color: transparent;
  padding: 2px 10px;
}

/* ---------- choice buttons ---------- */
.options-grid {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.option-btn {
  appearance: none;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
  box-shadow: 0 4px 0 var(--line);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--indigo);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--indigo-dark);
}

.option-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--indigo-dark);
}

.option-btn.correct {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 4px 0 var(--green);
}

.option-btn.wrong {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 4px 0 var(--red);
}

.option-btn:disabled {
  cursor: default;
}

/* ---------- feedback box ---------- */
.feedback-box {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-box.correct {
  background: var(--green-soft);
  border: 1px solid var(--green);
  color: #14532d;
}

.feedback-box.wrong {
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: #7f1d1d;
}

.feedback-status {
  font-weight: 700;
  font-size: 0.84rem;
}

/* ---------- button controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--indigo);
  background: #fafbff;
}

/* ---------- end screen ---------- */
.end-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(30, 27, 75, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.end-badge {
  display: inline-block;
  align-self: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--indigo-dark);
  background: var(--indigo-soft);
  padding: 5px 14px;
  border-radius: 999px;
}

.end-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.end-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0;
}

.end-stat {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
}

.end-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.end-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--ink);
  margin-top: 3px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* ---------- review list ---------- */
.review-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-header {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.review-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
}

.review-item.pass {
  border-left: 4px solid var(--green);
}

.review-item.fail {
  border-left: 4px solid var(--red);
}

.review-status {
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.review-item.pass .review-status { color: var(--green); }
.review-item.fail .review-status { color: var(--red); }

/* ---------- footer ---------- */
.game-footer {
  margin-top: 36px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
