/* Comm Link browser phone (owner, 2026-10-28). Uses forum.css tokens and the glass block.
   No inline style anywhere (site CSP: style-src 'self'); state is carried by classes and
   data-state on #wp-root. The phone pixels are the in-game Comm Link button states. */

.f-col-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wp {
  --wp-teal: #3fe0c8;
  --wp-gold: #ffc21a;
  padding: 0 0 12px;
}
.wp-cta {
  margin: 0;
  padding: 12px 16px 14px;
}
.wp-boot {
  margin: 0;
  padding: 12px 16px 4px;
}

/* head: phone button + status line + minimize */
.wp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 6px;
}
.wp-phone {
  position: relative;
  flex: none;
  width: 54px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.55) url("web-phone-idle.png") center / 54px 42px no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
}
.wp-phone:hover,
.wp-phone:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.14), 0 0 18px -6px rgba(0, 255, 136, 0.6);
}
.wp[data-state="call"] .wp-phone,
.wp[data-state="dialing"] .wp-phone {
  background-image: url("web-phone-connected.png");
}
.wp[data-state="incoming"] .wp-phone {
  animation: wp-ring 0.5s steps(1, end) infinite;
}
.wp-star {
  position: absolute;
  right: -5px;
  top: -9px;
  color: var(--wp-gold);
  font-size: 18px;
  line-height: 1;
  animation: wp-star 1.6s ease-in-out infinite;
}
.wp-headtext {
  min-width: 0;
  flex: 1 1 auto;
}
.wp-title {
  margin: 0;
  color: var(--green-hot);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.wp-sub {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.wp-min {
  flex: none;
  align-self: flex-start;
  min-width: 26px;
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.5);
  color: var(--green-mid);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.wp-min:hover,
.wp-min:focus-visible {
  border-color: var(--green);
  color: #fff;
  outline: none;
}

/* body */
.wp-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 0;
}
.wp[data-min="1"] .wp-body {
  display: none;
}
.wp[data-min="1"] .wp-head {
  padding-bottom: 0;
}
.wp[data-min="1"] .wp-headtext {
  display: none;
}
.wp[data-min="1"] .wp-min {
  display: none;
}
.wp[data-min="1"] {
  padding-bottom: 12px;
}

.wp-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.wp-row > .f-input {
  flex: 1 1 auto;
  min-width: 0;
}
.wp-label {
  display: block;
  margin: 0 0 3px;
  color: var(--muted-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wp-note {
  margin: 0;
  padding: 7px 10px;
  border: 1px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.wp-note.is-warn {
  border-color: rgba(255, 201, 77, 0.5);
  color: var(--amber);
}
.wp-note.is-bad {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffb3b3;
}
.wp-select {
  width: 100%;
  appearance: none;
  padding: 6px 28px 6px 10px;
  background: rgba(0, 0, 0, 0.6)
    linear-gradient(45deg, transparent 50%, var(--green-mid) 50%) right 12px center / 5px 5px no-repeat;
  font-size: 12px;
}
.wp-select option {
  background: #02130b;
  color: var(--text);
}

/* incoming: caller card with the ring halo and the 15 s countdown */
.wp-ring {
  position: relative;
  padding: 10px 12px;
  border: 1px solid rgba(255, 194, 26, 0.6);
  background: rgba(0, 0, 0, 0.45);
  animation: wp-halo 1.1s ease-in-out infinite;
}
.wp-caller {
  margin: 0;
  color: var(--green-hot);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.wp-caller-sub {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.wp-count {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wp-secs {
  flex: none;
  min-width: 3.2em;
  color: var(--wp-gold);
  font-size: 12px;
  text-align: right;
}
progress.wp-bar,
progress.wp-meter {
  flex: 1 1 auto;
  height: 6px;
  min-width: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
progress.wp-bar::-webkit-progress-bar,
progress.wp-meter::-webkit-progress-bar {
  background: rgba(0, 0, 0, 0.6);
}
progress.wp-bar::-webkit-progress-value {
  background: var(--wp-gold);
}
progress.wp-bar::-moz-progress-bar {
  background: var(--wp-gold);
}
progress.wp-meter::-webkit-progress-value {
  background: var(--wp-teal);
}
progress.wp-meter::-moz-progress-bar {
  background: var(--wp-teal);
}
.wp-meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* roster */
.wp-ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green-mid);
  font-size: 12px;
}
.wp-ph b {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wp-roster {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.3);
}
.wp-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 10px;
  border-bottom: 1px dashed var(--line);
}
.wp-member:last-child {
  border-bottom: 0;
}
.wp-who {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.wp-member.is-me .wp-who {
  color: var(--green-hot);
}
.wp-tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.wp-tag.on {
  color: var(--wp-teal);
}
.wp-tag.ring {
  color: var(--wp-gold);
  animation: wp-blink 1.2s ease-in-out infinite;
}
.wp-tag.off {
  color: var(--muted-dim);
}
.wp-op {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid rgba(255, 194, 26, 0.55);
  color: var(--wp-gold);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* controls */
.wp-ctl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wp-ctl .f-btn {
  flex: 1 1 auto;
}
.f-btn[aria-pressed="true"].wp-mute {
  border-color: rgba(255, 201, 77, 0.6);
  background: linear-gradient(180deg, rgba(255, 201, 77, 0.2), rgba(255, 201, 77, 0.05));
  color: var(--amber);
}
.f-btn.wp-ptt-live {
  background: linear-gradient(168deg, rgba(63, 224, 200, 0.95), rgba(30, 170, 150, 0.9));
  border-color: transparent;
  color: #001a14;
}
.wp-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.wp-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@keyframes wp-halo {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 194, 26, 0.0), 0 0 6px rgba(255, 194, 26, 0.2);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 194, 26, 0.22), 0 0 22px rgba(255, 194, 26, 0.55);
  }
}
@keyframes wp-ring {
  0% {
    background-image: url("web-phone-ring-left.png");
  }
  50% {
    background-image: url("web-phone-ring-right.png");
  }
}
@keyframes wp-star {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.88);
    text-shadow: 0 0 2px #ffb300, 0 0 4px #c07800;
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
    text-shadow: 0 0 3px #fff1b0, 0 0 8px #ffc21a, 0 0 16px #ff9f00;
  }
}
@keyframes wp-blink {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .wp-body {
    padding: 4px 12px 0;
  }
  .wp-head {
    padding: 12px 12px 6px;
  }
  .wp-ctl .f-btn,
  .wp-row .f-btn {
    min-height: 40px;
  }
  .wp-min {
    min-height: 36px;
    min-width: 36px;
  }
  .wp .f-input {
    min-height: 40px;
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wp-ring,
  .wp-star,
  .wp-tag.ring,
  .wp[data-state="incoming"] .wp-phone {
    animation: none;
  }
  .wp-ring {
    box-shadow: 0 0 0 2px rgba(255, 194, 26, 0.35);
  }
  .wp[data-state="incoming"] .wp-phone {
    background-image: url("web-phone-ring-left.png");
  }
}

.wp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wp {
  position: relative;
}
div.wp-phone {
  cursor: default;
}
