/* FIVE PK - HIDDEN table chat (preview only) */
.tchat { position: fixed; right: 14px; top: 96px; z-index: 60; font-size: 13px; }
.tchat [hidden], .tchat[hidden] { display: none !important; }
.tchat-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(10,20,30,.85); color: #fff; font-size: 21px; cursor: pointer; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.tchat-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #e5484d; font-size: 11px; line-height: 18px; text-align: center; }
/* Desktop: compact dock on the right edge, outside the seats (right seats end ~ 50vw + 500px) and above the action bar. */
.tchat-panel { position: fixed; right: 8px; top: 148px; bottom: 132px; width: clamp(200px, calc(50vw - 514px), 320px); max-height: 470px; display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: 12px; background: rgba(12,22,32,.94); color: #eef; border: 1px solid rgba(255,255,255,.15); box-shadow: 0 10px 30px rgba(0,0,0,.5); box-sizing: border-box; }
.tchat-head { display: flex; align-items: center; gap: 8px; }
.tchat-head strong { flex: 1; }
.tchat-switch { display: flex; gap: 4px; align-items: center; font-size: 12px; opacity: .85; }
.tchat-close { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }
.tchat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 60px; }
.tchat-line { padding: 2px 0; word-break: break-word; }
.tchat-who { background: none; border: 0; padding: 0 4px 0 0; color: #f5c451; font-weight: 600; cursor: pointer; }
.tchat-k-emote .tchat-text { font-size: 18px; }
.tchat-notice { margin: 0; color: #ffb4b4; font-size: 12px; }
.tchat-readonly { margin: 0; font-size: 12px; opacity: .75; }
.tchat-emotes, .tchat-presets { display: flex; flex-wrap: wrap; gap: 3px; flex: 0 0 auto; }
.tchat-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.tchat-preset { white-space: nowrap; }
.tchat-emote { font-size: 18px; background: rgba(255,255,255,.06); border: 0; border-radius: 8px; padding: 2px 5px; cursor: pointer; }
.tchat-preset { font-size: 12px; background: rgba(245,196,81,.15); color: #f5d27a; border: 1px solid rgba(245,196,81,.35); border-radius: 14px; padding: 3px 8px; cursor: pointer; }
.tchat-form { display: flex; gap: 6px; }
.tchat-form input { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; }
.tchat-form button { border-radius: 8px; border: 0; background: #1fb8c9; color: #fff; padding: 0 10px; cursor: pointer; }
.tchat-muted { font-size: 12px; } .tchat-muted ul { margin: 4px 0 0; padding-left: 16px; } .tchat-muted button { font-size: 11px; }
.tchat-bubble { position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%); z-index: 30; max-width: 170px; padding: 4px 9px; border-radius: 12px; background: #fff; color: #111; font-size: 12px; line-height: 1.25; box-shadow: 0 3px 10px rgba(0,0,0,.35); pointer-events: none; animation: tchat-pop 4.5s ease forwards; white-space: normal; text-align: center; }
.tchat-bubble.is-emote { background: none; box-shadow: none; font-size: 40px; padding: 0; animation: tchat-emote 2.6s ease forwards; }
@keyframes tchat-pop { 0% { opacity: 0; transform: translate(-50%, -80%) scale(.7); } 8% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tchat-emote { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.3); } 15% { opacity: 1; transform: translate(-50%, -100%) scale(1.25); } 30% { transform: translate(-50%, -95%) scale(1) rotate(-8deg); } 45% { transform: translate(-50%, -100%) rotate(8deg); } 60% { transform: translate(-50%, -100%) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -160%); } }
@media (prefers-reduced-motion: reduce) { .tchat-bubble, .tchat-bubble.is-emote { animation: none; } }

/* Tablet / mobile: bottom sheet (closed automatically when it is the player's turn). */
@media (max-width: 1199px) {
  .tchat { top: auto; right: 12px; bottom: 150px; }
  .tchat-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 52vh; border-radius: 16px 16px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); z-index: 70; }
  .tchat-panel::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); margin-bottom: 4px; }
  .tchat-list { min-height: 70px; max-height: 22vh; }
}
