*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #070c14;
  --bg2: #0e1420;
  --bg3: #18202e;
  --border: #1e2a3d;
  --accent: #3b7dd8;
  --accent-hover: #2d69c0;
  --text: #d8e4f0;
  --text-muted: #6b82a0;
  --danger: #e05252;
  --success: #28a87a;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 300px;
}

/* ── LIGHT THEME ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f0f4f9;
  --bg2: #ffffff;
  --bg3: #e5eaf2;
  --border: #c8d3e6;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --text: #1a2035;
  --text-muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
}
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .auth-brand { background: linear-gradient(160deg, #e0e9f7 0%, #cfe0f6 40%, #d0e4f8 100%); }
[data-theme="light"] .msg-bubble.mine { background: #2563eb; }
[data-theme="light"] .msg-bubble.theirs { background: #e5eaf2; color: #1a2035; }
[data-theme="light"] .sidebar { border-right-color: var(--border); }

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
body { background: var(--bg); color: var(--text); overflow: hidden; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: .8rem; }
.view { display: flex; height: 100vh; height: 100dvh; }

/* ── AUTH ─────────────────────────────────────────────────────────── */
#view-auth { flex-direction: row; overflow: hidden; }

.auth-brand {
  flex: 1; background: linear-gradient(160deg, #0a1525 0%, #0d1d35 40%, #071020 100%);
  border-right: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; padding: 3rem; position: relative; overflow: hidden;
}
.auth-brand::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(59,125,216,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,125,216,.06) 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-brand::after {
  content: ''; position: absolute; top: 30%; left: 50%; transform: translate(-50%,-50%);
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(59,125,216,.12) 0%, transparent 70%);
  pointer-events: none;
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 380px; }
.brand-logo { width: 52px; height: 52px; color: var(--accent); margin-bottom: 1.25rem; }
.brand-logo svg { width: 100%; height: 100%; }
.brand-wordmark { font-size: 2.2rem; font-weight: 800; letter-spacing: .15em; color: #fff; margin-bottom: .5rem; }
.brand-tagline { font-size: .95rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.brand-features { list-style: none; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; }
.brand-features li { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: #a8bdd4; }
.brand-features li svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.brand-footer { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.brand-footer p { font-size: .75rem; color: var(--text-muted); }

.auth-panel {
  width: 460px; min-width: 0; display: flex; align-items: center;
  justify-content: center; overflow-y: auto; background: var(--bg2);
}
.auth-container { width: 100%; max-width: 380px; padding: 2.5rem 2rem; }
.auth-logo-mobile { display: none; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.auth-logo-mobile svg { width: 32px; height: 32px; color: var(--accent); }
.auth-logo-mobile span { font-size: 1.4rem; font-weight: 800; letter-spacing: .1em; color: #fff; }
.auth-heading { margin-bottom: 1.75rem; }
.auth-heading h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.auth-heading p { font-size: .875rem; color: var(--text-muted); }
.auth-tabs { display: flex; gap: .4rem; margin-bottom: 1.5rem; background: var(--bg3); border-radius: var(--radius-sm); padding: .25rem; }
.tab-btn { flex: 1; padding: .5rem; border: none; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: .875rem; transition: all .2s; }
.tab-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-legal { margin-top: 1.25rem; font-size: .75rem; color: var(--text-muted); text-align: center; line-height: 1.6; }
.auth-legal a { color: var(--accent); text-decoration: none; }

/* ── FORM ELEMENTS ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.field small { font-size: .73rem; color: var(--text-muted); }
.field input, .member-select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .95rem;
  color: var(--text); font-size: .95rem; transition: border-color .2s; -webkit-appearance: none;
}
.field input:focus, .member-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,125,216,.15); }
.auth-error { color: var(--danger); font-size: .82rem; min-height: 1.1em; text-align: center; }
.auth-success { color: var(--ok, #10b981); font-size: .82rem; min-height: 1.1em; text-align: center; }

/* ── LLAMADA ──────────────────────────────────────────────────────── */
.call-overlay {
  position: fixed; inset: 0; z-index: 2000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(7,12,20,.96); backdrop-filter: blur(6px);
}
.call-box { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 2rem; text-align: center; }
.call-box .avatar.lg { width: 88px; height: 88px; font-size: 1.9rem; }
.call-name { font-size: 1.25rem; font-weight: 600; }
.call-status { font-size: .875rem; color: var(--text-muted); min-height: 1.2em; }
.call-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.call-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--text); transition: opacity .2s, background .2s;
}
.call-btn svg { width: 24px; height: 24px; }
.call-btn:hover { opacity: .85; }
.call-btn.accept { background: var(--success); color: #fff; }
.call-btn.hangup { background: var(--danger); color: #fff; }
.call-btn.muted { background: var(--accent); color: #fff; }
/* Latido suave mientras suena, en vez de una animación llamativa. */
.call-overlay.ringing .avatar.lg { animation: callPulse 1.6s ease-in-out infinite; }
@keyframes callPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ── VER JUNTOS ───────────────────────────────────────────────────── */
.watch-panel { border-bottom: 1px solid var(--border); background: #000; flex-shrink: 0; }
.watch-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 42vh; background: #000; }
.watch-media { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
video.watch-media { object-fit: contain; }
#watch-yt iframe, #watch-yt > div { width: 100%; height: 100%; border: 0; }
/* Los navegadores bloquean el arranque automático sin un toque previo:
   este botón deja que quien recibe la orden se enganche con un solo toque. */
.watch-tap {
  position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); border: none; cursor: pointer;
  color: #fff; font-size: 1rem; font-weight: 600; gap: .5rem;
}
.watch-tap:hover { background: rgba(0,0,0,.4); }
.watch-manual {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .5rem; text-align: center; padding: 1rem; color: var(--text);
}
.watch-manual p { font-weight: 600; }
.watch-manual small { color: var(--text-muted); font-size: .75rem; max-width: 34ch; }
.watch-countdown { font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.watch-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .85rem; background: var(--bg2); border-top: 1px solid var(--border);
}
.watch-label { font-size: .8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-viewers { display: flex; align-items: center; gap: -4px; flex-shrink: 0; }
.watch-viewer-avatar {
  width: 26px; height: 26px; border-radius: 50%; font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; color: #fff;
  border: 2px solid var(--bg2); margin-left: -6px; flex-shrink: 0;
  text-transform: uppercase; cursor: default;
}
.watch-viewers .watch-viewer-avatar:first-child { margin-left: 0; }
.watch-viewer-count {
  font-size: .75rem; color: var(--text-muted); margin-left: 4px; white-space: nowrap;
}
.watch-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.watch-tabs { display: flex; gap: .3rem; background: var(--bg3); border-radius: var(--radius-sm); padding: .25rem; }
.watch-tab { flex: 1; padding: .45rem .3rem; border: none; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: .8rem; }
.watch-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.watch-pane { display: flex; flex-direction: column; gap: .5rem; }
.watch-hint { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }
.watch-library { margin-top: .65rem; }
.watch-lib-label { font-size: .72rem; color: var(--text-muted); margin-bottom: .35rem; }
#watch-lib-list { max-height: 140px; overflow-y: auto; }
.watch-lib-item {
  display: block; width: 100%; text-align: left; padding: .38rem .65rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: .8rem; cursor: pointer; margin-bottom: .3rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color .15s;
}
.watch-lib-item:hover { border-color: var(--accent); }
.watch-resume-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: rgba(59,125,216,.12); border: 1px solid rgba(59,125,216,.3);
  border-radius: var(--radius-sm); padding: .55rem .85rem; font-size: .83rem;
  color: var(--text-muted); margin-bottom: .25rem;
}
.watch-resume-bar strong { color: var(--text); font-weight: 600; }

@media (max-width: 768px) { .watch-stage { max-height: 34vh; } }
.auth-link-btn {
  background: none; border: none; color: var(--text-muted); font-size: .82rem;
  cursor: pointer; text-align: center; width: 100%; margin-top: .25rem; padding: .35rem;
  text-decoration: underline;
}
.auth-link-btn:hover { color: var(--accent); }
.code-forgot {
  background: none; border: none; color: rgba(255,255,255,.35); font-size: .68rem;
  cursor: pointer; padding: 0; margin-left: .35rem; text-decoration: underline; white-space: nowrap;
}
.code-forgot:hover { color: rgba(255,255,255,.7); }

.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: .78rem; font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: background .2s; width: 100%; min-height: 44px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: var(--radius-sm); padding: .65rem 1.1rem; font-size: .875rem; font-weight: 600; cursor: pointer; transition: opacity .2s; min-height: 40px; }
.btn-danger:hover { opacity: .85; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .85rem; font-size: .8rem; cursor: pointer; min-height: 36px; }

/* ── APP LAYOUT ───────────────────────────────────────────────────── */
#view-app { flex-direction: row; }

/* ── SIDEBAR ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; background: var(--bg2); z-index: 5;
}
.user-info { display: flex; align-items: center; gap: .6rem; overflow: hidden; min-width: 0; }
.user-info span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { display: flex; gap: .2rem; flex-shrink: 0; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; color: #fff; flex-shrink: 0; }
.avatar.lg { width: 40px; height: 40px; font-size: .95rem; }

.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: .4rem; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: color .2s, background .2s; min-width: 36px; min-height: 36px; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); background: var(--bg3); }
.icon-btn.active { color: var(--accent); }

.sidebar-search { padding: .7rem 1rem; position: relative; flex-shrink: 0; }
.sidebar-search input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: .45rem .95rem; color: var(--text); font-size: .875rem; }
.sidebar-search input:focus { outline: none; border-color: var(--accent); }

.search-dropdown {
  position: absolute; left: 1rem; right: 1rem; top: calc(100% - .5rem);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); z-index: 100; max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.search-item { display: flex; align-items: center; gap: .7rem; padding: .65rem 1rem; cursor: pointer; transition: background .15s; }
.search-item:hover { background: var(--bg2); }
.search-item span { flex: 1; font-size: .875rem; }
.add-btn { font-size: .75rem; background: var(--accent); color: #fff; border: none; border-radius: 5px; padding: .25rem .65rem; cursor: pointer; white-space: nowrap; }
.add-btn:hover { background: var(--accent-hover); }
.sent-tag { font-size: .75rem; color: var(--text-muted); }

.section-header { display: flex; align-items: center; justify-content: space-between; padding: .55rem 1rem; font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; flex-shrink: 0; }
.badge { background: var(--danger); color: #fff; border-radius: 20px; padding: .1rem .45rem; font-size: .68rem; font-weight: 700; }
.add-group-btn { width: 20px; height: 20px; background: var(--bg3); border: none; color: var(--text-muted); border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.add-group-btn:hover { background: var(--accent); color: #fff; }

.request-item { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; border-radius: var(--radius-sm); margin: .1rem .5rem; }
.request-item span { flex: 1; font-size: .875rem; }
.req-actions { display: flex; gap: .3rem; }
.req-btn { border: none; border-radius: 5px; padding: .25rem .6rem; font-size: .75rem; cursor: pointer; font-weight: 600; min-height: 30px; }
.req-btn.accept { background: var(--success); color: #fff; }
.req-btn.reject { background: var(--bg3); color: var(--text-muted); }

.contact-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; margin: .1rem .5rem; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; min-height: 50px; }
.contact-item:hover { background: var(--bg3); }
.contact-item.active { background: var(--bg3); }
.contact-item span { flex: 1; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-wrap { position: relative; flex-shrink: 0; display: inline-flex; }
.online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg2);
}
.chat-subtitle.online { color: #22c55e; font-size: .78rem; font-weight: 500; }
.unread-badge { background: var(--accent); color: #fff; border-radius: 20px; padding: .1rem .45rem; font-size: .68rem; font-weight: 700; flex-shrink: 0; }
.no-items { text-align: center; padding: .75rem 1rem; color: var(--text-muted); font-size: .82rem; }

/* ── CHAT AREA ────────────────────────────────────────────────────── */
.chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--text-muted); }
.chat-empty svg { width: 56px; height: 56px; opacity: .2; }
.chat-empty p { font-size: .9rem; }
#chat-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-header { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; min-height: 60px; }
.chat-header-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; overflow: hidden; }
.chat-header-info span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-actions { display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }

/* Chat menu (three dots) */
.chat-menu-wrapper { position: relative; }
.chat-dropdown { position: absolute; top: calc(100% + .4rem); right: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem 0; min-width: 170px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.chat-dropdown button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: .55rem 1rem; font-size: .875rem; color: var(--text); cursor: pointer; }
.chat-dropdown button:hover { background: var(--bg2); }
.chat-dropdown .dd-danger { color: var(--danger); }

.messages-container { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; }
#messages-list { display: flex; flex-direction: column; gap: .3rem; margin-top: auto; }

.msg-date { text-align: center; font-size: .7rem; color: var(--text-muted); margin: .75rem 0 .4rem; }
.msg { display: flex; align-items: flex-end; gap: .5rem; user-select: none; }
.msg.mine { flex-direction: row-reverse; }
.msg.selectable { user-select: text; }

.msg-bubble { max-width: 68%; padding: .5rem .9rem; border-radius: 18px; font-size: .9rem; line-height: 1.5; word-break: break-word; background: var(--bg3); border-bottom-left-radius: 5px; }
.msg.mine .msg-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; border-bottom-left-radius: 18px; }
.msg-time { font-size: .67rem; color: var(--text-muted); flex-shrink: 0; padding-bottom: 2px; }
.msg-sender { font-size: .71rem; color: var(--text-muted); margin-bottom: .15rem; margin-left: 34px; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: .65rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }

/* Message content types */
.msg-img { max-width: min(260px, 100%); max-height: 300px; border-radius: 10px; cursor: pointer; display: block; object-fit: cover; }
.msg-audio { display: none; }
.msg-video { max-width: min(280px, 100%); max-height: 320px; border-radius: 10px; display: block; background: #000; }
.upload-status {
  padding: .4rem .9rem; font-size: .78rem; color: var(--text-muted);
  background: var(--bg2); border-top: 1px solid var(--border); text-align: center;
}
.msg-sticker { font-size: 3rem; line-height: 1; display: block; user-select: none; }
.msg-deleted { opacity: .45; font-style: italic; font-size: .85em; }

/* ── INPUT WRAPPER ────────────────────────────────────────────────── */
.input-wrapper { position: relative; border-top: 1px solid var(--border); background: var(--bg2); padding-bottom: env(safe-area-inset-bottom, 0); }

/* Shared overlay panel above input */
.overlay-panel {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; z-index: 200; overflow: hidden; margin-bottom: -1px;
}
.emoji-cats { display: flex; padding: .4rem .5rem; gap: .15rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.emoji-cat-btn { background: transparent; border: none; font-size: 1.1rem; padding: .25rem .45rem; border-radius: 6px; cursor: pointer; opacity: .55; transition: opacity .15s; flex-shrink: 0; }
.emoji-cat-btn.active, .emoji-cat-btn:hover { opacity: 1; background: var(--bg2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: .4rem .5rem; gap: .1rem; max-height: 148px; overflow-y: auto; }
.emoji-btn-item { background: transparent; border: none; font-size: 1.25rem; padding: .2rem; border-radius: 6px; cursor: pointer; line-height: 1; }
.emoji-btn-item:hover, .emoji-btn-item:active { background: var(--bg2); }

/* Sticker grid */
.sticker-grid { display: grid; grid-template-columns: repeat(5, 1fr); padding: .5rem; gap: .25rem; max-height: 200px; overflow-y: auto; }
.sticker-btn { background: transparent; border: none; font-size: 2.5rem; padding: .2rem; border-radius: 8px; cursor: pointer; line-height: 1; transition: transform .1s, background .1s; }
.sticker-btn:hover, .sticker-btn:active { background: var(--bg2); transform: scale(1.15); }

/* Attach menu */
.attach-menu { position: absolute; bottom: 100%; left: 0; right: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; z-index: 200; display: flex; gap: .5rem; padding: .75rem 1rem; margin-bottom: -1px; }
.attach-option { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .9rem .5rem; border-radius: var(--radius-sm); cursor: pointer; background: var(--bg2); border: 1px solid var(--border); font-size: .78rem; color: var(--text-muted); transition: all .15s; text-align: center; }
.attach-option:hover { border-color: var(--accent); color: var(--text); background: var(--bg); }
.attach-option svg { width: 22px; height: 22px; color: var(--accent); }

/* Recording bar */
.recording-bar { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; background: rgba(224,82,82,.08); border-bottom: 1px solid rgba(224,82,82,.2); flex-wrap: wrap; gap: .5rem; }
.rec-indicator { display: flex; align-items: center; gap: .6rem; color: var(--danger); font-size: .875rem; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse-rec 1s infinite; flex-shrink: 0; }
@keyframes pulse-rec { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-actions { display: flex; gap: .5rem; }
#btn-cancel-rec { background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: .35rem .75rem; cursor: pointer; font-size: .8rem; }
#btn-stop-rec { background: var(--accent); border: none; color: #fff; border-radius: 6px; padding: .35rem .75rem; cursor: pointer; font-size: .8rem; font-weight: 600; }

/* Main input form */
.message-input-area { display: flex; gap: .4rem; align-items: center; padding: .7rem 1rem; }
.message-input-area input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 24px; padding: .65rem 1.1rem; color: var(--text); font-size: .95rem; min-height: 44px; }
.message-input-area input:focus { outline: none; border-color: var(--accent); }
.emoji-toggle { background: transparent; border: none; font-size: 1.2rem; padding: .4rem; border-radius: 8px; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.emoji-toggle:hover { background: var(--bg3); }
.attach-toggle { background: transparent; border: none; color: var(--text-muted); padding: .4rem; border-radius: 8px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; transition: color .15s, background .15s; }
.attach-toggle svg { width: 20px; height: 20px; }
.attach-toggle:hover, .attach-toggle.active { color: var(--accent); background: var(--bg3); }
.btn-send { background: var(--accent); border: none; border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.btn-send svg { width: 17px; height: 17px; color: #fff; }
.btn-send:hover { background: var(--accent-hover); }

/* ── MODALS ───────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }
.section-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }

.friend-checkboxes { display: flex; flex-direction: column; gap: .3rem; max-height: 180px; overflow-y: auto; }
.friend-checkbox-item { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.friend-checkbox-item:hover { background: var(--bg3); }
.friend-checkbox-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.member-item { display: flex; align-items: center; gap: .7rem; padding: .4rem 0; }
.member-item .name { flex: 1; font-size: .9rem; }
.owner-badge { font-size: .68rem; background: var(--accent); color: #fff; padding: .1rem .4rem; border-radius: 10px; }
.remove-member-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: .25rem .45rem; border-radius: 4px; font-size: .75rem; }
.remove-member-btn:hover { color: var(--danger); background: rgba(224,82,82,.1); }
.add-member-row { display: flex; gap: .5rem; align-items: center; }
.member-select { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .7rem; color: var(--text); font-size: .875rem; }

/* ── CONTEXT MENU ─────────────────────────────────────────────────── */
.context-menu { position: fixed; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem 0; z-index: 900; min-width: 160px; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.context-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: .6rem 1rem; font-size: .875rem; color: var(--text); cursor: pointer; }
.context-menu button:hover { background: var(--bg2); }
.context-menu .ctx-danger { color: var(--danger); }

/* ── LIGHTBOX ─────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: default; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; background: rgba(255,255,255,.12); border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ── SCROLLBAR ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── TABLET ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .auth-panel { width: 380px; }
}

/* ── MOBILE ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --sidebar-w: 100vw; }
  body { overflow: hidden; }

  /* Auth */
  .auth-brand { display: none; }
  .auth-panel { width: 100%; background: var(--bg); }
  .auth-container { padding: 1.75rem 1.25rem; max-width: 100%; }
  .auth-logo-mobile { display: flex; }

  /* Prevent iOS zoom */
  .field input, .sidebar-search input, .message-input-area input,
  .member-select, input, select, textarea { font-size: 16px !important; }

  /* App layout */
  #view-app { position: relative; overflow: hidden; }
  .sidebar { position: absolute; inset: 0; z-index: 10; width: 100%; min-width: 0; transition: transform .25s ease; }
  .chat-area { width: 100%; display: none; flex-direction: column; }
  #view-app.chat-open .sidebar { display: none; }
  #view-app.chat-open .chat-area { display: flex; }
  .back-btn { display: flex !important; }

  /* Message bubbles narrower on mobile */
  .msg-bubble { max-width: 80%; }
  .msg-img { max-width: min(220px, 72vw); }
  .audio-player { min-width: min(180px, 68vw); max-width: min(240px, 72vw); }
  .msg-video { max-width: min(240px, 74vw); }

  /* Chat header */
  .chat-header { padding: .7rem .85rem; }

  /* Messages */
  .messages-container { padding: .75rem .85rem; }

  /* Input */
  .message-input-area { padding: .6rem .85rem; gap: .2rem; }
  .input-wrapper { padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px); }

  /* En móvil: ocultar botones buzz/balloon separados — viven dentro del picker ✨ */
  #btn-buzz, #btn-balloon { display: none; }

  /* Sección de acciones extra ya visible por defecto en picker */

  /* Wink picker sale desde abajo en móvil */
  .wink-picker {
    bottom: 60px; right: 8px; left: 8px; min-width: unset;
    border-radius: 18px;
  }

  /* Emoji grid narrower */
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .sticker-grid { grid-template-columns: repeat(4, 1fr); }

  /* Attach menu stack on small screen */
  .attach-menu { padding: .6rem .75rem; }

  /* Modals slide from bottom */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; max-height: 85vh; }

  /* Context menu */
  .context-menu { min-width: 140px; }
}

/* ── VERY SMALL ───────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .sticker-grid { grid-template-columns: repeat(3, 1fr); }
  .attach-menu { flex-direction: column; }
  .attach-option { flex-direction: row; padding: .6rem .75rem; }
}

/* ── CORPORATE DASHBOARD ──────────────────────────────────────────── */
#view-dashboard { flex-direction: column; overflow: hidden; }

.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem; background: #0b1221;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dash-brand { display: flex; align-items: center; gap: .6rem; color: var(--accent); font-weight: 700; font-size: 1.1rem; letter-spacing: .05em; }
.dash-brand svg { width: 28px; height: 28px; }
.dash-header-right { display: flex; align-items: center; gap: 1rem; }
.dash-uname { color: var(--text-muted); font-size: .85rem; }
.dash-btn-out {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 6px; padding: .35rem .8rem; font-size: .8rem; cursor: pointer; transition: .2s;
}
.dash-btn-out:hover { border-color: var(--accent); color: var(--accent); }
.dash-btn-report {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 6px; padding: .35rem .8rem; font-size: .8rem; cursor: pointer; transition: .2s;
}
.dash-btn-report:hover { border-color: var(--text-muted); color: var(--text); }

.dash-body {
  flex: 1; overflow-y: auto; padding: 2rem;
  max-width: 1100px; margin: 0 auto; width: 100%;
}

.dash-welcome { margin-bottom: 2rem; }
.dash-welcome h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 .3rem; }
.dash-welcome p { color: var(--text-muted); font-size: .88rem; margin: 0; }

.dash-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
.dash-stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem;
}
.dash-stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.dash-stat-val { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.dash-stat-lbl { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; }
.dash-spark { width: 55px; color: var(--accent); opacity: .45; }

.dash-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem;
}
.dash-panel h3 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin: 0 0 1rem; font-weight: 600;
}
.dash-activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .7rem; }
.dash-activity li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: .7rem; font-size: .83rem; }
.act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dash-activity time { color: var(--text-muted); font-size: .72rem; white-space: nowrap; }

.dash-status { display: flex; flex-direction: column; gap: .65rem; }
.dst-row { display: flex; align-items: center; gap: .7rem; font-size: .83rem; }
.dst-row span:nth-child(2) { flex: 1; }
.dst-ok { color: #10b981; font-size: .55rem; }
.dst-ok-txt { color: #10b981; font-size: .8rem; }

.dash-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.5rem; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .72rem;
  background: #0b1221; flex-shrink: 0;
  padding-bottom: max(.7rem, env(safe-area-inset-bottom, .7rem));
}
#secret-trigger { cursor: default; user-select: none; }
#secret-trigger:active { opacity: .7; }

@media (max-width: 700px) {
  .dash-stats  { grid-template-columns: repeat(2, 1fr); }
  .dash-panels { grid-template-columns: 1fr; }
  .dash-body   { padding: 1.25rem; }
}

@media (max-width: 640px) {
  #view-dashboard { overflow-y: auto; }
  .dash-header { padding: .6rem 1rem; }
  .dash-uname  { display: none; }
  .dash-btn-report { font-size: .72rem; padding: .3rem .6rem; }
  .dash-body   { padding: 1rem; }
  .dash-stats  { grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
  .dash-stat   { padding: .9rem; }
  .dash-stat-val { font-size: 1.5rem; }
  .dash-panels { gap: .75rem; }
  .dash-panel  { padding: .9rem; }
  .dash-welcome { margin-bottom: 1.25rem; }
  .dash-welcome h1 { font-size: 1.1rem; }
  .dash-footer { padding: .55rem 1rem; flex-wrap: wrap; gap: .25rem; font-size: .68rem; }
}

@media (max-width: 360px) {
  .dash-stats { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .dash-stat-val { font-size: 1.3rem; }
}

/* ── CODE PANEL ───────────────────────────────────────────────────── */
.code-panel {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2.5rem));
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  background: var(--bg2); border: 1px solid #2a4a7f;
  border-radius: 14px; padding: .55rem;
  display: flex; align-items: center; gap: .4rem;
  z-index: 9999; box-shadow: 0 8px 40px rgba(0,0,0,.55);
  min-width: 270px;
}
.code-panel:not(.hidden) { transform: translateX(-50%) translateY(0); }
.code-panel input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .5rem .75rem; color: var(--text);
  font-size: 1rem; outline: none; min-width: 0; letter-spacing: .1em;
}
.code-panel input:focus { border-color: var(--accent); }
.code-panel button {
  background: var(--bg3); border: none; border-radius: 8px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); flex-shrink: 0; transition: background .2s;
}
.code-panel button:hover { background: var(--accent); }
.code-panel button svg { width: 15px; height: 15px; }
#code-error {
  position: absolute; bottom: calc(100% + .6rem); left: 50%;
  transform: translateX(-50%);
  background: #2d1515; border: 1px solid var(--danger);
  color: var(--danger); font-size: .75rem;
  padding: .3rem .8rem; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
