/* Live voice, bottom controls, Do‘st (friends), dual-robot meeting, online tournament */

:root {
  --pink: #ff5aa3;
  --pink-soft: #ffb0d4;
  --glass: rgba(14, 8, 14, 0.82);
  --line: rgba(255, 150, 210, 0.28);
  --safe-b: max(18px, env(safe-area-inset-bottom, 0px));
}

/* ---------- Bottom-left ☰ menu ---------- */
.menu-btn {
  top: auto !important;
  left: 18px !important;
  bottom: max(18px, env(safe-area-inset-bottom)) !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  gap: 5px !important;
  z-index: 60 !important;
}
.menu-btn span { width: 20px !important; height: 2px !important; }
.menu-pop {
  top: auto !important;
  left: 18px !important;
  right: auto !important;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 58px) !important;
  width: auto !important;
  min-width: 148px !important;
  height: auto !important;
  z-index: 61 !important;
  padding: 6px !important;
  border-radius: 16px !important;
  background: rgba(12, 8, 14, 0.94) !important;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: stretch;
  justify-content: flex-start;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.menu-pop[hidden] { display: none !important; }
.menu-pop .menu-item {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-radius: 10px;
}
.mt-bet {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 8px 12px 12px; font-size: 0.9rem;
}
.mt-bet select, .mt-bet input {
  background: rgba(0,0,0,0.35); color: #fff; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 8px;
}

.menu-row { display: flex; gap: 6px; }
.menu-row .menu-item {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 10px;
  background: rgba(255, 90, 160, 0.10);
  border: 1px solid rgba(255, 150, 210, 0.18);
}
.menu-friends { color: #ffd0e6 !important; }
.menu-sub { padding: 0 0 6px !important; }

/* ---------- Bottom-right live mic ---------- */
html, body { touch-action: pan-y; }
.live-dock {
  position: fixed;
  right: 14px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  gap: 8px;
  align-items: center;
}
.live-mic {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 190, 225, 0.4);
  background: radial-gradient(circle at 35% 30%, #ffc6e1, #ff6fb0 55%, #d63f88);
  color: #2a0d1d;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 80, 170, 0.35);
  touch-action: none;
  transition: transform 0.15s ease;
}
.live-mic:active { transform: scale(0.94); }
.live-mic::before, .live-mic::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 110, 190, 0.0);
  pointer-events: none;
}
.live-mic.is-live { color: #fff; background: radial-gradient(circle at 35% 30%, #ff9fd0, #ff2f93 55%, #b81d6d); }
.live-mic.is-live::before { border-color: rgba(255, 120, 200, 0.9); animation: micRing 1.4s ease-out infinite; }
.live-mic.is-live::after { border-color: rgba(255, 120, 200, 0.6); animation: micRing 1.4s ease-out 0.7s infinite; }
.live-mic.is-hearing { box-shadow: 0 0 0 4px rgba(255, 120, 200, 0.45), 0 0 34px rgba(255, 60, 170, 0.8); }
.live-mic.is-busy { opacity: 0.85; }
.swipe-cue, .swipe-cue-right {
  position: absolute;
  left: auto;
  right: -2px;
  top: 50%;
  transform: translate(70%, -50%);
  width: 16px;
  height: 22px;
  border-radius: 0 8px 8px 0;
  background: rgba(18, 8, 14, 0.55);
  color: #ffe8f3;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  pointer-events: none;
  opacity: 0.7;
}
.live-chat-btn { color: #2a0d1d; }
body.is-chat-mode .fallback-bar { left: 70px; right: 14px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 62px); }
@keyframes micRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* Live transcript pill */
.live-pill {
  position: fixed;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 74px);
  transform: translateX(-50%);
  z-index: 58;
  max-width: min(84vw, 460px);
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(20, 10, 18, 0.9);
  border: 1px solid rgba(255, 140, 205, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 70, 170, 0.18);
  color: #fff3f9;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 9px;
  backdrop-filter: blur(14px);
  animation: pillIn 0.18s ease;
}
.live-pill[hidden] { display: none !important; }
.live-pill.is-final { border-color: rgba(255, 200, 230, 0.8); }
.live-pill #livePillText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4fa8; box-shadow: 0 0 10px #ff4fa8; flex-shrink: 0; animation: dotBlink 0.9s infinite alternate; }
@keyframes dotBlink { from { opacity: 1; } to { opacity: 0.35; } }
@keyframes pillIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Solo robot speech bubble */
.solo-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 86px);
  top: auto;
  transform: translateX(-50%);
  z-index: 8;
  width: min(92vw, 460px);
  max-width: min(92vw, 460px);
  max-height: min(46vh, 420px);
  padding: 10px 12px 12px;
  border-radius: 18px;
  background: rgba(18, 10, 16, 0.94);
  border: 1px solid rgba(255, 150, 210, 0.5);
  color: #fff8fb;
  font-size: 0.98rem;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 80, 180, 0.2);
  pointer-events: auto;
  animation: speechPop 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.solo-bubble[hidden] { display: none !important; }
