/* Chat, nút mic, bảng âm thanh, sảnh phòng ngẫu nhiên — dùng chung cho các game (trang nào cũng nạp sau style.css của game) */
/* ---------- Chat + video call ---------- */
#social[hidden], #social [hidden] { display: none !important; }
.soc-dock { position: fixed; right: 8px; bottom: var(--dock-b, 16px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 15; }
.soc-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--panel); color: var(--ink); font-size: 20px; box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.soc-btn.off { background: var(--panel-2); opacity: .8; }
.soc-btn.end { background: var(--danger); transform: rotate(135deg); }
.soc-btn.ring { animation: socRing 1.2s ease-in-out infinite; background: var(--sun); }
@keyframes socRing { 50% { transform: scale(1.12); } }
.soc-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font-body); font-style: normal; }
.soc-tiles { position: fixed; left: 8px; top: calc(136px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 6px; z-index: 15; }
.soc-tile { position: relative; width: 74px; height: 98px; border-radius: 12px; overflow: hidden; background: #0b252c; border: 2px solid var(--c); box-shadow: var(--shadow); cursor: pointer; }
.soc-tile.docked { position: fixed; border-radius: 50%; border-width: 2px; box-shadow: 0 0 0 2px var(--panel); }
.soc-tile.docked .soc-name { display: none; }
.soc-tile.docked .soc-av { font-size: 15px; }
.soc-tile.docked .soc-mute { top: auto; bottom: -2px; right: -2px; font-size: 10px; }
.soc-tile.big { position: fixed !important; left: 50% !important; top: 42% !important; width: min(78vw, 340px) !important; height: min(104vw, 450px) !important; transform: translate(-50%, -50%); border-radius: 18px !important; z-index: 35; border-width: 3px; }
.soc-tile.big .soc-name { display: block; font-size: 14px; padding: 6px 10px; }
.soc-tile.big .soc-av { font-size: 64px; }
.soc-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.soc-tile video.me { transform: scaleX(-1); }
.soc-av { position: absolute; inset: 0; display: none; place-items: center; font: 800 30px/1 var(--font-display); color: #fff; background: var(--c); }
.soc-tile.nocam .soc-av { display: grid; }
.soc-tile.nocam video { visibility: hidden; }
.soc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-mute { position: absolute; top: 3px; right: 4px; font-size: 13px; }
.soc-bubble { position: fixed; right: 8px; bottom: calc(var(--dock-b, 16px) + 50px); max-width: min(64vw, 280px); background: var(--panel); color: var(--ink); padding: 8px 12px; border-radius: 14px 14px 4px 14px; box-shadow: var(--shadow); font-size: 14px; z-index: 16; cursor: pointer; }
.soc-chat { position: fixed; right: 8px; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-width: 380px; margin-left: auto; height: min(60vh, 460px); background: var(--panel); color: var(--ink); border-radius: 18px; box-shadow: var(--shadow); z-index: 30; display: flex; flex-direction: column; overflow: hidden; }
.soc-chat header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font: 700 17px var(--font-display); }
.soc-x { border: 0; background: none; color: var(--ink-soft); font-size: 18px; width: 36px; height: 36px; cursor: pointer; }
.soc-msgs { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.soc-msgs li { align-self: flex-start; max-width: 82%; background: var(--panel-2); padding: 6px 10px; border-radius: 12px 12px 12px 4px; font-size: 14px; overflow-wrap: anywhere; }
.soc-msgs li.mine { align-self: flex-end; background: var(--sun); color: var(--sun-ink); border-radius: 12px 12px 4px 12px; }
.soc-msgs b { display: block; font-size: 12px; }
.soc-msgs time { display: block; font-size: 10px; opacity: .6; text-align: right; }
.soc-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; border-top: 1px solid var(--line); }
.soc-quick button { flex: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 5px 10px; font: 500 13px var(--font-body); cursor: pointer; }
.soc-form { display: flex; gap: 6px; padding: 8px 10px 10px; }
.soc-form input { flex: 1; min-width: 0; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 0 14px; font: 15px var(--font-body); }
.soc-form button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--sun); color: var(--sun-ink); font-size: 16px; cursor: pointer; }
.bigtog { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; border: 2px solid var(--line); }
.bigtog input { width: 22px; height: 22px; accent-color: var(--sun); flex: none; }
.bigtog span { display: flex; flex-direction: column; }
.bigtog small { color: var(--ink-soft); font-size: 12px; }
.btn.gear { align-self: center; }
.status .timer.low { color: var(--danger); animation: socRing 1s ease-in-out infinite; }
/* ---------- bảng cài đặt âm thanh ---------- */
.set-scrim { position: fixed; inset: 0; background: rgba(5,25,30,.5); z-index: 45; display: flex; align-items: center; justify-content: center; padding: 16px; }
.set-scrim[hidden] { display: none; }
.set-box { background: var(--panel); color: var(--ink); width: 100%; max-width: 400px; border-radius: 20px; padding: 6px 16px 16px; box-shadow: var(--shadow); }
.set-box header { display: flex; align-items: center; justify-content: space-between; font: 700 22px var(--font-display); padding: 6px 0; }
.set-x { border: 0; background: none; color: var(--ink-soft); font-size: 20px; width: 40px; height: 40px; cursor: pointer; }
.set-row { display: grid; grid-template-columns: 28px 1fr 2fr 34px; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.set-row.tog { grid-template-columns: 28px 1fr auto; }
.set-row.tog input { width: 22px; height: 22px; accent-color: var(--sun); }
.set-ic { font-size: 18px; text-align: center; }
.set-row input[type=range] { width: 100%; accent-color: var(--sun); }
.set-row output { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.set-test { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.set-note { color: var(--ink-soft); font-size: 12px; margin: 10px 0 0; }
@media (max-width: 360px) { .set-row { grid-template-columns: 24px 1fr 34px; } .set-row .set-n { grid-column: 2 / 4; } .set-row input[type=range] { grid-column: 1 / 3; } }

.soc-btn.ctl.open { background: var(--sun); color: var(--sun-ink); font-size: 18px; }
.soc-btn.ctl .soc-badge { font-size: 9px; background: var(--panel-2); }

/* ---------- thông báo bản mới ---------- */
.upd { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--panel); padding: 8px 8px 8px 16px; border-radius: 999px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; max-width: calc(100vw - 32px); }

/* ---------- hàng nút nổi + giữ để nói ---------- */
.soc-row { display: flex; gap: 6px; }
.soc-btn.ptt { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.soc-btn.ptt.rec { background: var(--danger); transform: scale(1.18); box-shadow: 0 0 0 6px rgba(200,50,59,.25); }
.soc-rec { position: fixed; right: 8px; bottom: calc(var(--dock-b, 16px) + 52px); background: var(--danger); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 16; box-shadow: var(--shadow); max-width: calc(100vw - 16px); }
.soc-vplay { border: 0; background: rgba(0,0,0,.08); color: inherit; border-radius: 999px; padding: 4px 12px; font: 600 14px var(--font-body); cursor: pointer; }
.talking { box-shadow: 0 0 0 3px var(--sun), 0 0 14px var(--sun) !important; animation: socRing .9s ease-in-out infinite; }
.lobby { padding-bottom: 76px; }

.autostart{text-align:center;margin:6px 0;padding:8px 10px;border-radius:12px;background:rgba(255,200,80,.18);font-weight:700}
.autostart b{font-size:1.2em}