#code-error:not(:empty) { opacity: 1; }

@keyframes cpShake {
  0%,100% { transform: translateX(-50%) translateY(0); }
  20%      { transform: translateX(calc(-50% - 7px)) translateY(0); }
  40%      { transform: translateX(calc(-50% + 7px)) translateY(0); }
  60%      { transform: translateX(calc(-50% - 4px)) translateY(0); }
  80%      { transform: translateX(calc(-50% + 4px)) translateY(0); }
}
.code-panel.shake { animation: cpShake .4s ease; }

@media (max-width: 640px) {
  .code-panel {
    width: calc(100vw - 2rem); min-width: unset;
    bottom: 1rem; flex-wrap: wrap;
  }
  .code-panel input { width: 100%; flex: unset; }
  #code-error { white-space: normal; text-align: center; width: calc(100vw - 4rem); }
}

/* ── GAMES ──────────────────────────────────────────────────────────── */
.game-invite-bar {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem;
  background: var(--bg2); border-bottom: 1px solid var(--border); flex-wrap: wrap;
  font-size: .85rem; color: var(--text);
}
.game-invite-bar span { flex: 1; min-width: 0; }

.game-panel {
  display: flex; flex-direction: column; max-height: 65vh; min-height: 280px;
  background: var(--bg); border-bottom: 1px solid var(--border); overflow: hidden;
}
.game-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem .75rem; background: var(--bg3); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.game-label { font-size: .875rem; font-weight: 600; }
.game-area { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: .5rem; }

