.ti-tg {
--tg-bg: #ffffff;
--tg-surface: #f7f5f0;
--tg-ink: #25323a;
--tg-muted: #6b7a83;
--tg-accent: #1d6f6a; --tg-accent-soft: #e3f0ef;
--tg-gold: #c8962e; --tg-gold-soft: #faf2e0;
--tg-green: #2e8b57;
--tg-red: #c0473d;
--tg-radius: 14px;
--tg-shadow: 0 2px 10px rgba(37, 50, 58, 0.08);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
color: var(--tg-ink);
max-width: 680px;
margin: 1.5em auto;
line-height: 1.5;
}
.ti-tg *, .ti-tg *::before, .ti-tg *::after { box-sizing: border-box; }
.ti-tg .ti-tg-thai {
font-family: "Noto Sans Thai", "Leelawadee UI", "Tahoma", -apple-system, sans-serif;
} .ti-tg-tabs {
display: flex;
gap: 6px;
flex-wrap: wrap;
margin-bottom: 16px;
}
.ti-tg-tab {
flex: 1 1 auto;
min-width: 110px;
padding: 10px 12px;
border: 1px solid #dfe5e2;
border-radius: 999px;
background: var(--tg-bg);
color: var(--tg-muted);
font-size: 14px;
font-weight: 600;
cursor: pointer;
text-align: center;
transition: background 0.15s ease, color 0.15s ease;
}
.ti-tg-tab:hover { background: var(--tg-surface); }
.ti-tg-tab.ti-tg-active {
background: var(--tg-accent);
border-color: var(--tg-accent);
color: #fff;
}
.ti-tg-tab:focus-visible,
.ti-tg button:focus-visible,
.ti-tg select:focus-visible {
outline: 3px solid var(--tg-gold);
outline-offset: 2px;
} .ti-tg-panel {
background: var(--tg-surface);
border-radius: var(--tg-radius);
padding: 20px;
box-shadow: var(--tg-shadow);
}
.ti-tg-toolbar {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
margin-bottom: 14px;
}
.ti-tg-toolbar label {
font-size: 13px;
font-weight: 600;
color: var(--tg-muted);
}
.ti-tg select {
padding: 8px 10px;
border: 1px solid #d6ddd9;
border-radius: 8px;
background: #fff;
font-size: 14px;
color: var(--tg-ink);
max-width: 100%;
}
.ti-tg-progress {
margin-left: auto;
font-size: 13px;
color: var(--tg-muted);
font-variant-numeric: tabular-nums;
}  .ti-tg .ti-tg-card,
.ti-tg .ti-tg-card:hover,
.ti-tg .ti-tg-card:focus,
.ti-tg .ti-tg-card:active {
position: relative !important;
width: 100% !important;
box-sizing: border-box !important;
min-height: 240px;
max-width: none !important;
margin: 0 !important;
cursor: pointer;
border: 1px solid #e6e2d8;
border-radius: var(--tg-radius);
background: var(--tg-bg);
box-shadow: none;
padding: 44px 24px 36px !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
text-align: center !important;
gap: 6px;
line-height: 1.4 !important;
font-family: inherit;
color: var(--tg-ink);
transition: opacity 0.16s ease;
opacity: 1;
float: none !important;
}  .ti-tg .ti-tg-card.ti-tg-card > span,
.ti-tg .ti-tg-card.ti-tg-card > div,
.ti-tg .ti-tg-card.ti-tg-card > p {
display: block !important;
width: auto !important;
max-width: 100% !important;
float: none !important;
clear: none !important;
margin-left: 0 !important;
margin-right: 0 !important;
white-space: normal !important;
} .ti-tg .ti-tg-card.ti-tg-card .ti-tg-word-thai-sm,
.ti-tg .ti-tg-card.ti-tg-card .ti-tg-word-pron,
.ti-tg .ti-tg-card.ti-tg-card .ti-tg-word-sv,
.ti-tg .ti-tg-card.ti-tg-card .ti-tg-example { display: block !important; }
.ti-tg .ti-tg-card.ti-tg-card-back { justify-content: flex-start !important; }
.ti-tg .ti-tg-card.ti-tg-fade { opacity: 0; } @media (min-width: 601px) {
.ti-tg .ti-tg-card,
.ti-tg .ti-tg-card:hover,
.ti-tg .ti-tg-card:focus,
.ti-tg .ti-tg-card:active {
height: 520px;
min-height: 0;
overflow-y: auto;
}
}
@media (prefers-reduced-motion: reduce) {
.ti-tg .ti-tg-card { transition: none; }
} .ti-tg .ti-tg-card span,
.ti-tg .ti-tg-card:hover span,
.ti-tg .ti-tg-card:focus span { color: var(--tg-ink); }
.ti-tg .ti-tg-card .ti-tg-word-thai,
.ti-tg .ti-tg-card:hover .ti-tg-word-thai { color: var(--tg-ink); font-size: 44px; line-height: 1.25; }
.ti-tg .ti-tg-card .ti-tg-word-thai-sm,
.ti-tg .ti-tg-card:hover .ti-tg-word-thai-sm { color: var(--tg-ink); font-size: 30px; line-height: 1.25; }
.ti-tg .ti-tg-card .ti-tg-word-sv,
.ti-tg .ti-tg-card:hover .ti-tg-word-sv { color: var(--tg-ink); font-size: 22px; font-weight: 700; line-height: 1.3 !important; margin-bottom: 2px; }
.ti-tg .ti-tg-card .ti-tg-word-pron,
.ti-tg .ti-tg-card:hover .ti-tg-word-pron { color: var(--tg-accent); font-size: 18px; font-weight: 600; line-height: 1.3 !important; }
.ti-tg .ti-tg-card .ti-tg-word-cat,
.ti-tg .ti-tg-card:hover .ti-tg-word-cat {
color: var(--tg-gold);
position: absolute !important;
top: 14px !important;
left: 16px !important;
width: auto !important;
margin: 0 !important;
font-size: 11px;
letter-spacing: 0.06em;
text-transform: uppercase;
font-weight: 700;
}
.ti-tg .ti-tg-card .ti-tg-flip-hint,
.ti-tg .ti-tg-card:hover .ti-tg-flip-hint {
color: var(--tg-muted);
font-size: 12px;
}
.ti-tg .ti-tg-card-front .ti-tg-flip-hint {
position: absolute !important;
bottom: 12px;
left: 0;
right: 0;
margin: 0 !important;
}
.ti-tg .ti-tg-card-back .ti-tg-flip-hint { margin-top: 14px; }
.ti-tg .ti-tg-card .ti-tg-example,
.ti-tg .ti-tg-card:hover .ti-tg-example {
color: var(--tg-muted);
display: block;
margin-top: 8px;
padding-top: 8px;
border-top: 1px dashed #ddd6c8;
font-size: 13px;
line-height: 1.45;
max-width: 100%;
}
.ti-tg .ti-tg-card .ti-tg-example .ti-tg-thai,
.ti-tg .ti-tg-card:hover .ti-tg-example .ti-tg-thai { color: var(--tg-ink); font-size: 17px; display: block; }
@media (max-width: 600px) {
.ti-tg .ti-tg-card { height: 480px; overflow-y: auto; padding: 38px 14px 28px !important; }
.ti-tg .ti-tg-card .ti-tg-word-thai,
.ti-tg .ti-tg-card:hover .ti-tg-word-thai { font-size: 34px; }
.ti-tg .ti-tg-card .ti-tg-word-thai-sm,
.ti-tg .ti-tg-card:hover .ti-tg-word-thai-sm { font-size: 24px; }
.ti-tg .ti-tg-card .ti-tg-word-sv,
.ti-tg .ti-tg-card:hover .ti-tg-word-sv { font-size: 18px; }
.ti-tg .ti-tg-card .ti-tg-example,
.ti-tg .ti-tg-card:hover .ti-tg-example { font-size: 12px; line-height: 1.4; margin-top: 7px; padding-top: 7px; }
.ti-tg .ti-tg-card .ti-tg-example .ti-tg-thai,
.ti-tg .ti-tg-card:hover .ti-tg-example .ti-tg-thai { font-size: 16px; }
} .ti-tg-actions {
display: flex;
gap: 10px;
margin-top: 14px;
flex-wrap: wrap;
}
.ti-tg-btn {
flex: 1 1 0;
min-width: 120px;
padding: 12px 14px;
border: 0;
border-radius: 10px;
font-size: 15px;
font-weight: 700;
cursor: pointer;
color: #fff;
background: var(--tg-accent);
transition: filter 0.15s ease;
}
.ti-tg-btn:hover { filter: brightness(1.08); }
.ti-tg-btn-good { background: var(--tg-green); }
.ti-tg-btn-bad { background: var(--tg-red); }
.ti-tg-btn-ghost {
background: #fff;
color: var(--tg-ink);
border: 1px solid #d6ddd9;
font-weight: 600;
} .ti-tg-q-prompt {
background: var(--tg-bg);
border: 1px solid #e6e2d8;
border-radius: var(--tg-radius);
padding: 22px;
text-align: center;
margin-bottom: 14px;
}
.ti-tg-q-thai { font-size: 38px; line-height: 1.3; }
.ti-tg-q-pron { font-size: 16px; color: var(--tg-accent); font-weight: 600; }
.ti-tg-q-sv { font-size: 26px; font-weight: 700; }
.ti-tg-q-label { font-size: 12px; color: var(--tg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.ti-tg-choices {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
@media (max-width: 480px) {
.ti-tg-choices { grid-template-columns: 1fr; }
.ti-tg-word-thai { font-size: 36px; }
}
.ti-tg-choice {
padding: 14px 12px;
border: 1px solid #d6ddd9;
border-radius: 10px;
background: #fff;
font-size: 16px;
cursor: pointer;
text-align: center;
color: var(--tg-ink);
transition: background 0.15s ease, border-color 0.15s ease;
}
.ti-tg-choice:hover:not(:disabled) { background: var(--tg-accent-soft); border-color: var(--tg-accent); }
.ti-tg-choice:disabled { cursor: default; opacity: 0.85; }
.ti-tg-choice.ti-tg-correct {
background: #e6f4ec;
border-color: var(--tg-green);
color: #1c5b38;
font-weight: 700;
opacity: 1;
}
.ti-tg-choice.ti-tg-wrong {
background: #faebe9;
border-color: var(--tg-red);
color: #8c322b;
opacity: 1;
}
.ti-tg-choice .ti-tg-choice-pron { display: block; font-size: 13px; color: var(--tg-muted); margin-top: 2px; } .ti-tg-q-sentence { font-size: 27px; line-height: 1.4; }
.ti-tg-q-sentence-sv { font-size: 20px; line-height: 1.4; }
.ti-tg-choices-sent { grid-template-columns: 1fr; }
.ti-tg-choice-sent { text-align: left; line-height: 1.4; font-size: 15px; }
.ti-tg-choice-sent .ti-tg-thai { font-size: 19px; }
@media (max-width: 600px) {
.ti-tg-q-sentence { font-size: 23px; }
}
.ti-tg-feedback {
min-height: 26px;
margin-top: 12px;
font-size: 15px;
font-weight: 600;
text-align: center;
}
.ti-tg-feedback.ti-tg-ok { color: var(--tg-green); }
.ti-tg-feedback.ti-tg-fel { color: var(--tg-red); }
.ti-tg-score {
display: flex;
gap: 16px;
justify-content: center;
margin-top: 14px;
font-size: 14px;
color: var(--tg-muted);
font-variant-numeric: tabular-nums;
}
.ti-tg-score strong { color: var(--tg-ink); }
.ti-tg-streak { color: var(--tg-gold); font-weight: 700; }
.ti-tg-footer-note {
margin-top: 12px;
font-size: 12px;
color: var(--tg-muted);
text-align: center;
}