/* Markets of War — voice chat (.vc-). Brass-and-leather controls matching the war-room chrome; tokens from base.css. */
:root { --vc-talk: #9cc46a; --vc-talk-glow: rgba(156,196,106,.65); --vc-off: #c9796f; }

.vc { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.vc-sinks { display: none; }
.vc-ico { flex: none; display: block; }

/* join button */
.vc-join { position: relative; color: var(--parchment); gap: .4em; }
.vc-join .vc-ico { color: var(--brass-hi); }
.vc-join:disabled .vc-ico { color: inherit; }
.vc-count {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; font-size: .7rem; font-weight: 600; line-height: 1;
  color: var(--ink); background: var(--vc-talk); border: 1px solid rgba(0,0,0,.45); box-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* joined: round brass-rimmed buttons */
.vc-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  color: var(--parchment-hi); border-radius: 50%; border: 1px solid var(--brass);
  background: radial-gradient(circle at 50% 35%, #5a4631, #2e2117 75%);
  box-shadow: inset 0 1px 0 rgba(255,235,190,.25), 0 2px 5px rgba(0,0,0,.5);
  transition: transform .12s var(--ease), box-shadow .15s, filter .12s;
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
.vc-btn:hover { filter: brightness(1.15); }
.vc-btn:active { transform: translateY(1px); }
.vc-btn.is-off { color: var(--vc-off); border-color: rgba(201,121,111,.8); background: radial-gradient(circle at 50% 35%, #5a2a24, #2a1310 75%); }
.vc-btn.is-speaking { border-color: var(--vc-talk); box-shadow: 0 0 0 2px var(--vc-talk), 0 0 14px var(--vc-talk-glow), inset 0 1px 0 rgba(255,235,190,.25); }
.vc-more.is-open { border-color: var(--brass-hi); box-shadow: 0 0 0 2px rgba(220,193,138,.45), 0 2px 5px rgba(0,0,0,.5); }
.vc-more .vc-count { top: -5px; right: -5px; }
.vc-ptt { width: auto; min-width: 56px; padding: 0 12px; border-radius: 20px; font: 600 .8rem var(--font-caps); letter-spacing: .08em; user-select: none; -webkit-user-select: none; }
.vc-ptt.is-held { color: var(--ink); background: radial-gradient(circle at 50% 35%, #cfe6a8, var(--vc-talk) 80%); border-color: #e8f3d0; box-shadow: 0 0 14px var(--vc-talk-glow); }

/* error line */
.vc-err {
  position: absolute; z-index: calc(var(--z-modal) + 1); top: calc(100% + 8px); right: 0; width: min(300px, calc(100vw - 24px));
  display: flex; gap: 6px; align-items: flex-start; padding: 8px 6px 8px 12px; font-size: .9rem; line-height: 1.3;
  color: var(--parchment-hi); background: linear-gradient(180deg, rgba(123,45,38,.97), rgba(84,28,24,.98)); border: 1px solid #c9796f;
  border-radius: var(--radius); box-shadow: var(--shadow-lift); animation: rise-in .2s var(--ease) both;
}
.vc-err__x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: .8; }
.vc-err__x:hover { opacity: 1; background: rgba(0,0,0,.2); }

/* options popover (parchment) */
.vc-pop {
  position: absolute; z-index: calc(var(--z-modal) + 1); top: calc(100% + 10px); right: 0; width: min(330px, calc(100vw - 24px));
  padding: 14px 16px; font-size: 1rem; text-align: left; animation: rise-in .18s var(--ease) both;
}
.vc-pop__title { font-size: 1.05rem; color: var(--oxblood); margin: 0 0 8px; }
.vc-pop__hint { margin: 6px 0 0; font-size: .86rem; color: var(--ink-soft); }
.vc-pop__hint kbd { font: 600 .75rem var(--font-num); padding: 0 .4em; border: 1px solid var(--brass-lo); border-radius: 3px; background: rgba(255,250,235,.6); }
.vc-pop__note { margin: 10px 0; font-size: .84rem; font-style: italic; color: var(--ink-faint); line-height: 1.3; }
.vc-seg { display: flex; margin: 0; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--brass-lo); }
.vc-seg__opt { flex: 1; position: relative; display: grid; place-items: center; min-height: 36px; padding: 0 8px; cursor: pointer; font: .9rem var(--font-caps); letter-spacing: .05em; color: var(--ink-soft); background: rgba(255,250,235,.45); }
.vc-seg__opt + .vc-seg__opt { border-left: 1px solid var(--brass-lo); }
.vc-seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.vc-seg__opt.is-on { color: var(--parchment-hi); background: linear-gradient(180deg, #5a4631, #3a2b1e); }
.vc-seg__opt:has(input:focus-visible) { outline: 2px solid var(--brass); outline-offset: -2px; }
.vc-peers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.vc-peers__empty { font-size: .9rem; font-style: italic; color: var(--ink-faint); }
.vc-peer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name st" "vol vol"; gap: 0 8px; padding: 6px 8px; border-radius: 6px; background: rgba(255,250,235,.45); border: 1px solid rgba(122,95,53,.35); }
.vc-peer.is-speaking { border-color: #6f9a3e; box-shadow: 0 0 0 1px rgba(111,154,62,.5); }
.vc-peer__name { grid-area: name; font-family: var(--font-display); font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-peer__name small { font-family: var(--font-body); font-weight: 400; color: var(--ink-faint); }
.vc-peer__st { grid-area: st; font-size: .8rem; color: #4f7330; align-self: center; }
.vc-peer__st.is-wait { color: var(--ink-faint); font-style: italic; }
.vc-peer__vol { grid-area: vol; display: block; }
.vc-peer__vol input { width: 100%; accent-color: var(--oxblood); }
.vc-hang { width: 100%; }

/* lobby header */
.lobby__voice { display: flex; }
.vc--bar .vc-join { min-height: 32px; }
.vc--bar .vc-btn { width: 34px; height: 34px; }
.vc--bar .vc-ptt { height: 34px; }

/* game screen: column beside the panel rail (desktop) or a row under the top bar (phones) */
.vc-dock { position: absolute; z-index: calc(var(--z-panel) + 2); pointer-events: none; }
.vc-dock > * { pointer-events: auto; }
.vc-dock[hidden] { display: none; }
.vc-dock--side { right: 8px; }
.vc-dock--phone { left: 6px; }
.vc--side { flex-direction: column; padding: 6px; border-radius: 26px; background: linear-gradient(180deg, rgba(51,35,26,.92), rgba(28,19,13,.94)); border: 1px solid rgba(176,141,87,.55); box-shadow: -3px 3px 8px rgba(0,0,0,.45); }
.vc--side .vc-join { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.vc--side .vc-join__label { display: none; }
.vc--side .vc-ptt { width: 40px; min-width: 0; padding: 0; font-size: .66rem; letter-spacing: .02em; }
.vc--side .vc-pop, .vc--side .vc-err { top: 0; right: calc(100% + 12px); }
.vc--phone { padding: 3px; border-radius: 24px; background: rgba(28,19,13,.82); border: 1px solid rgba(176,141,87,.5); box-shadow: 0 3px 6px rgba(0,0,0,.45); }
.vc--phone .vc-join { min-height: 38px; padding: 0 .7em; border-radius: 20px; font-size: .8rem; }
.vc--phone .vc-btn { width: 38px; height: 38px; }
.vc--phone .vc-ptt { height: 38px; }
.vc--phone .vc-pop, .vc--phone .vc-err { left: 0; right: auto; }

/* badges on portraits: lobby seats */
.vc-badge {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--parchment-hi); background: #2e2117; border: 2px solid var(--parchment-hi); box-shadow: 0 1px 4px rgba(0,0,0,.5);
  transition: box-shadow .15s, background .15s;
}
.vc-badge.is-muted { color: #f3c2b9; background: var(--oxblood); }
.vc-badge.is-speaking { color: var(--ink); background: var(--vc-talk); box-shadow: 0 0 0 2px rgba(156,196,106,.5), 0 0 10px var(--vc-talk-glow); }
.seat__voice { left: -4px; bottom: -4px; }
.seat.is-speaking .seat__portrait, .seat.is-speaking .seat__initial { box-shadow: 0 0 0 3px var(--vc-talk), 0 0 18px var(--vc-talk-glow); animation: vc-pulse 1.1s ease-in-out infinite; }

/* game player strip (.g-ptab[data-vc] is set by voicechat.js) */
.g-ptab[data-vc] .g-ptab-medal::after {
  content: ""; position: absolute; z-index: 2; left: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--parchment-hi); box-shadow: 0 1px 3px rgba(0,0,0,.6);
  background: #2e2117 center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4e9cd' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/%3E%3C/svg%3E");
}
.g-ptab[data-vc~="muted"] .g-ptab-medal::after {
  background-color: var(--oxblood);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4e9cd' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16'/%3E%3C/svg%3E");
}
.g-ptab[data-vc~="speaking"] .g-ptab-medal::after { background-color: #5d8a2f; }
.g-ptab[data-vc~="speaking"] .g-medal { box-shadow: 0 0 0 2px var(--vc-talk), 0 0 14px var(--vc-talk-glow); animation: vc-pulse 1.1s ease-in-out infinite; }

@keyframes vc-pulse { 50% { filter: brightness(1.12); box-shadow: 0 0 0 3px var(--vc-talk), 0 0 22px var(--vc-talk-glow); } }
@media (prefers-reduced-motion: reduce) { .seat.is-speaking .seat__portrait, .seat.is-speaking .seat__initial, .g-ptab[data-vc~="speaking"] .g-medal { animation: none; } }
@media (max-width: 600px) {
  .lobby__bar:has(.lobby__voice) .lobby__lamp { width: auto; flex: 1 1 auto; }
  .lobby__voice { order: 3; }
}