/* ── Sudoku ─────────────────────────────────────────────────────────── */
.sudoku-wrapper { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 100%; }
.sudoku-grid {
  display: grid; grid-template-columns: repeat(9, 1fr);
  border: 2px solid var(--accent); gap: 1px; background: var(--border);
  width: min(320px, 90vw); height: min(320px, 90vw); flex-shrink: 0;
}
.sudoku-cell {
  background: var(--bg2); display: flex; align-items: center; justify-content: center;
  font-size: clamp(.65rem, 2.2vw, .9rem); cursor: pointer; transition: background .1s;
  font-weight: 500; user-select: none;
}
.sudoku-cell.given   { color: var(--accent); font-weight: 700; cursor: default; }
.sudoku-cell.my-fill { color: #4ade80; }
.sudoku-cell.op-fill { color: #fb923c; }
.sudoku-cell.wrong   { color: var(--danger) !important; }
.sudoku-cell.selected { background: rgba(99,102,241,.3); }
.sudoku-cell:hover:not(.given) { background: var(--bg3); }
.sudoku-cell.box-left { border-left: 2px solid var(--accent); }
.sudoku-cell.box-top  { border-top:  2px solid var(--accent); }
.sudoku-numpad {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem;
  width: min(320px, 90vw);
}
.sudoku-num {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: .4rem; font-size: .9rem; color: var(--text); cursor: pointer; transition: background .15s;
}
.sudoku-num:hover { background: var(--accent); color: #fff; }
.game-status {
  font-size: .8rem; color: var(--text-muted); text-align: center;
  padding: .2rem .5rem; min-height: 1.4em;
}

/* ── Dominoes ───────────────────────────────────────────────────────── */
.domino-wrapper { display: flex; flex-direction: column; width: 100%; }
.domino-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: .28rem .65rem;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.domino-op-hand {
  display: flex; gap: .28rem; padding: .45rem .65rem;
  justify-content: center; flex-wrap: wrap;
  min-height: 66px; align-items: center;
  background: var(--bg2);
}
/* Green felt board */
.domino-board-scroll {
  overflow-x: auto; overflow-y: hidden;
  background: #1b5e35;
  border-top: 3px solid #0e3b20; border-bottom: 3px solid #0e3b20;
  padding: .55rem .75rem; min-height: 96px;
  display: flex; align-items: center;
}
.domino-board-scroll::-webkit-scrollbar { height: 4px; }
.domino-board-scroll::-webkit-scrollbar-track { background: #0e3b20; }
.domino-board-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 2px; }
.domino-board {
  display: flex; align-items: center; gap: .3rem;
  width: max-content; min-width: 100%;
}
.domino-empty-board {
  color: rgba(255,255,255,.45); font-size: .85rem;
  padding: .5rem 1rem; white-space: nowrap; width: 100%; text-align: center;
}
.domino-info {
  text-align: center; font-size: .8rem; color: var(--text-muted);
  padding: .3rem .5rem; border-bottom: 1px solid var(--border);
}
.domino-my-hand {
  display: flex; gap: .4rem; padding: .5rem .65rem;
  justify-content: center; flex-wrap: wrap;
  min-height: 108px; align-items: flex-end;
  background: var(--bg2);
}
.domino-actions {
  display: flex; gap: .5rem; justify-content: center;
  padding: .4rem .6rem; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

/* ── Domino tile ── */
.domino-tile {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
  /* board tile size */
  width: 40px; height: 80px;
  background: #f9f5e7;
  border: 2px solid #2a1608;
  border-radius: 7px;
  color: #1a1a1a; cursor: default;
  box-shadow: 0 2px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.55);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
/* Hand tiles: bigger */
.domino-my-hand .domino-tile {
  width: 50px; height: 100px;
}
/* Opponent backs: styled card backs */
.domino-tile.back {
  background: repeating-linear-gradient(
    45deg, #2c4fa3, #2c4fa3 4px, #1e3878 4px, #1e3878 8px
  );
  border-color: #16265a;
  width: 30px; height: 60px;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.domino-tile.selectable { cursor: pointer; }
.domino-tile.selectable:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0,0,0,.4), 0 0 0 2px rgba(99,102,241,.35);
}
.domino-tile.selected {
  transform: translateY(-16px);
  border-color: var(--accent); border-width: 2.5px;
  box-shadow: 0 16px 28px rgba(0,0,0,.45), 0 0 0 3px rgba(99,102,241,.55);
}
.domino-half {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
}
.domino-half svg { width: 26px; height: 26px; }
.domino-my-hand .domino-half svg { width: 34px; height: 34px; }
.domino-board   .domino-half svg { width: 26px; height: 26px; }
.domino-divider {
  width: 88%; height: 1.5px;
  background: #2a1608;
  flex-shrink: 0; border-radius: 1px;
  margin: 0 auto;
}

/* ── Game end overlay (revancha) ───────────────────────────────────── */
.game-panel { position: relative; }
.game-end-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.1rem; z-index: 40;
  padding: 1.5rem;
  animation: geoFadeIn .25s ease;
}
@keyframes geoFadeIn { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:scale(1); } }
.game-end-result {
  font-size: 1.3rem; font-weight: 700;
  text-align: center; color: #fff; line-height: 1.4;
}
.game-end-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.game-end-hint { font-size: .82rem; color: rgba(255,255,255,.6); text-align: center; min-height: 1.2em; }
.btn-rematch-pulse { animation: rmPulse .7s ease infinite alternate; }
@keyframes rmPulse { from { box-shadow: 0 0 0 0 rgba(99,102,241,.5); } to { box-shadow: 0 0 0 6px rgba(99,102,241,0); } }

/* ── Games modal ────────────────────────────────────────────────────── */
.game-list { display: flex; flex-direction: column; gap: .5rem; }
.game-choice {
  display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg3); cursor: pointer; transition: border-color .15s, background .15s;
  text-align: left; width: 100%;
}
.game-choice:hover { border-color: var(--accent); background: var(--bg2); }
.game-choice-icon { font-size: 1.8rem; flex-shrink: 0; }
.game-choice-info { display: flex; flex-direction: column; gap: .1rem; }
.game-choice-name { font-weight: 600; font-size: .95rem; }
.game-choice-desc { font-size: .8rem; color: var(--text-muted); }

