/* RivalPot social: in-match chat, voice, share clips. Small controls that open on tap. */

/* the status line gets a chat button on the left and the mic on the right */
.status-row { display: flex; align-items: center; gap: 6px; padding: 2px 10px; flex-shrink: 0; }
.status-row .status { flex: 1; min-width: 0; }
.status-row .slot { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sc-btn { position: relative; width: 34px; height: 34px; border-radius: 11px; background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.sc-btn:active { transform: scale(.94); }
.chat-btn .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #06120D; }
.mic-btn .lvl { position: absolute; inset: -1px; border-radius: 11px; border: 2px solid var(--green); opacity: 0; transition: transform .1s linear, opacity .15s; pointer-events: none; }
.mic-btn.on { color: var(--green); border-color: #1E5A44; background: #0C2A20; }
.mic-btn.live .lvl { opacity: .9; }
.mic-btn.ptt.on:not(.live) { color: var(--muted); }
.mic-btn .ptt-tag { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 800; letter-spacing: .5px; background: var(--card3); color: var(--muted); border-radius: 4px; padding: 1px 3px; }

/* speaking: a green ring on the avatar */
.hud .pl.talking .av { outline: 2px solid var(--green); outline-offset: 2px; animation: rp-talk 0.9s ease-in-out infinite; }
@keyframes rp-talk { 50% { outline-offset: 4px; } }

/* bubbles under the speaker's name */
.chat-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.cb { position: absolute; max-width: 62%; background: #F4F1E8; color: #0B1122; font-size: 13px; font-weight: 600; line-height: 1.3; padding: 8px 12px; border-radius: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.35); animation: rp-bubble 4.2s ease forwards; overflow-wrap: anywhere; }
.cb.me { border-top-left-radius: 4px; }
.cb.them { border-top-right-radius: 4px; background: #E9E1FF; }
.cb.emote { background: transparent; box-shadow: none; padding: 0; }
.cb.emote svg { filter: drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
@keyframes rp-bubble { 0% { opacity: 0; transform: translateY(-6px) scale(.96); } 6% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }

/* the chat panel: over the shot controls, the table stays in view */
.chat-back { position: absolute; inset: 0; z-index: 25; display: flex; align-items: flex-end; }
.chat-panel { width: 100%; background: var(--bar); border-top: 1px solid var(--line2); border-radius: 20px 20px 0 0; padding: 12px 14px calc(14px + var(--safe-bottom)); box-shadow: 0 -12px 30px rgba(0,0,0,.45); }
.cp-head { display: flex; align-items: center; justify-content: space-between; }
.cp-head b { font-family: Sora, sans-serif; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-x { width: 32px; height: 32px; border-radius: 10px; background: var(--card); color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-log { max-height: 92px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.cp-log div { align-self: flex-end; background: #1B2440; padding: 5px 10px; border-radius: 10px; font-size: 13px; max-width: 80%; overflow-wrap: anywhere; display: flex; align-items: center; }
.cp-log div.mine { align-self: flex-start; background: #2A2208; color: var(--gold-soft); }
.cp-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.cp-quick button { height: 38px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.cp-quick button:active, .cp-emotes button:active { background: var(--card3); }
.cp-emotes { display: flex; justify-content: space-between; margin-top: 8px; }
.cp-emotes button { width: 44px; height: 40px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; }
.cp-type { display: flex; gap: 8px; margin-top: 10px; }
.cp-type input { flex: 1; min-width: 0; height: 42px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line2); color: var(--text); padding: 0 12px; font: 500 15px Inter, sans-serif; }
.cp-type input:focus { outline: none; border-color: var(--gold); }
.cp-type button { width: 46px; height: 42px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-tools { display: flex; gap: 6px; margin-top: 10px; }
.cp-tools button { flex: 1; height: 32px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; padding: 0 4px; }
.cp-tools button[aria-pressed="true"] { color: var(--gold); border-color: #5A4A1E; }
.cp-tools button.bad { color: #FF8A80; border-color: #4A2430; }
.cp-tools button:disabled { opacity: .5; }
.cp-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 10px 0; }
.cp-list { display: flex; flex-direction: column; gap: 6px; }
.cp-list button { height: 42px; border-radius: 12px; background: var(--card); text-align: left; padding: 0 14px; font-size: 14px; font-weight: 600; }
.cp-danger { width: 100%; height: 46px; border-radius: 12px; background: #3A1A20; color: #FF8A80; font-weight: 700; font-size: 14px; }
.cp-cancel { width: 100%; height: 42px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line2); font-size: 14px; font-weight: 600; }

/* result screen: one button for the clip */
.clip-btn { width: 100%; margin-top: 12px; display: flex; align-items: center; gap: 12px; background: var(--card2); border: 1px solid var(--line2); border-radius: 16px; padding: 12px 14px; text-align: left; color: var(--gold); }
.clip-btn span { display: flex; flex-direction: column; min-width: 0; }
.clip-btn b { font-size: 14px; color: var(--text); }
.clip-btn small { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-sheet { max-height: 100%; overflow-y: auto; }
.clip-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.clip-top p { margin: 4px 0 0; font-size: 13px; }
.clip-stage { margin: 12px auto 0; width: min(46vh, 220px); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line2); }
.clip-stage canvas, .clip-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.clip-bar { height: 4px; background: var(--line3); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.clip-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s linear; }
.clip-note { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 12px; }
.rp-voice { display: none; }

@media (min-width: 900px) {
  .match .status-row { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 2px 0; }
  .sc-btn { width: 40px; height: 40px; border-radius: 12px; }
  .status-row .slot { width: 40px; height: 40px; }
  .chat-back { justify-content: flex-end; align-items: flex-end; padding: 0 24px 24px; }
  .chat-panel { width: 380px; border-radius: 20px; border: 1px solid var(--line2); padding-bottom: 14px; }
  .cb { max-width: 340px; font-size: 14px; }
  .clip-stage { width: 240px; }
}
@media (prefers-reduced-motion: reduce) { .hud .pl.talking .av { animation: none; } }