.solo-bubble.is-fading { opacity: 0; transition: opacity 0.28s ease; }
.solo-latest { position: relative; padding-right: 22px; }
.solo-x { position: absolute; top: -4px; right: -4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 0.8rem; }
.solo-bubble { backdrop-filter: blur(16px); }
.solo-drawer {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(42vh, 400px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.solo-turn { padding-bottom: 4px; }
.solo-bubble .said { display: block; font-size: 0.78rem; color: #ffb9dc; margin-bottom: 4px; }
.solo-reply { white-space: pre-wrap; word-break: break-word; }
.yt-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 80, 80, 0.22), rgba(180, 20, 40, 0.28));
  border: 1px solid rgba(255, 180, 200, 0.45);
  color: #fff8fb !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.3;
}
.yt-card:active { transform: scale(0.98); }

/* Toasts */
.toasts {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top, 12px));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(22, 12, 20, 0.95);
  border: 1px solid var(--line);
  color: #fff4f9;
  font-size: 0.88rem;
  line-height: 1.35;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  animation: speechPop 0.25s ease;
}
.toast.err { border-color: rgba(255, 120, 120, 0.6); }
.toast.ok { border-color: rgba(140, 255, 190, 0.5); }

/* Fallback input */
.fallback-bar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 62px);
  z-index: 62;
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(18, 12, 16, 0.94);
  border: 1px solid rgba(255, 160, 210, 0.3);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.fallback-bar[hidden] { display: none !important; }