/* ── Sticker direct button ──────────────────────────────────────────── */
.sticker-toggle {
  background: transparent; border: none; font-size: 1.2rem; cursor: pointer;
  padding: .3rem .4rem; border-radius: 6px; flex-shrink: 0; transition: background .15s;
  line-height: 1;
}
.sticker-toggle:hover { background: var(--bg3); }

/* ── Buzz button ────────────────────────────────────────────────────── */
.btn-buzz {
  background: transparent; border: none; font-size: 1.2rem; cursor: pointer;
  padding: .3rem .4rem; border-radius: 6px; flex-shrink: 0; transition: background .15s, transform .1s;
  line-height: 1; opacity: .7;
}
.btn-buzz:hover { background: var(--bg3); opacity: 1; }
.btn-buzz:disabled { opacity: .3; cursor: default; }
.btn-buzz.fired { animation: buzz-btn-pop .3s ease; }

@keyframes buzz-btn-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4) rotate(-15deg); }
  70%  { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Sacudida del área de mensajes al recibir zumbido */
@keyframes buzz-shake {
  0%,100% { transform: translateX(0); }
  10%,50%,90% { transform: translateX(-8px); }
  30%,70% { transform: translateX(8px); }
}
.buzz-shaking { animation: buzz-shake .5s ease; }

/* Toast de zumbido */
.buzz-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: .5rem 1.2rem;
  border-radius: 20px; font-size: .9rem; font-weight: 600;
  z-index: 9999; white-space: nowrap;
  animation: buzz-toast-in .25s ease, buzz-toast-out .3s ease 2.2s forwards;
  pointer-events: none;
}
@keyframes buzz-toast-in  { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes buzz-toast-out { to   { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ── Wink button ───────────────────────────────────────────────────── */
.btn-wink {
  background: transparent; border: none; font-size: 1.2rem; cursor: pointer;
  padding: .3rem .4rem; border-radius: 6px; flex-shrink: 0;
  transition: background .15s, transform .1s; line-height: 1; opacity: .7;
}
.btn-wink:hover { background: var(--bg3); opacity: 1; }


/* ── Wink picker ───────────────────────────────────────────────────── */
.wink-picker {
  position: fixed; bottom: 70px; right: 80px; z-index: 9000;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: .8rem; box-shadow: 0 8px 32px rgba(0,0,0,.35);
  min-width: 200px;
  animation: picker-pop .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes picker-pop { from { opacity:0; transform: scale(.85) translateY(10px); } to { opacity:1; transform: scale(1) translateY(0); } }
.wink-picker-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6rem; }
.wink-picker-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: .4rem; }
.wink-option {
  background: transparent; border: none; cursor: pointer; border-radius: 10px;
  padding: .5rem .3rem; display: flex; flex-direction: column; align-items: center; gap: .2rem;
  transition: background .15s, transform .1s; color: var(--text);
}
.wink-option:hover { background: var(--bg3); transform: scale(1.1); }
.wink-option .wink-thumb { font-size: 1.8rem; line-height: 1; }
.wink-option span:last-child { font-size: .65rem; color: var(--text-muted); }

/* ── Wink overlay (pantalla completa) ──────────────────────────────── */
.wink-overlay {
  position: fixed; inset: 0; z-index: 99980; background: rgba(0,0,0,.01);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer; overflow: hidden;
}

/* ── Wink: WATER BALLOON (niño SVG) ───────────────────────────────── */
.wink-water-balloon-scene {
  position: absolute; inset: 0; pointer-events: none;
}
.wink-boy {
  position: absolute; bottom: 15%; left: -200px;
  width: 160px; height: 220px;
  animation: boy-walk-in 1.2s ease-out forwards, boy-throw 0.4s ease-in 1.5s forwards;
}
@keyframes boy-walk-in {
  from { left: -200px; }
  to   { left: calc(50% - 80px); }
}
@keyframes boy-throw {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(-15deg) translateY(-10px); }
  100% { transform: rotate(5deg); }
}
.wink-balloon-fly {
  position: absolute; font-size: 5rem;
  bottom: calc(15% + 160px); left: calc(50% - 40px);
  opacity: 0;
  animation: balloon-launch 1.2s ease-in 1.6s forwards;
}
@keyframes balloon-launch {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  40%  { transform: scale(1.3) translate(80px, -60px); opacity: 1; }
  100% { transform: scale(3) translate(200px, -200px); opacity: 0; }
}
.wink-water-splash-full {
  position: absolute; inset: 0;
  background: rgba(80,200,255,.0);
  opacity: 0;
  animation: full-splash 0.6s ease-out 2.6s forwards;
}
@keyframes full-splash {
  0%   { opacity: 0; background: rgba(80,200,255,.0); }
  30%  { opacity: 1; background: rgba(80,200,255,.65); }
  100% { opacity: 0; background: rgba(80,200,255,.1); }
}

/* ── Wink: NUDGE (puño) ────────────────────────────────────────────── */
.wink-nudge-fist {
  font-size: 10rem; position: absolute;
  animation: fist-punch 2s ease forwards;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.5));
}
@keyframes fist-punch {
  0%   { right: -200px; top: 30%; transform: rotate(-30deg) scale(.5); opacity: 0; }
  25%  { right: 30%; top: 25%; transform: rotate(-10deg) scale(1.3); opacity: 1; }
  40%  { right: 28%; top: 27%; transform: rotate(5deg) scale(.95); }
  55%  { right: 31%; top: 24%; transform: rotate(-5deg) scale(1.1); }
  70%  { right: 29%; top: 26%; transform: rotate(0deg) scale(1); }
  85%  { right: 30%; top: 25%; opacity: 1; }
  100% { right: -200px; top: 25%; opacity: 0; }
}
.wink-nudge-stars {
  position: absolute; top: 15%; left: 20%;
  font-size: 3rem; opacity: 0;
  animation: stars-burst 1s ease 0.5s forwards;
}
@keyframes stars-burst {
  0%   { opacity: 0; transform: scale(.3); }
  50%  { opacity: 1; transform: scale(1.2) rotate(15deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(-10deg); }
}
.wink-nudge-shake {
  position: absolute; inset: 0; pointer-events: none;
  animation: nudge-screen-shake 0.6s ease 0.45s;
}
@keyframes nudge-screen-shake {
  0%,100% { transform: translate(0,0); }
  15%  { transform: translate(-12px, 5px); }
  30%  { transform: translate(10px, -5px); }
  45%  { transform: translate(-8px, 3px); }
  60%  { transform: translate(6px, -3px); }
  75%  { transform: translate(-4px, 2px); }
}

/* ── Wink: KISS (labios) ────────────────────────────────────────────── */
.wink-kiss-lips {
  font-size: 9rem; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: kiss-appear 2.5s ease forwards;
  filter: drop-shadow(0 4px 20px rgba(255,100,150,.6));
}
@keyframes kiss-appear {
  0%   { transform: translate(-50%,-50%) scale(0) rotate(-20deg); opacity: 0; }
  20%  { transform: translate(-50%,-50%) scale(1.3) rotate(5deg); opacity: 1; }
  35%  { transform: translate(-50%,-50%) scale(1) rotate(0deg); }
  70%  { transform: translate(-50%,-50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.5) rotate(-5deg); opacity: 0; }
}
.wink-kiss-heart {
  position: absolute; font-size: 2.5rem; opacity: 0;
  animation: kiss-heart-fly var(--dur,2s) ease var(--dly,0s) forwards;
}
@keyframes kiss-heart-fly {
  0%   { opacity: 0; transform: translateY(0) scale(.5); }
  20%  { opacity: 1; transform: translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translateY(-180px) scale(.7) rotate(var(--rot,15deg)); }
}

/* ── Wink: HEART (corazones) ────────────────────────────────────────── */
.wink-heart-item {
  position: absolute; pointer-events: none;
  animation: heart-rise var(--dur,3s) ease var(--dly,0s) forwards;
  font-size: var(--sz,3rem); opacity: 0;
}
@keyframes heart-rise {
  0%   { opacity: 0; transform: translateY(0) rotate(var(--tilt,-10deg)) scale(.5); }
  15%  { opacity: 1; transform: translateY(-40px) rotate(var(--tilt,-10deg)) scale(1.1); }
  85%  { opacity: .7; }
  100% { opacity: 0; transform: translateY(-85vh) rotate(calc(var(--tilt,-10deg) * -1)) scale(.8); }
}
.wink-heart-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 60%, rgba(255,80,120,.25) 0%, transparent 70%);
  animation: heart-bg-fade 3s ease forwards;
}
@keyframes heart-bg-fade {
  0%,10% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; }
}

