/* Thai Phrases — taxi dialogue mission (self-contained; mirrors site palette) */
:root {
  --ink: #1c2430;
  --ink-soft: #4a5568;
  --bg: #fdfcfa;
  --card: #ffffff;
  --line: #e7e2d9;
  --accent: #e4572e;
  --accent-dark: #c7431f;
  --accent-darker: #a83518;
  --teal: #0e7c7b;
  --gold: #f2a007;
  --good: #1d8a4e;
  --bad: #c0392b;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(28, 36, 48, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
}

/* ---------- header / footer (mirrors main site) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 252, 250, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.header-inner {
  max-width: 960px; margin: 0 auto; padding: 0.55rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.main-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); text-decoration: none; padding: 0.35rem 0.6rem; border-radius: 8px; }
.main-nav a:hover { color: var(--ink); background: #f3efe7; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-inner { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
.footer-tagline { font-weight: 700; }
.footer-small { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.crumbs { color: var(--ink-soft); font-size: 0.9rem; }
.crumbs a { color: var(--teal); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0.4rem 0 0.6rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.7rem; }
.lede { color: var(--ink-soft); }
.lede a, .transcript a { color: var(--teal); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font: inherit; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 0.55rem 1rem; border-radius: 999px; text-decoration: none;
  box-shadow: var(--shadow);
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--accent-darker); }
.btn-big { font-size: 1.1rem; padding: 0.8rem 1.6rem; }
.btn-small { padding: 0.3rem 0.8rem; font-size: 0.9rem; box-shadow: none; }

/* ---------- mission card ---------- */
.mission-card {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 1.2rem 0;
}
.brief { margin: 0; }
.brief > div { display: flex; gap: 0.8rem; padding: 0.3rem 0; }
.brief dt { flex: 0 0 4.6rem; font-weight: 700; color: var(--accent-dark); }
.brief dd { margin: 0; }
.done-note { color: var(--good); font-weight: 600; margin: 0.7rem 0 0; }

/* ---------- player ---------- */
.player {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem 1.2rem; margin: 1.2rem 0;
}
.player-head { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.progress-label { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.95rem; margin-left: auto; }
.toggle-hint { color: var(--ink-soft); font-size: 0.82rem; }
.progress-track { height: 8px; background: #f0ebe1; border-radius: 99px; margin: 0.7rem 0 1rem; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width 0.4s ease; }
.start-box { text-align: center; padding: 0.6rem 0 0.4rem; }
.voice-note { color: var(--bad); font-size: 0.92rem; }

.feed { display: flex; flex-direction: column; gap: 0.65rem; }
.bubble { max-width: 88%; padding: 0.6rem 0.85rem; border-radius: 14px; position: relative; }
.bubble .who { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 0.15rem; }
.bubble .th { font-size: 1.22rem; font-weight: 600; display: block; }
.bubble .roman { color: var(--ink-soft); display: block; }
.bubble .en { display: block; margin-top: 0.1rem; }
.bubble.driver { background: #eef6f6; border: 1px solid #cfe6e5; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.driver .who { color: var(--teal); }
.bubble.you { background: #fdf0e9; border: 1px solid #f6d5c3; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.you .who { color: var(--accent-dark); }
.bubble.narration { background: #fbf8f1; border: 1px dashed var(--gold); align-self: stretch; max-width: 100%; font-size: 0.98rem; }
.bubble .play-line { margin-top: 0.4rem; }
.text-hidden .th, .text-hidden .roman, .text-hidden .en { visibility: hidden; }
.hidden-hint { font-size: 0.9rem; color: var(--ink-soft); }

.coach {
  align-self: stretch; background: #fff8ec; border: 1px solid #f3ddae;
  border-radius: 10px; padding: 0.55rem 0.8rem; font-size: 0.95rem;
}
.coach strong { color: var(--accent-dark); }

.actions { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.prompt { font-weight: 700; margin: 0 0 0.2rem; }
.choice-btn {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 0.6rem 0.9rem; display: block;
}
.choice-btn:hover:not(:disabled) { border-color: var(--teal); }
.choice-btn:disabled { opacity: 0.45; cursor: default; }
.choice-btn .th { font-size: 1.15rem; font-weight: 700; display: block; }
.choice-btn .roman { color: var(--ink-soft); }
.choice-btn .en { display: block; font-size: 0.92rem; color: var(--ink-soft); }
.choice-btn.picked-wrong { border-color: var(--bad); }
.choice-btn.picked-right { border-color: var(--good); background: #eefaf2; }
.dict-blank { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; }

.repeat-card {
  align-self: stretch; background: #fdf6ee; border: 1px solid #f0d9c4;
  border-radius: 12px; padding: 0.8rem 0.95rem;
}
.repeat-card .cue { font-weight: 700; margin: 0 0 0.4rem; }
.repeat-card .th { font-size: 1.3rem; font-weight: 700; display: block; }
.repeat-card .roman { color: var(--ink-soft); display: block; }
.repeat-card .en { display: block; color: var(--ink-soft); }
.repeat-tools { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.6rem; }
.repeat-tools .btn { box-shadow: none; padding: 0.4rem 0.85rem; font-size: 0.95rem; }

/* ---------- end screen ---------- */
.end-screen {
  background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--good);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 1.2rem 0;
}
.review-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.review-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.review-list .th { font-size: 1.12rem; font-weight: 700; }
.review-list .roman { color: var(--ink-soft); }
.review-list a { color: var(--teal); font-size: 0.92rem; }
.end-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }

/* ---------- transcript & faq ---------- */
.transcript, .faq { margin-top: 2.2rem; }
.lines { list-style: none; counter-reset: line; padding: 0; margin: 0; }
.lines li {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.7rem 0.95rem; margin-bottom: 0.55rem; box-shadow: var(--shadow);
}
.lines .who {
  display: inline-block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.1rem 0.5rem; border-radius: 99px; margin-right: 0.5rem; vertical-align: middle;
}
.lines .who.driver { background: #e2f0ef; color: var(--teal); }
.lines .who.you { background: #fbe3d5; color: var(--accent-dark); }
.lines .th { font-size: 1.18rem; font-weight: 600; }
.lines .roman { color: var(--ink-soft); }
.lines .en { color: var(--ink); }
.badge-new {
  background: var(--gold); color: #4a3200; font-size: 0.72rem; font-weight: 800;
  padding: 0.08rem 0.45rem; border-radius: 99px; vertical-align: middle; text-transform: uppercase;
}
.thai-would-say { background: #fbf8f1; border: 1px dashed var(--gold); border-radius: 12px; padding: 0.8rem 1rem; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.4rem 1rem 0.6rem; margin-bottom: 0.6rem; box-shadow: var(--shadow); }
.faq-item h3 { margin: 0.7rem 0 0.3rem; font-size: 1.05rem; }

@media (max-width: 560px) {
  h1 { font-size: 1.55rem; }
  .bubble { max-width: 95%; }
  .brief > div { flex-direction: column; gap: 0.1rem; }
  .brief dt { flex: none; }
}

/* ---------- accessibility: keyboard focus + reduced motion (P0) ---------- */
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