.fallback-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 0.95rem; padding: 0 10px; height: 40px; }
.fb-send, .fb-close, .fb-mic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1rem; }
.fb-mic { background: rgba(255,255,255,0.08); }
.fb-mic.is-on { background: rgba(255, 90, 160, 0.35); }
.fb-send { background: linear-gradient(180deg, #ffb0d4, #ff5aa3); color: #2a1020; }
.fb-close { background: transparent; color: #f0d6e4; }

/* ---------- Buttons ---------- */
.pink-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: linear-gradient(180deg, #ffb0d4, #ff5aa3);
  color: #2a1020;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 70, 160, 0.3);
  touch-action: manipulation;
}
.pink-btn:active { transform: scale(0.97); }
.pink-btn:disabled { opacity: 0.5; }
.pink-btn.small, .ghost-btn.small { padding: 7px 12px; font-size: 0.8rem; border-radius: 11px; }
.pink-btn.wide { width: 100%; }
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(30, 16, 26, 0.85);
  color: #ffe8f3;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
}
.ghost-btn:active { background: rgba(255, 90, 160, 0.22); }
.round-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 8, 12, 0.7);
  font-size: 1.25rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

/* ---------- Friends sheet ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  backdrop-filter: blur(6px);
}
.sheet-wrap[hidden] { display: none !important; }
.sheet {
  width: 100vw;
  height: 100dvh;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  background: linear-gradient(180deg, #1a0d17, #0b060a);
  border: 0;
  box-shadow: none;
}
.sheet-head { position: sticky; top: 0; z-index: 2; background: #1a0d17; padding-bottom: 8px; }
.chooser-grid { display: grid; gap: 8px; }
.chooser-grid .menu-item {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 12px;
  background: rgba(255, 90, 160, 0.12);
  border: 1px solid rgba(255, 150, 210, 0.18);
  border-radius: 14px;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-title { font-size: 1.15rem; font-weight: 800; color: #ffd6ea; letter-spacing: 0.02em; }
.sheet-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: #ffe8f3; cursor: pointer; }
.reg-form, .profile { display: flex; flex-direction: column; gap: 12px; }
.reg-form[hidden], .profile[hidden], .inline-form[hidden] { display: none !important; }
.reg-hint { color: #f3cfe2; font-size: 0.88rem; line-height: 1.4; }
.reg-form input, .inline-form input {
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(30, 16, 26, 0.9);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  padding: 0 14px;
  outline: none;
}
.reg-form input:focus, .inline-form input:focus { border-color: #ff8ec8; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
#inviteId { letter-spacing: 0.4em; font-size: 1.3rem; text-align: center; font-weight: 800; }
.profile-row { display: flex; align-items: center; gap: 10px; }
.me-name { flex: 1; font-size: 1.1rem; font-weight: 700; color: #fff; }
.id-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 90, 160, 0.10);
  border: 1px solid rgba(255, 150, 210, 0.3);
}
.id-label { color: #f3cfe2; font-size: 0.8rem; }
.me-id { flex: 1; font-size: 1.9rem; font-weight: 900; letter-spacing: 0.18em; color: #ffd0e8; text-shadow: 0 0 14px rgba(255, 80, 180, 0.6); font-variant-numeric: tabular-nums; }
.conn-state { font-size: 0.78rem; color: #cfb5c3; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #555; flex-shrink: 0; }
.dot.on { background: #46f08a; box-shadow: 0 0 8px #46f08a; }
.list-title { margin-top: 4px; font-size: 0.8rem; color: #d6b5c6; text-transform: uppercase; letter-spacing: 0.08em; }
.friends-list, .requests { display: flex; flex-direction: column; gap: 8px; }
.friend-item, .req-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(30, 16, 26, 0.75);
  border: 1px solid rgba(255, 150, 210, 0.16);
}
.friend-item .f-name { flex: 1; min-width: 0; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-item .f-id, .req-item .f-id { color: #e5a8c9; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.req-item .f-name { flex: 1; color: #fff; font-size: 0.88rem; }
.empty { color: #a88a9a; font-size: 0.85rem; padding: 6px 2px; }

/* ---------- Incoming popups (friend request / meeting invite) ---------- */
.popups {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top, 14px));
  transform: translateX(-50%);
  z-index: 95;
  width: min(94vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.popup {
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2a1023, #12080f);
  border: 1px solid rgba(255, 140, 205, 0.6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 70, 170, 0.3);
  animation: popIn 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes popIn { from { transform: translateY(-20px) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-text { color: #fff4fa; font-size: 0.98rem; line-height: 1.4; margin-bottom: 12px; }
.popup-text b { color: #ffc0e0; }
.popup-btns { display: flex; gap: 10px; }
.popup-btns button { flex: 1; }

/* ---------- Meeting ---------- */
body.in-meeting .menu-btn, body.in-meeting .menu-pop { display: none !important; }
.meeting {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.meeting[hidden] { display: none !important; }
.mt-top {
  position: relative;
  z-index: 12;
  flex-shrink: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 86px 4px 12px;
}
.mt-title { color: #ffd6ea; font-weight: 700; font-size: 0.95rem; }
.mt-exit { position: absolute; right: 10px; top: 8px; }
.scoreboard {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(30, 12, 26, 0.9);
  border: 1px solid rgba(255, 150, 210, 0.45);
  box-shadow: 0 0 18px rgba(255, 70, 170, 0.25);
  font-size: 0.78rem; color: #ffe6f2;
  max-width: 100%;
}
.scoreboard[hidden] { display: none !important; }
.scoreboard:not([hidden]) + .mt-title { display: none; }
.sb-name { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-score { font-size: 1.15rem; font-weight: 900; color: #fff; min-width: 1ch; text-align: center; font-variant-numeric: tabular-nums; }
.sb-score.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.6); color: #ff8ec8; } }
.sb-colon { color: #ff8ec8; font-weight: 900; }

.mt-robots {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.rig-slot { position: relative; flex: 1; min-height: 0; }
.rig-peer { border-bottom: 1px solid rgba(255, 120, 200, 0.12); }
.rig { position: absolute; inset: 0; }
.rig-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.rig-stage .robot { width: 50%; }
.rig-name {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 9;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 10, 18, 0.8);
  border: 1px solid rgba(255, 150, 210, 0.3);
  color: #ffe0ef;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  max-width: 60%;
}
.rig-name .dot { width: 8px; height: 8px; }
.rig-said {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 9;
  max-width: 62%;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(255, 90, 160, 0.25);
  border: 1px solid rgba(255, 170, 210, 0.35);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.3;
}
.rig-said[hidden], .rig-bubble[hidden] { display: none !important; }
.rig-bubble {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 9;
  max-width: 54%;
  padding: 8px 12px;
  border-radius: 16px;
  border-top-right-radius: 5px;
  background: rgba(18, 10, 16, 0.94);
  border: 1px solid rgba(255, 150, 210, 0.55);
  color: #fff8fb;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 80, 180, 0.18);
  animation: speechPop 0.3s ease;
}
.rig-me .rig-name { top: auto; bottom: 8px; left: auto; right: 12px; }
.rig-me .rig-said { left: auto; right: 12px; bottom: 40px; }
.rig-me .rig-bubble { top: 10px; right: auto; left: 10px; border-top-right-radius: 16px; border-top-left-radius: 5px; }

.mt-controls {
  position: relative;
  z-index: 12;
  flex-shrink: 0;
  height: calc(var(--safe-b) + 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6px 90px 0;
}
.mt-controls .round-btn { position: fixed; left: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60; }
.tour-btn { padding: 12px 18px; font-size: 0.95rem; }
.tour-btn[hidden] { display: none !important; }

/* Game mode inside meeting: robots become a compact top bar, game fills the middle */
.meeting.is-game .mt-robots { flex: 0 0 auto; height: min(21dvh, 170px); flex-direction: row; }
.meeting.is-game .rig-peer { border-bottom: 0; border-right: 1px solid rgba(255, 120, 200, 0.12); }
.meeting.is-game .rig-stage .robot { width: 58%; }
.meeting.is-game .rig-bubble { max-width: 70%; font-size: 0.72rem; padding: 6px 9px; top: auto; bottom: 30px; }
.meeting.is-game .rig-me .rig-bubble { left: 6px; }
.meeting.is-game .rig-said { display: none !important; }
.meeting.is-game .rig-name { font-size: 0.68rem; top: 4px; bottom: auto; }
.meeting.is-game .rig-me .rig-name { top: 4px; bottom: auto; right: 8px; }
.meeting.is-game .mt-controls { height: calc(var(--safe-b) + 58px); }
.mt-game {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 0;
}
.mt-game[hidden] { display: none !important; }
.mt-gamebar { width: min(94vw, 420px); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mt-round { color: #ff9ec8; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.mt-status { flex: 1; min-width: 0; color: #ffe8f3; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-mount { width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mt-banner {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(86vw, 360px);
  padding: 18px 16px;
  border-radius: 22px;
  text-align: center;
  background: rgba(22, 8, 20, 0.95);
  border: 1px solid rgba(255, 150, 210, 0.6);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 70, 170, 0.35);
  color: #fff;
  animation: popIn 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.mt-banner[hidden] { display: none !important; }
.mt-banner .big { font-size: 1.35rem; font-weight: 900; margin-bottom: 6px; color: #ffd0e8; }
.mt-banner .sub { font-size: 0.88rem; color: #f4d6e6; line-height: 1.4; }
.mt-banner .rps-reveal { display: flex; justify-content: space-around; font-size: 3rem; margin: 8px 0; }
.mt-banner .rps-reveal small { display: block; font-size: 0.7rem; color: #ffc2df; }

/* online RPS */
.orps { width: min(92vw, 380px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.orps-info { color: #ffe0ef; font-size: 0.9rem; text-align: center; min-height: 2.6em; }
.orps-count { font-size: 2.4rem; font-weight: 900; color: #ff8ec8; text-shadow: 0 0 18px rgba(255, 70, 170, 0.6); min-height: 1.2em; }
.orps-btns { display: flex; gap: 10px; width: 100%; }
.orps-btn { flex: 1; padding: 14px 4px; border-radius: 18px; border: 1px solid rgba(255, 160, 210, 0.35); background: rgba(24, 12, 18, 0.92); color: #fff8fb; font: inherit; font-size: 0.78rem; cursor: pointer; }
.orps-btn .e { display: block; font-size: 2.1rem; margin-bottom: 4px; }
.orps-btn.is-picked { background: rgba(255, 90, 160, 0.35); border-color: #ff8ec8; box-shadow: 0 0 18px rgba(255, 80, 180, 0.4); }
.orps-btn:disabled:not(.is-picked) { opacity: 0.4; }

/* online XO reuses .xo-grid/.xo-cell */
.oxo { width: min(80vw, 46dvh, 330px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.xo-cell.is-last { box-shadow: inset 0 0 0 2px rgba(255, 200, 230, 0.7); }

/* online tennis */
.otennis { position: relative; display: flex; justify-content: center; width: 100%; height: 100%; }
.otennis canvas { width: min(92vw, 380px); height: 100%; max-height: 100%; background: #0b1a12; border-radius: 14px; border: 1px solid rgba(180, 255, 200, 0.25); touch-action: none; display: block; }
.otennis .t-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #eafff1; font-weight: 800; font-size: 1.6rem; pointer-events: none; text-shadow: 0 0 14px rgba(80, 255, 160, 0.6); text-align: center; }

/* online shashka reuses 3D board styles */
.oshashka { width: min(94vw, 44dvh, 400px); }
.oshashka .board-stage { width: 100%; }
.sq.is-can::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 120, 200, 0.75); pointer-events: none; z-index: 1; }
.sq.is-lastfrom, .sq.is-lastto { box-shadow: inset 0 0 0 3px rgba(255, 200, 80, 0.65); }

/* Championship overlay */
.champ {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.champ[hidden] { display: none !important; }
.champ-card {
  position: relative;
  overflow: hidden;
  width: min(90vw, 380px);
  padding: 26px 18px 18px;
  border-radius: 26px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, #4a1438, #14070f 70%);
  border: 1px solid rgba(255, 200, 120, 0.6);
  box-shadow: 0 0 50px rgba(255, 90, 180, 0.45), 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: popIn 0.45s cubic-bezier(.2, 1.4, .4, 1);
}
.champ-cup { font-size: 4.2rem; filter: drop-shadow(0 0 20px rgba(255, 200, 80, 0.8)); animation: cup 1.6s ease-in-out infinite; }
@keyframes cup { 50% { transform: translateY(-6px) rotate(-4deg) scale(1.06); } }
.champ-text { margin: 10px 0 18px; color: #fff; font-size: 1.25rem; font-weight: 900; line-height: 1.35; }
.champ-btns { display: flex; flex-direction: column; gap: 8px; }
.champ-confetti { position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, #ff8ec8 2px, transparent 3px),
    radial-gradient(circle, #ffd36a 2px, transparent 3px),
    radial-gradient(circle, #9ef0ff 2px, transparent 3px);
  background-size: 60px 60px, 80px 80px, 70px 70px;
  background-position: 0 0, 20px 30px, 40px 10px;
  animation: confetti 3s linear infinite; opacity: 0.8; }
@keyframes confetti { to { background-position: 0 300px, 20px 360px, 40px 330px; } }

@media (orientation: landscape) and (max-height: 520px) {
  .meeting.is-game { flex-direction: column; }
  .meeting.is-game .mt-robots { height: 26dvh; }
  .oshashka { width: min(60dvh, 50vw, 360px); }
}

/* ===== RPS images (online + meeting) ===== */
.orps-count { display: flex; gap: 10px; justify-content: center; align-items: center; font-size: 2rem; }
.orps-count img { width: 58px; height: 58px; object-fit: contain; animation: orpsBob 1.4s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255, 90, 170, 0.5)); }
.orps-count img:nth-child(2) { animation-delay: 0.2s; }
.orps-count img:nth-child(3) { animation-delay: 0.4s; }
@keyframes orpsBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.orps-btn img.e { display: block; width: 56px; height: 56px; object-fit: contain; margin: 0 auto 4px; pointer-events: none; }
.mt-banner .rps-reveal { align-items: center; }
.rps-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 160, 210, 0.25); }
.rps-card img { width: 72px; height: 72px; object-fit: contain; animation: rpsPop 0.7s cubic-bezier(.2,1.6,.4,1); }
.rps-card.is-win { border-color: #ffd36a; box-shadow: 0 0 18px rgba(255, 210, 90, 0.55); background: rgba(255, 210, 90, 0.12); }
.rps-vs2 { font-size: 1rem; font-weight: 900; color: #ff8ec8; text-shadow: 0 0 10px rgba(255, 70, 170, 0.7); }

/* ===== Menu: second row ===== */
.menu-row + .menu-row { margin-top: 6px; }
.menu-row .menu-item.menu-music, .menu-row .menu-item.menu-gemini { font-size: 0.82rem; padding: 10px 6px; white-space: nowrap; }
.menu-gemini.is-on { box-shadow: inset 0 0 0 1px #ffd36a; color: #ffe9a8 !important; }

/* ===== Floating music bar ===== */
.music-bar {
  position: fixed; left: 50%; top: calc(max(10px, env(safe-area-inset-top, 10px)) + 4px); transform: translateX(-50%);
  z-index: 66; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px;
  border-radius: 999px; background: rgba(28, 10, 22, 0.88); border: 1px solid rgba(255, 140, 200, 0.45);
  box-shadow: 0 6px 24px rgba(255, 60, 160, 0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff3f9; font-weight: 700;
}
.music-bar[hidden] { display: none !important; }
.mb-ico { font-size: 1.1rem; animation: mbSpin 2.4s linear infinite; }
.music-bar.is-paused .mb-ico { animation: none; opacity: 0.6; }
@keyframes mbSpin { 0%, 100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(12deg) scale(1.15); } }
.mb-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 150, 210, 0.35); background: rgba(255, 90, 160, 0.16); color: #fff; font: inherit; font-size: 1rem; cursor: pointer; display: grid; place-items: center; touch-action: manipulation; }
.mb-btn:active { background: rgba(255, 90, 160, 0.4); }
.mb-x { background: rgba(255, 255, 255, 0.06); }
.mb-vol { min-width: 3.1em; text-align: center; font-variant-numeric: tabular-nums; color: #ffc2e0; }
body.music-on .toasts { top: calc(max(12px, env(safe-area-inset-top, 12px)) + 54px); }

/* ===== Gemini modal ===== */
.gem-hint { color: #ffd7ea; font-size: 0.86rem; line-height: 1.4; margin: 4px 0 12px; }
.gem-status { padding: 8px 12px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.gem-status.off { background: rgba(255, 255, 255, 0.07); color: #e6d4dd; }
.gem-status.on { background: rgba(80, 220, 140, 0.15); color: #a6f5c6; border: 1px solid rgba(80, 220, 140, 0.4); }
.gem-status.warn { background: rgba(255, 190, 60, 0.14); color: #ffd98a; border: 1px solid rgba(255, 190, 60, 0.4); }
.gem-form { display: flex; flex-direction: column; gap: 10px; }
.gem-form[hidden], .gem-link[hidden], #gemKeyLink[hidden] { display: none !important; }
.gem-row { display: flex; gap: 8px; }
.gem-row input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 160, 210, 0.35); background: rgba(0, 0, 0, 0.35); color: #fff; font: inherit; font-size: 0.95rem; }
.gem-row .pink-btn, .gem-row .ghost-btn:not(.small) { flex: 1; }
.gem-link { display: block; margin-top: 14px; color: #ff9fd0; font-size: 0.85rem; text-align: center; }
body.music-on .solo-bubble { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 140px); top: auto; }


/* In-app YouTube + image gallery */
.media-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 2, 8, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(10px);
}
.media-modal[hidden] { display: none !important; }
.media-card {
  width: min(96vw, 520px);
  background: rgba(18, 10, 16, 0.96);
  border: 1px solid rgba(255, 170, 210, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  overflow: hidden;
  color: #fff8fb;
}
.media-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.media-title { flex: 1; font-size: 0.88rem; font-weight: 700; line-height: 1.3; min-width: 0; }
.media-x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.yt-frame-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.yt-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-foot { display: flex; gap: 12px; padding: 10px 12px 12px; }
.media-ext { color: #ffd0e6; font-size: 0.8rem; text-decoration: none; font-weight: 700; }
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 12px; }
.img-thumb { border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: #12080e; cursor: pointer; aspect-ratio: 1; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-full { position: absolute; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.img-full[hidden] { display: none !important; }
.img-full img { max-width: 96%; max-height: 92%; object-fit: contain; border-radius: 8px; }
.img-full-x { position: absolute; top: 10px; right: 10px; }
.img-empty { grid-column: 1 / -1; text-align: center; color: #ffd0e6; }
.img-card-modal { position: relative; }


/* Timer pill, info cards, meeting emotes */
.timer-pill {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: rgba(16, 6, 12, 0.82);
  color: #ffe8f3;
  border: 1px solid rgba(255, 120, 180, 0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  font-weight: 700;
}
.timer-pill[hidden] { display: none !important; }
.tp-time { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.tp-lab { font-weight: 600; opacity: 0.85; font-size: 0.85rem; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 0.95rem; }

.info-card-pop {
  position: fixed;
  left: 50%;
  top: max(58px, env(safe-area-inset-top, 12px) + 46px);
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  z-index: 65;
  background: linear-gradient(180deg, rgba(36, 14, 28, 0.95), rgba(14, 6, 12, 0.95));
  color: #ffe8f3;
  border-radius: 18px;
  border: 1px solid rgba(255, 130, 190, 0.28);
  padding: 14px 16px 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.info-card-pop[hidden] { display: none !important; }
.info-card-pop h3 { margin: 4px 0 6px; }
.info-card-pop .ic-k { font-size: 0.78rem; letter-spacing: 0.04em; opacity: 0.75; text-transform: uppercase; }
.info-card-pop .ic-x { position: absolute; right: 8px; top: 8px; }
.ic-row, .pray-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.88rem; }
.pray-grid div { display: flex; justify-content: space-between; background: rgba(255,255,255,0.05); border-radius: 10px; padding: 6px 8px; }

.mt-emotes {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 10px 10px;
}
.mt-emotes button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.08);
  font-size: 1.15rem; cursor: pointer;
}
.mt-wins {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0.9;
  padding: 0 10px 4px;
}
.fly-emote {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%, 0);
  font-size: 2.4rem;
  animation: flyEmote 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}
@keyframes flyEmote {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}
.rig-slot { position: relative; }

.solo-replay {
  position: absolute; left: 8px; top: 8px;
  border: 0; background: transparent; color: inherit; font-size: 1.05rem; cursor: pointer;
}