/* ── Wink: BOUNCY BALL ─────────────────────────────────────────────── */
.wink-ball {
  position: absolute; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #3b82f6 40%, #1e40af 100%);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), inset 0 -4px 12px rgba(0,0,0,.3);
  animation: ball-bounce 2.8s cubic-bezier(.36,.07,.19,.97) forwards;
}
@keyframes ball-bounce {
  0%   { left: 5%; top: -100px; transform: scale(1); }
  12%  { left: 15%; top: 60%; transform: scaleX(1.2) scaleY(.8); }
  22%  { left: 30%; top: 10%; transform: scale(1); }
  32%  { left: 45%; top: 65%; transform: scaleX(1.2) scaleY(.8); }
  42%  { left: 60%; top: 8%; transform: scale(1) rotate(180deg); }
  52%  { left: 72%; top: 62%; transform: scaleX(1.2) scaleY(.8); }
  62%  { left: 82%; top: 12%; transform: scale(1) rotate(360deg); }
  75%  { left: 88%; top: 60%; transform: scaleX(1.1) scaleY(.9); }
  100% { left: 110%; top: 50%; transform: scale(.8); }
}
.wink-ball-shadow {
  position: absolute; border-radius: 50%;
  background: rgba(0,0,0,.25); filter: blur(6px);
  width: 70px; height: 18px;
  animation: ball-shadow 2.8s ease forwards;
}
@keyframes ball-shadow {
  0%   { left: 5%; bottom: 30%; opacity: 0; transform: scaleX(.5); }
  12%  { left: 15%; bottom: calc(40% - 9px); opacity: .6; transform: scaleX(1.2); }
  22%  { left: 30%; bottom: 30%; opacity: .3; transform: scaleX(.7); }
  32%  { left: 45%; bottom: calc(35% - 9px); opacity: .6; transform: scaleX(1.2); }
  42%  { left: 60%; bottom: 30%; opacity: .3; transform: scaleX(.7); }
  52%  { left: 72%; bottom: calc(38% - 9px); opacity: .6; transform: scaleX(1.1); }
  62%  { left: 82%; bottom: 30%; opacity: .3; transform: scaleX(.7); }
  75%  { left: 88%; bottom: calc(40% - 9px); opacity: .5; transform: scaleX(1.1); }
  100% { left: 110%; bottom: 30%; opacity: 0; }
}

/* ── Balloon button ────────────────────────────────────────────────── */
.btn-balloon {
  background: transparent; border: none; font-size: 1.2rem; cursor: pointer;
  padding: .3rem .4rem; border-radius: 6px; flex-shrink: 0;
  transition: background .15s, transform .1s; line-height: 1; opacity: .7;
}
.btn-balloon:hover { background: var(--bg3); opacity: 1; }
.btn-balloon:disabled { opacity: .3; cursor: default; }

/* Globo en vuelo */
.balloon-fly {
  position: fixed; z-index: 99990; pointer-events: none;
  font-size: 3rem; user-select: none; will-change: transform;
  animation: balloon-rise var(--dur,2.5s) ease-in forwards;
}
@keyframes balloon-rise {
  0%   { transform: translateY(0) rotate(-5deg) scale(1); opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(10deg) scale(.8); opacity: 0; }
}

/* Globo recibido — rebota e interactivo */
.balloon-incoming {
  position: fixed; z-index: 99991; font-size: 4rem; cursor: pointer;
  user-select: none; will-change: transform;
  animation: balloon-bounce 0.6s ease infinite alternate;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
  transition: transform .1s;
}
.balloon-incoming:active { transform: scale(1.15); }
@keyframes balloon-bounce {
  from { transform: translateY(0) rotate(-8deg); }
  to   { transform: translateY(-18px) rotate(8deg); }
}

