/* Chat app ------------------------------------------------------------------ */
.chat-body { overflow: hidden; }
.chat-body main { height: calc(100dvh - var(--header-h)); }
.chat-app { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 20px; max-width: 1400px; margin: 0 auto; }
.chat-main { position: relative; display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius-xl); background: linear-gradient(180deg, rgba(23, 22, 38, 0.9), rgba(13, 13, 22, 0.95)); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -60px rgba(139, 92, 246, 0.5); overflow: hidden; }

.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 70px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-family: var(--display); background: var(--surface-3); color: var(--muted); flex: none; transition: background 0.3s; }
.chat-app.is-chatting .who-avatar { background: linear-gradient(135deg, #34f5a5, #3b82f6); color: #fff; }
.who strong { display: block; font-size: 16px; }
.who small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-app.is-chatting .who small { color: var(--mint); }
.chat-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.common { flex-wrap: nowrap; overflow: hidden; }
.online-pill.sm { height: 28px; font-size: 12px; }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 24px clamp(14px, 3vw, 28px); display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; overscroll-behavior: contain; }
.chat-log::-webkit-scrollbar { width: 10px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

.msg { max-width: min(78%, 620px); padding: 10px 15px; border-radius: 20px; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: pop 0.35s cubic-bezier(.34, 1.56, .64, 1) both; position: relative; }
.msg.them { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.them + .msg.them { border-top-left-radius: 8px; }
.msg.me + .msg.me { border-top-right-radius: 8px; }
.msg.me.pending { opacity: 0.6; }
.msg.me.failed { background: rgba(255, 92, 122, 0.18); color: #ffc2ce; border: 1px solid rgba(255, 92, 122, 0.35); }
.msg-error { align-self: flex-end; font-size: 12px; color: #ff9db0; margin: -2px 6px 4px; }
.sys { align-self: center; text-align: center; color: var(--muted); font-size: 13.5px; padding: 10px 14px; margin: 8px 0; max-width: 520px; }
.sys b { color: var(--text-2); }
.sys.start { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sys.start .chips { justify-content: center; }
.sys.end { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); width: 100%; max-width: none; padding: 18px; margin: 16px 0; }
.sys .actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.typing-row { align-self: flex-start; }

/* Welcome */
.welcome { margin: auto; width: min(100%, 560px); text-align: center; padding: 20px 0; }
.welcome h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.04em; margin-top: 28px; }
.welcome > p { color: var(--text-2); margin: 12px auto 28px; max-width: 440px; }
.welcome-art { position: relative; width: 170px; height: 120px; margin: 0 auto; display: grid; place-items: center; }
.welcome-art img { width: 84px; height: 84px; border-radius: 26px; box-shadow: 0 20px 60px -10px rgba(236, 72, 153, 0.7); animation: bob 5s ease-in-out infinite; }
.orbit { position: absolute; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 18px; animation: bob 6s ease-in-out infinite; }
.o1 { left: 0; top: 10px; } .o2 { right: 0; top: 0; animation-delay: -1.5s; } .o3 { left: 18px; bottom: -6px; animation-delay: -3s; } .o4 { right: 14px; bottom: -2px; animation-delay: -4.5s; }
.interest-picker { text-align: left; display: grid; gap: 10px; }
.suggestions { margin-top: 2px; }
.suggestions .chip { height: 28px; font-size: 12.5px; }
.start-btn { margin-top: 28px; width: 100%; }
.welcome-foot { margin-top: 16px; font-size: 13px; color: var(--muted); }
.welcome-foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }

/* Searching overlay */
.searching { position: absolute; inset: 70px 0 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(12, 12, 20, 0.6); backdrop-filter: blur(6px); z-index: 2; text-align: center; padding: 20px; }
.searching strong { font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; margin-top: 18px; }
.searching small { color: var(--muted); }
.radar { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.radar img { position: relative; z-index: 1; border-radius: 18px; }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(236, 72, 153, 0.5); animation: radar 2.4s ease-out infinite; }
.radar span:nth-child(2) { animation-delay: 0.8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar { from { transform: scale(0.35); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* Composer */
.composer { position: relative; display: flex; align-items: flex-end; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: rgba(10, 10, 18, 0.6); }
.skip-btn { --h: 52px; flex: none; border-radius: 16px; padding: 0 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); color: var(--text); min-width: 112px; }
.skip-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.skip-btn.confirm { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.5); color: #ffe08a; }
.skip-btn.new { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.12); color: inherit; opacity: 0.8; }
.composer-form { flex: 1; display: flex; align-items: flex-end; gap: 4px; min-width: 0; padding: 5px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); transition: border-color 0.15s, box-shadow 0.15s; }
.composer-form:focus-within { border-color: rgba(236, 72, 153, 0.6); box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12); }
.composer-input { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.45; padding: 10px 0; max-height: 140px; color: var(--text); }
.composer-input::placeholder { color: #6c6b85; }
.composer-input:disabled { cursor: not-allowed; }
.send-btn { flex: none; width: 42px; height: 42px; border-radius: 13px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform 0.15s, opacity 0.15s; }
.send-btn svg { width: 19px; height: 19px; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.send-btn:not(:disabled):hover { transform: scale(1.05); }

/* Side */
.chat-side { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.side-card { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.side-card.subtle { background: transparent; }
.side-card h3 { font-size: 17px; margin-bottom: 14px; letter-spacing: -0.01em; }
.side-card p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tips li { display: flex; gap: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.tips li b { color: var(--text-2); }
.tips svg { width: 18px; height: 18px; flex: none; color: #ff9ccc; margin-top: 1px; }
.icebreaker { font-family: var(--display); font-size: 19px !important; color: var(--text) !important; line-height: 1.3; letter-spacing: -0.01em; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(4, 4, 8, 0.72); backdrop-filter: blur(10px); animation: fade 0.2s both; }
.modal-card { width: min(100%, 500px); padding: 34px; border-radius: var(--radius-xl); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop 0.35s cubic-bezier(.34, 1.56, .64, 1) both; }
.modal-card h2 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 8px; }
.modal-card form { display: grid; gap: 16px; margin-top: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.report-reasons { display: grid; gap: 8px; margin-top: 20px; }
.report-reasons button { text-align: left; padding: 13px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); cursor: pointer; font-size: 15px; transition: 0.15s; }
.report-reasons button:hover { background: rgba(255, 92, 122, 0.1); border-color: rgba(255, 92, 122, 0.4); }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 1000px) {
  .chat-app { grid-template-columns: 1fr; padding: 0; }
  .chat-side { display: none; }
  .chat-main { border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 600px) {
  .common { display: none; }
  .skip-btn { min-width: 0; padding: 0 12px; }
  .skip-btn kbd { display: none; }
  .composer { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .msg { max-width: 86%; }
  .welcome h1 { margin-top: 18px; }
}
@media (max-width: 600px), (max-height: 760px) {
  .welcome-art { display: none; }
  .welcome h1 { margin-top: 0; }
  .welcome > p { margin-bottom: 18px; }
  .start-btn { margin-top: 18px; }
}

/* ===================================================================== */
/* Composer tools: emoji + games                                         */
/* ===================================================================== */
.tool-btn { position: relative; flex: none; width: 42px; height: 42px; border-radius: 13px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.15s; }
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tool-btn.is-on { background: var(--grad-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.5); }
.composer-input { padding-left: 4px; }

/* Games button + chat-bubble badge */
.games-btn.nudge { color: #fff; }
.games-btn.nudge svg { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 88% { transform: rotate(10deg); } 92% { transform: rotate(-6deg); } 96% { transform: rotate(4deg); } }
.games-badge { position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px 10px 10px 3px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; white-space: nowrap; box-shadow: 0 4px 14px -2px rgba(236, 72, 153, 0.8); animation: pop 0.35s cubic-bezier(.34, 1.56, .64, 1) both; pointer-events: none; }
.games-badge.wide { right: -18px; top: -14px; font-size: 10.5px; letter-spacing: 0.01em; }

/* Popovers */
.popover { position: absolute; z-index: 30; border-radius: 18px; background: rgba(24, 23, 38, 0.98); border: 1px solid var(--line-2); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75); backdrop-filter: blur(16px); animation: popIn 0.18s ease-out both; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.emoji-pop { left: 14px; bottom: calc(100% + 8px); width: min(370px, calc(100% - 28px)); height: 400px; display: flex; flex-direction: column; overflow: hidden; }
.emoji-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; padding: 0 12px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.emoji-search:focus-within { border-color: rgba(236, 72, 153, 0.6); }
.emoji-search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.emoji-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; height: 100%; }
.emoji-tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.emoji-tabs button { flex: 1; min-width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-size: 18px; filter: grayscale(0.6); opacity: 0.75; transition: 0.15s; }
.emoji-tabs button:hover { background: rgba(255, 255, 255, 0.07); filter: none; opacity: 1; }
.emoji-grid { flex: 1; overflow-y: auto; padding: 4px 8px 8px; overscroll-behavior: contain; }
.emoji-section h4 { position: sticky; top: 0; z-index: 1; font-family: var(--font); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 4px 6px; background: rgba(24, 23, 38, 0.98); }
.emoji-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); content-visibility: auto; contain-intrinsic-size: auto 300px; }
.emoji { height: 38px; border: 0; border-radius: 10px; background: none; font-size: 24px; line-height: 1; cursor: pointer; transition: transform 0.1s, background 0.1s; }
.emoji:hover, .emoji:focus-visible { background: rgba(255, 255, 255, 0.09); transform: scale(1.15); }
.emoji-empty { text-align: center; padding: 40px 0; }
.emoji-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 34px; }

.games-menu { right: 66px; bottom: calc(100% + 8px); width: 270px; padding: 6px; display: grid; gap: 2px; }
.games-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: var(--text); transition: background 0.15s; }
.games-menu button:hover { background: rgba(255, 255, 255, 0.07); }
.games-menu .gi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--grad-soft); border: 1px solid rgba(236, 72, 153, 0.25); flex: none; }
.games-menu strong { display: block; font-size: 14.5px; }
.games-menu small { display: block; font-size: 12.5px; color: var(--muted); }

/* ===================================================================== */
/* Games dock                                                            */
/* ===================================================================== */
.dock { position: absolute; top: 70px; right: 0; bottom: 80px; z-index: 3; width: 380px; display: flex; flex-direction: column; background: linear-gradient(180deg, #1a182a, #100f1b); border-left: 1px solid var(--line-2); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.8); animation: dockIn 0.28s cubic-bezier(.2, .8, .2, 1) both; transition: width 0.25s cubic-bezier(.2, .8, .2, 1); }
.dock[data-tab="board"] { width: min(720px, 100%); }
@keyframes dockIn { from { opacity: 0; transform: translateX(24px); } }
.dock-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); }
.dock-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.dock-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.dock-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.dock-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.05); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.dock-close svg { width: 18px; height: 18px; }
.dock-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.dock-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }

/* Tic-tac-toe */
.ttt { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ttt-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; width: 100%; }
.ttt-score > div { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); text-align: center; }
.ttt-score span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ttt-score strong { font-family: var(--display); font-size: 28px; line-height: 1.1; }
.ttt-score .draws { padding-inline: 14px; }
.ttt-score .draws strong { font-size: 20px; color: var(--muted); }
.ttt-status { font-weight: 600; text-align: center; min-height: 24px; }
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 300px); aspect-ratio: 1; padding: 8px; border-radius: 22px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); transition: box-shadow 0.3s, border-color 0.3s; }
.ttt-grid.my-turn { border-color: rgba(236, 72, 153, 0.5); box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12), 0 20px 50px -20px rgba(236, 72, 153, 0.6); }
.ttt-cell { border: 0; border-radius: 14px; background: var(--surface-3); font-family: var(--display); font-size: clamp(34px, 6vw, 52px); font-weight: 800; line-height: 1; color: var(--text); cursor: pointer; transition: background 0.15s, transform 0.15s; }
.ttt-cell:disabled { cursor: default; }
.ttt-cell:not(:disabled):hover { background: rgba(236, 72, 153, 0.18); transform: scale(1.03); }
.ttt-cell.mine { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; animation: pop 0.3s cubic-bezier(.34, 1.56, .64, 1) both; }
.ttt-cell.theirs { background: rgba(251, 146, 60, 0.16); color: #fdba74; animation: pop 0.3s cubic-bezier(.34, 1.56, .64, 1) both; }
.ttt-cell.win { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(236, 72, 153, 0.9); }
.ttt-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 36px; }
.ttt-record { font-size: 12.5px; color: var(--muted); text-align: center; }

