/* Texting Game Picker (assets/tools/games-to-play-over-text.js). Tokens only, so dark mode works. */
.tool .tg-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool .tg-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: rgb(var(--ink) / .07); }
.tool .tg-seg button {
  min-height: 44px; border-radius: 12px; font-size: 15px; font-weight: 800; color: rgb(var(--ink) / .6);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out); -webkit-tap-highlight-color: transparent;
}
.tool .tg-seg button[aria-checked="true"] { background: var(--surface); color: rgb(var(--ink)); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
.tool .tg-seg button:active, .tool .tg-game:active, .tool .tg-icon:active, .tool .tg-fav:active { transform: scale(.96); }

.tool .tg-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Mood chips: one compact row that scrolls sideways on small phones instead of wrapping into three lines */
.tool .tg-moods { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -24px; padding: 0 24px 2px; scroll-padding: 0 24px; overscroll-behavior-x: contain; }
.tool .tg-moods::-webkit-scrollbar { display: none; }
.tool .tg-moods button, .tool .tg-cats button { flex: none; min-height: 36px; padding: 0 14px; font-size: 13px; }

/* Game picker: wrapping pills, selected one inverted */
.tool .tg-games { display: flex; flex-wrap: wrap; gap: 6px; }

.tool .tg-game {
  position: relative; min-height: 38px; padding: 0 13px; border-radius: 19px; font-size: 14px; font-weight: 800;
  background: var(--surface); color: rgb(var(--ink)); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08);
  transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out); -webkit-tap-highlight-color: transparent;
}
.tool .tg-game[aria-checked="true"] { background: rgb(var(--accent)); color: #fff; box-shadow: none; }
.tool .tg-dot { display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: #C0237A; margin-right: 6px; vertical-align: 2px; }
.tool .tg-game[aria-checked="true"] .tg-dot { background: currentColor; }
@media (hover: hover) and (pointer: fine) { .tool .tg-game:not([aria-checked="true"]):hover { box-shadow: inset 0 0 0 1px rgb(var(--accent) / .5); } }

/* The chat card */
.tool .tg-chat { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.tool .tg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool .tg-name { font-size: 20px; line-height: 26px; font-weight: 900; letter-spacing: -.01em; color: rgb(var(--ink)); }
.tool .tg-rule { font-size: 14px; line-height: 20px; font-weight: 650; color: rgb(var(--ink) / .65); margin-top: 2px; }
.tool .tg-label { font-size: 12px; line-height: 16px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--ink) / .66); margin-top: 4px; }
.tool .tg-of { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 750; color: rgb(var(--ink) / .7); }
.tool .tg-thread { display: flex; justify-content: flex-end; }
.tool .tg-bubble {
  display: block; max-width: 88%; padding: 10px 14px; border-radius: 20px; font-size: 16px; line-height: 22px; font-weight: 600;
  text-align: left; overflow-wrap: anywhere; text-wrap: pretty;
}
.tool .tg-bubble.is-me { background: rgb(var(--accent)); color: #fff; border-bottom-right-radius: 6px; }
.tool .tg-bubble.is-round { background: rgb(var(--accent) / .14); color: rgb(var(--ink)); border-bottom-right-radius: 6px; max-width: none; flex: 1; font-weight: 700; box-shadow: inset 0 0 0 1px rgb(var(--accent) / .3); }
.tool .tg-bubble.is-new { animation: tg-in .32s var(--ease-out) both; }
@keyframes tg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.tool .tg-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool .tg-acts .btn { min-height: 46px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; flex: 1 1 0; justify-content: center; font-size: 15px; white-space: nowrap; }
.tool .tg-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool .tg-label-row .tg-label { margin-top: 0; }
.tool .tg-icon { position: relative; }
.tool .tg-tip { position: absolute; bottom: calc(100% + 6px); right: 0; padding: 4px 8px; border-radius: 8px; background: rgb(var(--ink)); color: var(--bg); font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s ease; }
.tool .is-done > .tg-tip { opacity: 1; }
.tool .tg-tip:empty { display: none; }
.tool .tg-acts .tool-icon { width: 18px; height: 18px; }
.tool .tg-icon {
  flex: none; width: 46px; height: 46px; border-radius: 23px; display: grid; place-items: center; color: rgb(var(--ink));
  background: var(--surface-2); transition: transform .16s var(--ease-out), background-color .2s ease; -webkit-tap-highlight-color: transparent;
}
.tool .tg-icon .tool-icon { width: 20px; height: 20px; }
.tool .tg-icon.is-done { color: #2E9E6A; }
.tool .btn.is-done { filter: saturate(1.2); }
.tool .tg-round { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; margin-top: 4px; border-top: 1px solid rgb(var(--ink) / .08); }
.tool .tg-round-row { display: flex; gap: 8px; align-items: center; }
.tool .tg-round .tg-next { flex: 0 1 auto; }
.tool .tg-live { font-size: 14px; line-height: 20px; font-weight: 650; color: rgb(var(--ink) / .7); padding: 10px 12px; border-radius: 14px; background: rgb(var(--accent) / .08); }
.tool .tg-fav { flex: none; width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: rgb(var(--ink) / .45); background: var(--surface-2); transition: transform .16s var(--ease-out), color .2s ease; }
.tool .tg-fav[aria-pressed="true"] { color: #C0237A; }
.tool .tg-fav[aria-pressed="true"] path { fill: currentColor; }
.tool .tg-fav.is-new { animation: tg-pop .36s var(--ease-out); }
@keyframes tg-pop { 40% { transform: scale(1.18); } }

/* Texts mode: tappable bubbles */
.tool .tg-hint { font-size: 13px !important; line-height: 18px !important; color: rgb(var(--ink) / .55) !important; }
.tool .tg-texts { display: grid; gap: 8px; }
.tool .tg-item { display: flex; gap: 8px; align-items: center; }
.tool .tg-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 0; background: none; text-align: left;
  -webkit-tap-highlight-color: transparent; transition: transform .16s var(--ease-out);
}
.tool .tg-text .tg-bubble { max-width: 100%; }
.tool .tg-text:active { transform: scale(.98); }
.tool .tg-tap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: rgb(var(--ink) / .62); padding-right: 6px; }
.tool .tg-tap:not(.is-done) .tg-lab { display: none; }
.tool .tg-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool .tg-shuffle { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; font-size: 13px; font-weight: 800; color: rgb(var(--ink)); background: var(--surface); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); }
.tool .tg-shuffle .tool-icon { width: 16px; height: 16px; }
.tool .tg-tap .tool-icon { width: 13px; height: 13px; }
.tool .tg-tap.is-done { color: #2E9E6A; }
.tool .tg-side { display: flex; flex-direction: column; gap: 6px; }
.tool .tg-fav.is-small, .tool .tg-icon.is-small { width: 36px; height: 36px; }
.tool .tg-icon.is-small .tool-icon, .tool .tg-fav.is-small .tool-icon { width: 17px; height: 17px; }
.tool .tg-streak { font-size: 13px; font-weight: 800; color: rgb(var(--accent)); text-align: center; }
.tool .tg-streak[hidden] { display: none; }
.tool .tg-seg button:focus-visible, .tool .tg-game:focus-visible, .tool .tg-icon:focus-visible, .tool .tg-fav:focus-visible, .tool .tg-text:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
@media (min-width: 720px) {
  .tool .tg-top { grid-template-columns: 1.3fr 1fr; align-items: center; }
  .tool .tg-moods { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .tool .tg-acts .btn { flex: 0 0 auto; }
  .tool .tg-texts { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tool .tg-bubble.is-new, .tool .tg-fav.is-new { animation: none; } }
/* Dark mode: the accent turns light, so deepen the sent bubble and the picked game to keep white text readable. */
@media (prefers-color-scheme: dark) {
  .tool .tg-bubble.is-me, .tool .tg-game[aria-checked="true"] { background: color-mix(in srgb, rgb(var(--accent)) 62%, #1a0b2e); }
}

.tool .tg-chat { scroll-margin-top: 88px; }
.tool .tg-games-label { margin-top: 6px; }
.tool .tg-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px !important; color: rgb(var(--ink) / .7) !important; }
.tool .tg-quick button { min-height: 36px; padding: 0 12px; border-radius: 18px; font-size: 13px; font-weight: 800; color: var(--link); background: var(--surface); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); }
.tool .tg-quick button:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .tool .tg-seg button[aria-checked="true"] { background: rgb(var(--ink) / .16); color: rgb(var(--ink)); } }

.tool .tg-moods { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
@media (min-width: 720px) { .tool .tg-moods { -webkit-mask-image: none; mask-image: none; } }
.tool .tg-quick { margin-top: -4px; }
.tool .tg-quick[hidden] { display: none; }
.tool .tg-quick span { font-weight: 700; }
.tool .tg-all { align-self: center; min-height: 44px; }
@media (prefers-color-scheme: dark) { .tool .tg-chat .btn-secondary, .tool .tg-all { box-shadow: inset 0 0 0 1px rgb(var(--ink) / .2); } }
.tool .tg-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: -4px -24px 0; padding: 0 24px; white-space: nowrap; }
.tool .tg-quick::-webkit-scrollbar { display: none; }
.tool .tg-quick button { flex: none; min-height: 34px; padding: 0 11px; }
.tool .tg-quick span { flex: none; font-size: 13px; }
@media (min-width: 720px) { .tool .tg-quick { flex-wrap: wrap; overflow: visible; margin: -4px 0 0; padding: 0; } }
.tool .tg-quick { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
@media (min-width: 720px) { .tool .tg-quick { -webkit-mask-image: none; mask-image: none; } }
.tool .tg-round .tg-acts .tg-rcopy { flex: 0 1 auto; }
.tool .tg-round .tg-acts .tg-next { flex: 1 1 auto; }
.tool .tg-acts { flex-wrap: nowrap; }
.tool .tg-acts .btn { width: auto; min-width: 0; }