/* Mini splash al tocarlo */
.balloon-pop {
  position: fixed; z-index: 99992; font-size: 3.5rem; pointer-events: none;
  animation: balloon-pop-anim .45s ease forwards;
}
@keyframes balloon-pop-anim {
  0%   { transform: scale(.5); opacity: 1; }
  60%  { transform: scale(1.8); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Pantalla mojada — cae agua desde arriba */
.water-overlay {
  position: fixed; inset: 0; z-index: 99995; pointer-events: none;
  overflow: hidden; background: transparent;
}
.water-overlay::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  background: linear-gradient(180deg,
    rgba(100,180,255,.55) 0%,
    rgba(60,140,255,.35) 30%,
    rgba(30,100,220,.15) 70%,
    transparent 100%);
  animation: water-fall .4s ease-out forwards;
}
@keyframes water-fall {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.water-drop {
  position: absolute; top: -60px; width: 12px; height: 24px;
  background: rgba(80,160,255,.7); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: drop-fall var(--spd,1.2s) ease-in var(--dly,0s) forwards;
}
@keyframes drop-fall {
  0%   { transform: translateY(0) scaleX(1); opacity: .9; }
  80%  { opacity: .7; }
  100% { transform: translateY(110vh) scaleX(.7); opacity: 0; }
}
.water-splash {
  position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
  background: rgba(80,160,255,.35);
  animation: splash-fade 2.5s ease-out 0.3s forwards;
}
@keyframes splash-fade { to { opacity: 0; height: 0; } }

/* Contador antes de explotar */
.balloon-timer {
  position: fixed; z-index: 99993; pointer-events: none;
  font-size: 1.4rem; font-weight: 900; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: timer-pulse .5s ease infinite alternate;
}
@keyframes timer-pulse { from { transform: scale(1); } to { transform: scale(1.25); } }

/* Toast de globo */
.balloon-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #3b9eff; color: #fff; padding: .5rem 1.3rem;
  border-radius: 20px; font-size: .9rem; font-weight: 600;
  z-index: 99999; white-space: nowrap; pointer-events: none;
  animation: buzz-toast-in .25s ease, buzz-toast-out .3s ease 2.5s forwards;
}

/* ── Toast ──────────────────────────────────────────────────────────── */
.game-toast {
  position: fixed; bottom: 5.5rem; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  padding: .45rem 1.1rem; font-size: .83rem; z-index: 9500;
  opacity: 0; transition: opacity .28s, transform .28s; pointer-events: none;
  white-space: nowrap; max-width: 90vw; text-align: center;
}
.game-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 4 en Línea ─────────────────────────────────────────────────────── */
.c4-wrapper { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: .5rem; }
.c4-board {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: clamp(3px,1vw,6px);
  background: linear-gradient(160deg,#1a6bcc,#1255a8);
  padding: clamp(6px,1.5vw,10px); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.15);
}
.c4-cell {
  width:  clamp(36px,7.5vw,46px);
  height: clamp(36px,7.5vw,46px);
  border-radius: 50%;
  background: #0e1a2e;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.7), inset 0 -1px 2px rgba(255,255,255,.08);
  transition: background .22s, box-shadow .22s;
}
.c4-cell.p1 {
  background: radial-gradient(circle at 35% 35%, #ff6b5b, #c0392b);
  box-shadow: 0 2px 8px rgba(192,57,43,.7), inset 0 1px 0 rgba(255,255,255,.2);
}
.c4-cell.p2 {
  background: radial-gradient(circle at 35% 35%, #ffe066, #d4ac0d);
  box-shadow: 0 2px 8px rgba(212,172,13,.7), inset 0 1px 0 rgba(255,255,255,.25);
}
.c4-cell.win { animation: c4-pulse .5s alternate infinite; }
@keyframes c4-pulse {
  from { filter: brightness(1) saturate(1); }
  to   { filter: brightness(1.45) saturate(1.3); }
}
.c4-cols { display: flex; gap: clamp(3px,1vw,6px); padding: 0 clamp(6px,1.5vw,10px); }
.c4-col-btn {
  width: clamp(36px,7.5vw,46px);
  background: transparent; border: none; cursor: pointer;
  font-size: 1.1rem; opacity: .55; transition: opacity .15s, transform .12s;
  line-height: 1.2;
}
.c4-col-btn:hover { opacity: 1; transform: translateY(-2px); }
.c4-col-btn:disabled { opacity: .18; cursor: default; transform: none; }

/* ── Batalla Naval ──────────────────────────────────────────────────── */
.bs-wrapper { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .5rem; overflow: auto; }
.bs-grids { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.bs-grid-section { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.bs-grid-label {
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.bs-grid {
  display: grid; grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  background: linear-gradient(160deg,#0d4b7a,#083860);
  padding: 6px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
}
.bs-cell {
  width: clamp(24px,4.5vw,30px); height: clamp(24px,4.5vw,30px);
  border-radius: 4px;
  background: rgba(100,185,255,.12); border: 1px solid rgba(100,185,255,.18);
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
}
.bs-cell.ship { background: rgba(100,185,255,.3); border-color: rgba(100,185,255,.45); }
.bs-cell.hit  {
  background: radial-gradient(circle at 40% 35%, #ff5c4d, #c0392b);
  border-color: #922b21;
}
.bs-cell.hit::after  { content: '✕'; color: rgba(255,255,255,.8); font-size: .65rem; }
.bs-cell.miss {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15);
}
.bs-cell.miss::after { content: '·'; color: rgba(255,255,255,.45); font-size: 1.1rem; line-height: 1; }
.bs-cell.sunk { background: #8b0000; border-color: #600; }
.bs-attack-grid .bs-cell { cursor: crosshair; }
.bs-attack-grid .bs-cell:hover:not(.hit):not(.miss):not(.sunk) {
  background: rgba(255,220,80,.28); border-color: rgba(255,220,80,.5);
}

/* ── Ahorcado ───────────────────────────────────────────────────────── */
.hangman-wrapper { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: .6rem; }
.hangman-canvas { border-radius: 10px; background: var(--bg2); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.hangman-word {
  display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center;
  font-size: clamp(1.1rem, 4vw, 1.6rem); letter-spacing: .12em; font-weight: 700;
}
.hangman-letter {
  border-bottom: 3px solid var(--accent); min-width: 1.3rem; text-align: center;
  padding-bottom: 2px;
}
.hangman-letter.revealed { color: var(--text); }
.hangman-keyboard {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px;
  max-width: min(340px, 95vw);
}
.hm-key {
  padding: .38rem .15rem; font-size: .85rem; font-weight: 700;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: background .12s, transform .1s; text-align: center;
}
.hm-key:hover:not(:disabled) { background: var(--accent); color: #fff; transform: translateY(-1px); }
.hm-key.used-correct {
  background: #27ae60; color: #fff; border-color: #1e8449; cursor: default;
  box-shadow: 0 0 6px rgba(39,174,96,.4);
}
.hm-key.used-wrong {
  background: rgba(231,76,60,.25); color: var(--text-muted);
  border-color: rgba(231,76,60,.3); cursor: default;
}
.hm-key:disabled { cursor: default; }
.hangman-word-input { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
.hangman-word-input input {
  padding: .5rem .8rem; font-size: 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  text-align: center; text-transform: uppercase; letter-spacing: .15em;
}

/* ── Watch reactions ────────────────────────────────────────────────── */
.watch-reactions-overlay {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20;
}
.watch-floating-emoji {
  position: absolute; bottom: 60px; font-size: 2rem;
  animation: float-up 2.5s ease-out forwards; pointer-events: none; user-select: none;
}
@keyframes float-up {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(-240px) scale(1.4); opacity: 0; }
}
.watch-emoji-bar { display: flex; gap: .2rem; }
.watch-emoji-btn {
  background: transparent; border: none; font-size: 1.3rem; cursor: pointer;
  padding: .2rem .3rem; border-radius: 6px; transition: transform .12s;
}
.watch-emoji-btn:hover { transform: scale(1.3); }
.watch-pause-signal-toast {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78); color: #fff; border-radius: 14px;
  padding: .8rem 1.6rem; font-size: 1.2rem; font-weight: 600;
  pointer-events: none; z-index: 30; animation: pause-signal-pop .4s ease;
}
@keyframes pause-signal-pop {
  0%   { transform: translate(-50%,-50%) scale(.7); opacity: 0; }
  60%  { transform: translate(-50%,-50%) scale(1.08); }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}

/* ── Stories bar ──────────────────────────────────────────────────── */
.stories-bar {
  padding: .5rem .75rem; border-bottom: 1px solid var(--border); overflow-x: auto;
  scrollbar-width: none;
}
.stories-list { display: flex; gap: .75rem; width: max-content; }
.story-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer; }
.story-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700; color: #fff;
  position: relative; border: 2px solid var(--border);
}
.story-avatar.has-story { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.story-add-plus { position: absolute; bottom: -2px; right: -2px; background: var(--accent); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.story-name { font-size: .65rem; color: var(--text-muted); max-width: 50px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-text-view { border-radius: .75rem; padding: 1.5rem; color: #fff; font-size: 1rem; font-weight: 500; min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; word-break: break-word; }
.story-color-picker { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .3rem; }
.story-color-dot { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.story-color-dot.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.story-type-btns { display: flex; gap: .4rem; }
.story-type-btn { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .85rem; }
.story-type-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Reply quote ──────────────────────────────────────────────────── */
.reply-preview {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .75rem;
  border-top: 1px solid var(--border); background: var(--bg2);
}
.reply-preview-line { width: 3px; min-height: 30px; background: var(--accent); border-radius: 2px; flex-shrink: 0; }
.reply-preview-content { flex: 1; min-width: 0; }
.reply-preview-sender { font-size: .7rem; color: var(--accent); font-weight: 600; }
.reply-preview-text { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-cancel { font-size: .9rem; }
.msg-reply-quote {
  background: rgba(255,255,255,.06); border-left: 3px solid var(--accent); border-radius: 4px;
  padding: .2rem .5rem; margin-bottom: .35rem; cursor: pointer;
}
.msg-reply-sender { font-size: .7rem; color: var(--accent); font-weight: 600; display: block; }
.msg-reply-text { font-size: .78rem; color: var(--text-muted); }

/* ── Edit mode bar ──────────────────────────────────────────────────── */
.edit-mode-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .3rem .75rem; background: rgba(59,125,216,.12); border-top: 1px solid var(--accent);
  font-size: .8rem; color: var(--accent);
}

/* ── Self-destruct bar ──────────────────────────────────────────────── */
.destruct-bar {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .75rem;
  background: rgba(240,130,50,.1); border-top: 1px solid rgba(240,130,50,.3);
  font-size: .8rem; color: #f08232;
}
.destruct-bar select { background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: .15rem .3rem; font-size: .8rem; }
.msg-expires { font-size: .65rem; color: #f08232; margin-left: .25rem; }

/* ── Typing indicator ────────────────────────────────────────────── */
.typing-indicator {
  display: flex; align-items: center; gap: .4rem; padding: .3rem .75rem;
  font-size: .78rem; color: var(--text-muted);
}
.typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-dots span { width: 5px; height: 5px; background: var(--text-muted); border-radius: 50%; animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce { 0%,80%,100% { transform: scale(1); opacity:.5; } 40% { transform: scale(1.2); opacity:1; } }

/* ── Reactions ───────────────────────────────────────────────────── */
.msg-reactions { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .25rem; }
.reaction-chip {
  display: flex; align-items: center; gap: .2rem; padding: .1rem .4rem;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  font-size: .82rem; cursor: pointer; color: var(--text); transition: background .15s;
}
.reaction-chip.mine { border-color: var(--accent); background: rgba(59,125,216,.15); }
.reaction-chip:hover { background: var(--bg); }
.reaction-chip span { font-size: .75rem; color: var(--text-muted); }
.reaction-picker {
  position: fixed; z-index: 1001; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 30px; padding: .3rem .5rem; display: flex; gap: .25rem; box-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.reaction-picker button { background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: .1rem .2rem; border-radius: 6px; transition: transform .12s; }
.reaction-picker button:hover { transform: scale(1.3); }

/* ── Edited badge ────────────────────────────────────────────────── */
.msg-edited { font-size: .65rem; color: var(--text-muted); margin-left: .3rem; font-style: italic; }

/* ── @mention ────────────────────────────────────────────────────── */
.mention { color: var(--accent); font-weight: 600; }
.mention-list {
  position: absolute; bottom: 100%; left: 0; right: 0; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 8px 8px 0 0; max-height: 160px; overflow-y: auto; z-index: 100;
}
.mention-item {
  padding: .5rem .75rem; cursor: pointer; font-size: .85rem;
  display: flex; align-items: center; gap: .5rem;
}
.mention-item:hover { background: var(--bg3); }

/* ── Chat search bar ──────────────────────────────────────────────── */
.chat-search-bar {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem;
  border-bottom: 1px solid var(--border); background: var(--bg2); position: relative;
  flex-direction: column; align-items: stretch;
}
.chat-search-bar > div:first-child { display: flex; align-items: center; gap: .5rem; }
#chat-search-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .75rem; color: var(--text); font-size: .875rem; }
.chat-search-results { max-height: 200px; overflow-y: auto; }
.search-result-item { padding: .4rem .75rem; cursor: pointer; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr auto; gap: .4rem; align-items: center; font-size: .8rem; }
.search-result-item:hover { background: var(--bg3); }
.sri-sender { color: var(--accent); font-weight: 600; white-space: nowrap; }
.sri-content { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sri-time { color: var(--text-muted); white-space: nowrap; font-size: .72rem; }
.search-empty { padding: .75rem; color: var(--text-muted); font-size: .85rem; text-align: center; }
.msg.highlight .msg-bubble { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline .3s; }

/* ── Gallery modal ───────────────────────────────────────────────── */
.modal-wide { max-width: 640px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.gallery-item img, .gallery-item video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; }

/* ── Poll ─────────────────────────────────────────────────────────── */
.poll-bubble { min-width: 220px; }
.poll-question { font-weight: 600; margin-bottom: .5rem; }
.poll-options { display: flex; flex-direction: column; gap: .3rem; }
.poll-option {
  position: relative; padding: .4rem .6rem; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer; font-size: .85rem; overflow: hidden;
  transition: border-color .15s;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.my-vote { border-color: var(--accent); }
.poll-bar { position: absolute; inset: 0; background: rgba(59,125,216,.18); pointer-events: none; transition: width .4s; }
.poll-opt-text { position: relative; z-index: 1; }
.poll-opt-pct { position: relative; z-index: 1; font-size: .72rem; color: var(--text-muted); float: right; }
.poll-total { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; text-align: right; }

/* ── Context menu extras ─────────────────────────────────────────── */
#ctx-reply, #ctx-react, #ctx-edit, #ctx-destruct { color: var(--text); }

/* ── Ludo ─────────────────────────────────────────────────────────── */
.ludo-wrapper { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: .5rem; width: 100%; }
.ludo-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  width: min(90vw, 460px);
  height: min(90vw, 460px);
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lc { position: relative; display: flex; align-items: center; justify-content: center; font-size: .55rem; color: rgba(0,0,0,.4); user-select: none; }
.lc-empty { background: #f0f0f0; }
.lc-track { background: #fff; }
.lc-safe { background: #fffde0; }
/* Start squares colored per player */
.lc-red-start { background: #ffb3b3; }
.lc-blue-start { background: #b3ccff; }
.lc-green-start { background: #b3ffb3; }
.lc-yellow-start { background: #fff5b3; }
/* Home path colors */
.lc-red-home { background: #ff4444; }
.lc-blue-home { background: #4477ff; }
.lc-green-home { background: #44cc44; }
.lc-yellow-home { background: #ffcc00; }
/* Yard areas */
.lc-red-yard { background: #ffcccc; }
.lc-blue-yard { background: #ccd9ff; }
.lc-green-yard { background: #ccffcc; }
.lc-yellow-yard { background: #fffacc; }
/* Center */
.lc-center { background: linear-gradient(135deg,#ff4444 25%,#4477ff 25%,#4477ff 50%,#44cc44 50%,#44cc44 75%,#ffcc00 75%); font-size: 1rem; }

/* Tokens */
.ludo-tok {
  width: 60%; height: 60%; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.35);
  display: inline-block; cursor: default; transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.ludo-tok-red { background: #e53935; }
.ludo-tok-blue { background: #1e88e5; }
.ludo-tok-green { background: #43a047; }
.ludo-tok-yellow { background: #fdd835; }
.ludo-tok-movable { cursor: pointer; animation: ludo-pulse .9s infinite; border-color: #fff !important; }
@keyframes ludo-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18)} }
/* multiple tokens on same cell → shrink */
.lc > .ludo-tok ~ .ludo-tok { width: 44%; height: 44%; position: absolute; }
.lc > .ludo-tok:nth-child(2) { top: 4%; left: 4%; }
.lc > .ludo-tok:nth-child(3) { bottom: 4%; right: 4%; }
.lc > .ludo-tok:nth-child(4) { bottom: 4%; left: 4%; }

/* Dice area */
.ludo-dice-area { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.ludo-dice { font-size: 2.5rem; line-height: 1; }
.ludo-roll-btn { padding: .4rem 1.2rem; }
.ludo-turn-label { font-size: .85rem; color: var(--text-muted); text-align: center; }

/* Lobby */
.ludo-lobby { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.ludo-lobby-player { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.ludo-lobby-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.3); display: inline-block; }
.ludo-lobby-hint { font-size: .8rem; color: var(--text-muted); text-align: center; }

/* ── FORWARD LIST ────────────────────────────────────────────────── */
.forward-list { display: flex; flex-direction: column; gap: .4rem; max-height: 60vh; overflow-y: auto; }
.forward-item {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .15s;
}
.forward-item:hover { background: var(--bg3); }
.forward-item .avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; }
.forward-item span { font-size: .9rem; color: var(--text); }

/* ── Tres en Raya ────────────────────────────────────────────────── */
.ttt-wrapper { display: flex; flex-direction: column; align-items: center; gap: .85rem; padding: .75rem 1rem; }
.ttt-board {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 7px;
  background: var(--border); border-radius: 16px; padding: 7px;
  width: min(252px, 78vw);
}
.ttt-cell {
  aspect-ratio: 1; background: var(--bg2); border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(2rem,9vw,3.2rem); font-weight: 900;
  user-select: none; transition: background .15s, transform .1s;
}
.ttt-cell.clickable { cursor: pointer; }
.ttt-cell.clickable:hover { background: var(--bg3); transform: scale(1.06); }
.ttt-cell.x { color: #e05252; text-shadow: 0 0 14px rgba(224,82,82,.45); animation: ttt-pop .18s ease; }
.ttt-cell.o { color: #3b7dd8; text-shadow: 0 0 14px rgba(59,125,216,.45); animation: ttt-pop .18s ease; }
.ttt-cell.win { background: rgba(40,168,122,.22); box-shadow: 0 0 14px rgba(40,168,122,.35); animation: none !important; }
.game-status.my-turn { color: var(--accent); font-weight: 700; }
@keyframes ttt-pop { from { transform: scale(.5); opacity:0; } to { transform: scale(1); opacity:1; } }

/* ── Trivia ──────────────────────────────────────────────────────── */
.trivia-wrapper { display: flex; flex-direction: column; gap: .7rem; padding: .75rem; height: 100%; overflow-y: auto; }
.trivia-scoreboard { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.trivia-score-block { display: flex; flex-direction: column; align-items: center; gap: .1rem; flex: 1; }
.trivia-score-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.trivia-score-num { font-size: 2.1rem; font-weight: 900; color: var(--accent); line-height: 1; }
.trivia-progress { display: flex; gap: 5px; justify-content: center; align-items: center; flex: 0 0 auto; }
.trivia-pip { width: 9px; height: 9px; border-radius: 50%; background: var(--bg3); border: 1.5px solid var(--border); transition: background .3s; }
.trivia-pip.done { background: var(--accent); border-color: var(--accent); }
.trivia-timer-row { display: flex; align-items: center; gap: .6rem; }
.trivia-timer-text { font-size: .78rem; font-weight: 700; color: var(--text-muted); min-width: 2.2rem; text-align: right; }
.trivia-timer-bar { flex: 1; height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.trivia-timer-fill { height: 100%; background: linear-gradient(90deg,var(--accent),#5ba0e6); border-radius: 3px; transition: width .95s linear; }
.trivia-question-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 13px; padding: .9rem; }
.trivia-question { font-size: .93rem; font-weight: 600; margin: 0 0 .75rem; line-height: 1.45; color: var(--text); }
.trivia-options { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.trivia-opt {
  padding: .6rem .5rem; border-radius: 9px; display: flex; align-items: flex-start; gap: .4rem;
  background: var(--bg3); border: 2px solid transparent; cursor: pointer;
  font-size: .82rem; text-align: left; line-height: 1.35; color: var(--text);
  transition: border-color .15s, background .15s;
}
.trivia-opt:hover:not(:disabled) { border-color: var(--accent); background: rgba(59,125,216,.1); }
.trivia-opt-label { font-weight: 800; color: var(--accent); flex-shrink: 0; }
.trivia-opt.selected { border-color: var(--accent); background: rgba(59,125,216,.15); }
.trivia-opt.correct { border-color: #28a87a !important; background: rgba(40,168,122,.18) !important; }
.trivia-opt.wrong { border-color: #d94f4f !important; background: rgba(217,79,79,.12) !important; }
.trivia-opt:disabled { cursor: default; }
.trivia-result {
  padding: .6rem .8rem; border-radius: 9px; text-align: center;
  font-size: .88rem; font-weight: 600; animation: ttt-pop .2s ease;
}
.trivia-result.correct-you { background: rgba(40,168,122,.15); color: #28a87a; }
.trivia-result.correct-op { background: rgba(217,79,79,.1); color: #d94f4f; }
.trivia-result.both-correct { background: rgba(59,125,216,.12); color: var(--accent); }
.trivia-result.both-wrong { background: var(--bg3); color: var(--text-muted); }
.trivia-next-hint { font-size: .78rem; color: var(--text-muted); text-align: center; min-height: 1.1rem; }

/* ── dark mode overrides */
@media (prefers-color-scheme: dark) {
  .lc-empty { background: #2a2a2a; }
  .lc-track { background: #1e1e1e; }
  .lc-safe { background: #3a3a1e; }
  .lc-red-yard { background: #5c2020; }
  .lc-blue-yard { background: #202050; }
  .lc-green-yard { background: #1e4020; }
  .lc-yellow-yard { background: #504010; }
}

/* ── Trivia Grupal ──────────────────────────────────────────────── */
.trivia-group-wrapper {
  display: flex; flex-direction: column; gap: .6rem;
  padding: .5rem; height: 100%; overflow-y: auto;
}
.tg-scoreboard {
  display: flex; flex-wrap: wrap; gap: .4rem;
  background: var(--bg-secondary); border-radius: 10px; padding: .5rem;
}
.tg-player-score {
  display: flex; align-items: center; gap: .4rem;
  background: var(--bg-tertiary); border-radius: 8px; padding: .3rem .6rem;
  font-size: .78rem; border: 2px solid transparent; transition: border-color .2s;
}
.tg-player-score.tg-me { border-color: var(--accent); }
.tg-player-name { color: var(--text-secondary); }
.tg-score-badge {
  background: var(--accent); color: #fff; border-radius: 6px;
  padding: .1rem .35rem; font-weight: 700; font-size: .8rem;
}
.tg-question-num {
  font-size: .75rem; color: var(--text-muted); text-align: center; margin: 0;
}
.tg-answered-count {
  text-align: center; font-size: .75rem; color: var(--text-muted);
}
.trivia-opt.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* ── Encadenados ────────────────────────────────────────────────── */
.encadenados-wrapper {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .5rem; height: 100%; overflow: hidden;
}
.enc-status {
  text-align: center; font-weight: 600; font-size: .9rem;
  color: var(--text-primary); padding: .5rem; background: var(--bg-secondary);
  border-radius: 10px;
}
.enc-players {
  display: flex; flex-wrap: wrap; gap: .4rem; padding: .3rem;
}
.enc-player {
  display: flex; align-items: center; gap: .3rem;
  background: var(--bg-secondary); border-radius: 8px; padding: .3rem .6rem;
  font-size: .8rem; border: 2px solid transparent; transition: all .2s;
}
.enc-player.enc-active { border-color: var(--accent); }
.enc-player.enc-dead { opacity: .4; filter: grayscale(1); }
.enc-player-name { color: var(--text-primary); font-weight: 500; }
.enc-lives { font-size: .75rem; }
.enc-chain {
  flex: 1; overflow-y: auto; background: var(--bg-secondary);
  border-radius: 10px; padding: .5rem; display: flex; flex-direction: column; gap: .25rem;
}
.enc-word {
  display: flex; align-items: center; gap: .35rem;
  padding: .25rem .5rem; border-radius: 6px; font-size: .85rem;
}
.enc-word.enc-valid { background: color-mix(in srgb, #22c55e 15%, transparent); }
.enc-word.enc-invalid { background: color-mix(in srgb, #ef4444 15%, transparent); }
.enc-word.enc-timeout { background: color-mix(in srgb, #f59e0b 15%, transparent); }
.enc-word-who { color: var(--text-muted); font-size: .78rem; }
.enc-word-val { font-weight: 600; color: var(--text-primary); }
.enc-word-reason { font-size: .72rem; color: var(--text-muted); font-style: italic; }
.enc-timer-row {
  padding: 0 .25rem;
}
.enc-input-row {
  display: flex; gap: .4rem; align-items: center;
}
.enc-input {
  flex: 1; background: var(--bg-secondary); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .5rem .75rem; color: var(--text-primary);
  font-size: .95rem; outline: none;
}
.enc-input:focus { border-color: var(--accent); }
.enc-send-btn { padding: .5rem 1rem; border-radius: 8px; }
.enc-hint { text-align: center; font-size: .78rem; color: var(--text-muted); }

/* ── Verdad o Reto ────────────────────────────────────────────────── */
.vr-wrapper { display: flex; flex-direction: column; gap: .7rem; padding: .5rem 0; }
.vr-status { text-align: center; font-size: .82rem; color: var(--text-muted); }
.vr-players { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.vr-player { padding: .25rem .6rem; border-radius: 999px; background: var(--bg-secondary); font-size: .8rem; }
.vr-player.vr-active { background: var(--accent); color: #fff; font-weight: 600; }
.vr-card { background: var(--bg-secondary); border-radius: 14px; padding: 1.2rem 1rem; text-align: center; }
.vr-choice-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .5rem; }
.vr-label-verdad { color: #3b82f6; }
.vr-label-reto { color: #f43f5e; }
.vr-text { font-size: 1.05rem; font-weight: 500; line-height: 1.5; margin-bottom: .8rem; }
.vr-next-btn { width: 100%; }
.vr-choice-btns { display: flex; gap: .8rem; justify-content: center; }
.vr-choice-btns button { flex: 1; padding: .8rem; border-radius: 12px; border: none; font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.vr-btn-verdad { background: #3b82f6; color: #fff; }
.vr-btn-reto { background: #f43f5e; color: #fff; }
.vr-choice-btns button:hover { opacity: .85; }
.vr-waiting { text-align: center; font-size: .88rem; color: var(--text-muted); padding: .6rem 0; }

/* ── ¿Quién es más probable? ─────────────────────────────────────── */
.mp-wrapper { display: flex; flex-direction: column; gap: .7rem; padding: .5rem 0; }
.mp-status { text-align: center; font-size: .82rem; color: var(--text-muted); }
.mp-question { display: flex; flex-direction: column; gap: .6rem; }
.mp-q-text { font-size: 1.05rem; font-weight: 600; text-align: center; line-height: 1.45; }
.mp-q-num { text-align: center; font-size: .75rem; color: var(--text-muted); }
.mp-vote-list { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.mp-vote-btn { padding: .45rem .9rem; border-radius: 999px; background: var(--bg-secondary); border: 1.5px solid var(--border); font-size: .88rem; cursor: pointer; color: var(--text-primary); transition: background .15s, border-color .15s; }
.mp-vote-btn:hover { border-color: var(--accent); }
.mp-vote-btn.mp-voted-selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.mp-voted-count { text-align: center; font-size: .78rem; color: var(--text-muted); }
.mp-result { display: flex; flex-direction: column; gap: .5rem; }
.mp-result-winner { text-align: center; font-size: 1rem; padding: .8rem; background: var(--bg-secondary); border-radius: 12px; }
.mp-count-row { display: flex; justify-content: space-between; padding: .2rem .3rem; font-size: .85rem; }
.mp-count-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .78rem; }
.mp-tally { display: flex; flex-direction: column; gap: .3rem; }
.mp-tally-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.mp-tally-row { display: flex; justify-content: space-between; padding: .2rem .3rem; font-size: .88rem; }
.mp-tally-pts { font-weight: 700; color: var(--accent); }

/* ── Dibujar y Adivinar ─────────────────────────────────────────── */
.dibujar-wrapper { display: flex; flex-direction: column; gap: .6rem; padding: .4rem 0; }
.dib-status { text-align: center; font-size: .82rem; color: var(--text-muted); }
.dib-word-area { text-align: center; font-size: .95rem; font-weight: 600; min-height: 1.4em; }
.dib-canvas-area { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.dib-canvas { border: 2px solid var(--border); border-radius: 10px; background: #fff; max-width: 100%; cursor: crosshair; touch-action: none; }
.dib-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center; font-size: .82rem; }
.dib-tool-label { display: flex; align-items: center; gap: .3rem; color: var(--text-secondary); }
.dib-color-input { width: 32px; height: 26px; padding: 0; border: none; background: none; cursor: pointer; }
.dib-size-input { width: 70px; }
.dib-clear-btn { padding: .3rem .6rem; font-size: .8rem; }
.dib-guess-area { display: flex; }
.dib-guess-input { flex: 1; background: var(--bg-secondary); border: 1.5px solid var(--border); border-radius: 8px; padding: .5rem .75rem; color: var(--text-primary); font-size: .95rem; outline: none; }
.dib-guess-input:focus { border-color: var(--accent); }
.dib-guess-input.dib-wrong { border-color: #f43f5e; animation: dib-shake .25s; }
@keyframes dib-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.dib-score { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; font-size: .82rem; }
.dib-player-score { padding: .2rem .5rem; background: var(--bg-secondary); border-radius: 8px; }
.dib-score-title { width: 100%; text-align: center; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.dib-score-row { display: flex; justify-content: space-between; padding: .2rem .3rem; font-size: .88rem; }
.dib-score-pts { font-weight: 700; color: var(--accent); }

/* ── Custom audio player ──────────────────────────────────────────── */
.audio-player { display: flex; align-items: center; gap: .55rem; min-width: 180px; max-width: 240px; padding: .3rem 0; }
.ap-play-btn {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1rem; display: flex;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.25); color: inherit;
  transition: background .15s, transform .1s;
}
.msg.mine .ap-play-btn { background: rgba(255,255,255,.28); color: #fff; }
.ap-play-btn:hover { background: rgba(255,255,255,.38); transform: scale(1.08); }
.ap-play-btn:active { transform: scale(.95); }
.ap-track { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.ap-progress {
  height: 4px; border-radius: 2px; background: rgba(128,128,128,.3);
  cursor: pointer; position: relative; overflow: hidden;
}
.ap-fill { height: 100%; border-radius: 2px; background: currentColor; opacity: .75; transition: width .1s linear; }
.msg.mine .ap-fill { background: #fff; opacity: .85; }
.ap-times { display: flex; justify-content: space-between; font-size: .7rem; opacity: .7; }