/* Drawing board */
.board-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px; }
.board-empty-art { font-size: 54px; animation: bob 5s ease-in-out infinite; }
.board-empty strong { font-family: var(--display); font-size: 22px; }
.board-empty [data-board-empty-actions] { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.board-empty [data-board-empty-actions] .btn + .btn { margin-top: -2px; }
.board { display: flex; flex-direction: column; gap: 12px; }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.tool-group { position: relative; display: flex; align-items: center; gap: 2px; }
.tool-group + .tool-group { padding-left: 8px; border-left: 1px solid var(--line); }
.tool-group.end { margin-left: auto; }
.tool-group .tool-btn { width: 36px; height: 36px; border-radius: 10px; }
.tool-group .tool-btn svg { width: 19px; height: 19px; }
.swatch-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); padding: 4px; cursor: pointer; }
.swatch-btn i { display: block; width: 100%; height: 100%; border-radius: 7px; border: 2px solid rgba(0, 0, 0, 0.35); }
.tips button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--text-2); cursor: pointer; font-size: 15px; }
.tips button:hover { background: rgba(255, 255, 255, 0.07); }
.tips button.is-on { background: var(--grad-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.5); }
.size input { width: 86px; accent-color: var(--pink); }
.size-dot { display: inline-block; width: 8px; height: 8px; margin: 0 8px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); flex: none; }
.stamp-btn span { font-size: 19px; line-height: 1; }
.color-pop { top: calc(100% + 8px); left: 0; width: 220px; padding: 16px; display: grid; gap: 10px; }
.wheel { width: 180px; height: 180px; border-radius: 50%; cursor: crosshair; justify-self: center; touch-action: none; }
.color-pop input[type="range"] { accent-color: var(--pink); width: 100%; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.swatch { aspect-ratio: 1; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.15); cursor: pointer; padding: 0; }
.swatch.is-on { outline: 2px solid #fff; outline-offset: 1px; }
.input-xs { height: 36px; font-size: 14px; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.stamp-pop { top: calc(100% + 8px); right: 0; width: 248px; padding: 10px; }
.stamp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.stamp { height: 38px; border: 0; border-radius: 10px; background: none; font-size: 22px; cursor: pointer; }
.stamp:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.12); }
.canvas-wrap { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 20px 50px -25px rgba(0, 0, 0, 0.8); }
.board-canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.board-canvas[data-tool="stamp"] { cursor: copy; }
.board-canvas[data-tool="eraser"] { cursor: cell; }
.board-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 7px 12px; border-radius: 999px; background: rgba(17, 17, 28, 0.82); color: #fff; font-size: 13px; pointer-events: none; white-space: nowrap; animation: pop 0.3s both; }

