/* TH-guidou — Brazilian-accent clinic widget.
   Palette borrowed from style.css (Atom One Light). Scoped under
   #th-guidou so nothing leaks into the rest of the page. */

#th-guidou {
  --bg: #ffffff;
  --field: #fafafa;
  --ink: #383a42;
  --muted: #9ca0a4;
  --line: #e7e7e7;
  --blue: #4078f2;
  --purple: #a626a4;
  --orange: #986801;
  --red: #e45649;
  --green: #50a14f;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 1.1rem 1.1rem 1.3rem;
  margin: 1rem 0 1.5rem;
  max-width: 640px;
}
#th-guidou * { box-sizing: border-box; }

#th-guidou .tg-kicker {
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 0.15rem;
}
#th-guidou .tg-sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem; }

/* deck grid */
#th-guidou .tg-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 480px) { #th-guidou .tg-decks { grid-template-columns: 1fr; } }
#th-guidou .tg-deck {
  text-align: left; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--field); padding: 0.7rem 0.8rem; cursor: pointer;
  transition: border-color .15s, transform .08s; font: inherit; color: var(--ink);
}
#th-guidou .tg-deck:hover { border-color: var(--blue); transform: translateY(-1px); }
#th-guidou .tg-deck .tg-deck-label { font-family: var(--mono); font-weight: 600; }
#th-guidou .tg-deck .tg-deck-tag { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
#th-guidou .tg-deck .tg-deck-count { color: var(--blue); font-size: 0.72rem; font-family: var(--mono); }

/* IPA primer */
#th-guidou .tg-primer-toggle {
  margin-top: 0.9rem; background: none; border: none; color: var(--blue);
  font: inherit; font-size: 0.9rem; cursor: pointer; padding: 0; text-decoration: underline;
}
#th-guidou .tg-primer { margin-top: 0.6rem; border-top: 1px dashed var(--line); padding-top: 0.6rem; }
#th-guidou .tg-primer-intro { color: var(--muted); font-size: 0.82rem; margin: 0 0 0.5rem; }
#th-guidou .tg-primer-row { display: flex; gap: 0.55rem; align-items: baseline; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
#th-guidou .tg-primer-row:last-child { border-bottom: none; }
#th-guidou .tg-primer-play {
  font: inherit; font-size: 0.7rem; cursor: pointer; flex: 0 0 auto;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--field);
  color: var(--blue); width: 1.6rem; height: 1.6rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; align-self: center;
}
#th-guidou .tg-primer-play:hover { border-color: var(--blue); }
#th-guidou .tg-primer-sym { font-family: var(--mono); color: var(--purple); font-weight: 700; min-width: 2.6rem; }
#th-guidou .tg-primer-body { display: flex; flex-direction: column; }
#th-guidou .tg-primer-say { font-weight: 600; }
#th-guidou .tg-primer-ex { color: var(--muted); }
#th-guidou .tg-primer-ex b { color: var(--ink); }
#th-guidou .tg-primer-tip { color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
#th-guidou .tg-streak { margin-top: 0.8rem; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* card */
#th-guidou .tg-progress { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
#th-guidou .tg-card { text-align: center; padding: 1.3rem 0.5rem 0.4rem; }
#th-guidou .tg-word { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.01em; }
#th-guidou .tg-ipa { font-family: var(--mono); font-size: 1.35rem; color: var(--purple); margin-top: 0.3rem; }
#th-guidou .tg-hintline { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }

/* Brazilian trap contrast */
#th-guidou .tg-trap {
  border: 1.5px solid #f3d9d6; background: #fdf3f2; color: var(--ink);
  border-radius: 10px; padding: 0.5rem 0.8rem; margin: 0.6rem 0 0.2rem;
  font-size: 0.9rem; text-align: center;
}
#th-guidou .tg-trap b { color: var(--red); }
#th-guidou .tg-trap-flag { margin-right: 0.15rem; }

#th-guidou .tg-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.9rem; }
#th-guidou button.tg-btn {
  font: inherit; font-size: 0.9rem; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink);
  padding: 0.5rem 1rem; transition: border-color .15s, background .15s;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
#th-guidou button.tg-btn:hover { border-color: var(--blue); }
#th-guidou button.tg-btn:disabled { opacity: 0.45; cursor: default; }
#th-guidou button.tg-btn.tg-primary { border-color: var(--blue); color: var(--blue); }
#th-guidou button.tg-btn.tg-br { border-color: var(--orange); color: var(--orange); }
#th-guidou button.tg-btn.tg-br:hover { border-color: var(--orange); background: #fbf3e5; }
#th-guidou button.tg-btn.tg-rec { border-color: var(--red); color: var(--red); }
#th-guidou button.tg-btn.tg-recording { background: var(--red); color: #fff; border-color: var(--red); }

#th-guidou .tg-judge { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.2rem; }
#th-guidou button.tg-again { border-color: var(--red); color: var(--red); }
#th-guidou button.tg-again:hover { background: var(--red); color: #fff; }
#th-guidou button.tg-got { border-color: var(--green); color: var(--green); }
#th-guidou button.tg-got:hover { background: var(--green); color: #fff; }

#th-guidou .tg-foot { margin-top: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
#th-guidou .tg-link { background: none; border: none; color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer; text-decoration: underline; padding: 0; }
#th-guidou .tg-hint { color: var(--muted); font-size: 0.78rem; }

/* summary */
#th-guidou .tg-summary { text-align: center; padding: 0.6rem 0.3rem; }
#th-guidou .tg-summary h4 { margin: 0.2rem 0 0.6rem; }
#th-guidou .tg-summary .tg-again-list { font-family: var(--mono); color: var(--red); }