/* Game cards in the chat log */
.game-card { align-self: center; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; max-width: 460px; animation: pop 0.35s cubic-bezier(.34, 1.56, .64, 1) both; }
.game-card-row { display: flex; align-items: center; gap: 10px; text-align: left; }
.game-card-icon { font-size: 20px; flex: none; }
.game-card .actions { margin-top: 10px; }

@media (max-width: 700px) {
  .dock, .dock[data-tab="board"] { width: 100%; border-left: 0; top: 70px; bottom: 70px; }
  .games-menu { right: 10px; }
  .emoji-pop { left: 10px; width: calc(100% - 20px); height: 360px; }
  .tool-group.end { margin-left: 0; }
}

/* Keep the conversation readable beside the tic-tac-toe dock on wide screens. */
@media (min-width: 1100px) {
  .chat-main:has(.dock:not([hidden])[data-tab="ttt"]) .chat-log { padding-right: 404px; }
}
.games-badge { min-width: 22px; height: 22px; line-height: 22px; font-size: 12px; }
@media (max-width: 700px) {
  .ttt { gap: 10px; }
  .ttt-grid { width: min(100%, 300px, 40dvh); }
  .ttt-score strong { font-size: 22px; }
  .dock-panel { padding: 12px; }
  .board-tools { gap: 2px 4px; padding: 4px; }
  .tool-group + .tool-group { padding-left: 0; border-left: 0; }
  .size input { width: 72px; }
  .size-dot { margin: 0 4px; }
  .tips button, .tool-group .tool-btn, .swatch-btn { width: 32px; height: 32px; }
}
@media (max-width: 600px) {
  .chat-top [data-chat-online] { display: none !important; }
}
