/* Extensions to the original menu; colors, typography, controls and animation
   come from index.html. No independent overlay or replacement HUD. */
#pg-main .vnav {
  top: 38rem;
}
#pg-main .nv:not(.primary) {
  height: 4.8rem;
}
#pg-online [hidden],
#pg-pause [hidden],
#pg-toy-ranks [hidden] {
  display: none !important;
}
.online-mode {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--f2);
  letter-spacing: 0.12em;
}
.online-layout {
  position: absolute;
  left: 9.6rem;
  right: 4.8rem;
  top: 17rem;
  bottom: 13rem;
  display: grid;
  grid-template-columns: 42rem minmax(0, 1fr);
  gap: 7rem;
}
/* Each desktop column remains reachable inside short Toy/browser windows. */
.online-commands,
.online-squad {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.online-commands .nv {
  width: 100%;
  margin-top: 0.8rem;
}
.online-field {
  grid-template-columns: 11rem 1fr;
  margin: 2.4rem 0 1.4rem;
  padding: 0 1.8rem;
}
.online-field span {
  font-size: var(--f2);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.12em;
}
.online-field input,
.online-field select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: var(--f3);
  letter-spacing: 0.08em;
}
.online-field input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.online-field select option {
  background: #171a1d;
  color: #fff;
}
.online-field :is(input, select):focus-visible {
  outline: 1px solid var(--or2);
  outline-offset: 3px;
}
.online-commands p,
.online-squad p {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--f2);
  line-height: 1.8;
  letter-spacing: 0.06em;
}
#online-status {
  margin-top: 2rem;
  overflow-wrap: anywhere;
}
#online-error {
  color: var(--en);
  margin-top: 1rem;
}
.online-squad {
  padding-top: 0.3rem;
  min-width: 0;
}
.online-squad h3 {
  font-size: 7.8rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.08em;
  margin: 2rem 0;
}
.online-hall-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 2rem;
}
.online-room-list {
  display: grid;
  gap: 1.2rem;
  margin: 1.6rem 0;
}
.online-room-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.online-room-entry > div {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.online-room-entry b {
  font-size: var(--f3);
}
.online-room-entry span,
.online-room-entry small {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--f1);
  line-height: 1.5;
}
.online-room-entry .btn,
.online-hall-heading .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.online-room-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}
.online-room-forget {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.18);
}
.online-recent {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.online-recent-hint {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--f1);
  line-height: 1.6;
  margin: 1.2rem 0 0;
}
.online-room-recent {
  opacity: 0.92;
}
.online-room-recent.is-stale {
  opacity: 0.48;
}
.online-room-recent.is-stale b {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}
.online-squad .tbl {
  margin-top: 3rem;
  gap: 2.4rem;
}
.online-squad .tbl .rw.online-member {
  grid-template-columns: 2.6rem 1fr 9rem;
  height: 7.8rem;
  padding: 0 0.9rem;
  font-size: var(--f2);
}
.online-member span:nth-child(2) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  overflow-wrap: anywhere;
}
.online-member small {
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--f0);
  font-weight: 400;
  letter-spacing: 0.12em;
}
.online-member span:last-child {
  font-size: var(--f1);
  color: var(--or2);
}
.online-team-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem;
  margin-top: 2rem;
}
.online-team-actions .btn {
  justify-content: center;
}
#online-result {
  font-size: 4rem;
  color: var(--or2);
}
#pg-online :is(.nv, .btn):disabled {
  opacity: 0.4;
  cursor: default;
}
#pg-pause .vnav:has([data-act="online"]:not([hidden])) {
  top: 41rem;
}
#pg-pause .vnav:has([data-act="online"]:not([hidden])) .nv:not(.primary) {
  height: 4.8rem;
}

body.online-session #fu,
body.online-session #wfrag,
body.online-session #k9-own,
body.online-session #k9-foe,
body.online-session #k9-edge,
body.online-session #k9-alarm,
body.online-session #k9-threat,
body.online-session #k9-prox,
body.online-session #gs-fu {
  display: none !important;
}
.online-squad .tbl .online-member span:nth-child(2) {
  text-align: left;
  align-items: flex-start;
}

body.touch-device #ui :is(.online-commands, .online-squad) {
  overflow: visible;
}
body.touch-device #ui .online-field select {
  font-size: 16px;
  min-height: 40px;
  letter-spacing: 0.03em;
}
body.touch-device #ui .online-room-entry {
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
}
body.touch-device #ui .online-room-entry > div {
  flex: 1 1 170px;
  gap: 6px;
}
body.touch-device #ui :is(.online-room-entry, .online-hall-heading) .btn {
  min-height: 44px;
}
body.touch-device #ui .online-room-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.toy-career {
  position: absolute;
  right: 4.8rem;
  top: 4.8rem;
  width: max(40rem, 316px);
  display: grid;
  gap: 1rem;
}
#ui .toy-career :is(#pcard, #mastery) { position: static; width: 100%; }
body.touch-device #ui .toy-career { display: contents; }
.toy-profile {
  position: static;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.2rem;
  margin-top: 1rem;
  text-transform: none;
}
.toy-profile strong {
  overflow-wrap: anywhere;
  font-size: var(--f3);
}
.toy-profile > span {
  grid-row: 1;
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--f1);
}
.toy-profile > .btn {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--f1);
}
.toy-profile > .btn[hidden] { display: none; }
.toy-rank-layout h3 {
  margin: 2rem 0 1rem;
  font-size: max(22px, 3.2rem);
  overflow-wrap: anywhere;
}
.toy-kill-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.toy-kill-stats span {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--f1);
}
.toy-kill-stats strong {
  display: block;
  margin-top: 0.6rem;
  color: var(--or2);
  font-size: max(22px, 3.2rem);
}
.toy-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--f2);
  text-align: left;
}
.toy-rank-table :is(th, td) {
  padding: 1.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  overflow-wrap: anywhere;
}
.toy-rank-table :is(th, td):last-child {
  text-align: right;
}
.toy-rank-table th {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}
#online-name {
  min-width: 0;
  font-size: var(--f3);
  overflow-wrap: anywhere;
}
#pg-toy-ranks button:disabled {
  opacity: 0.4;
  cursor: default;
}
body.touch-device #ui .toy-rank-layout {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 12px;
}
body.touch-device #ui .toy-profile > .btn {
  min-height: 44px;
}
body.touch-device #ui .toy-rank-table :is(th, td) {
  padding: 12px 8px;
}
body.touch-device #ui .toy-profile {
  position: static;
  grid-column: auto;
  grid-row: auto;
  width: auto;
  margin: 0;
}
.toy-unlock-checks { padding: 2rem; font-size: var(--f3); }
.toy-unlock-checks p { padding: 1rem 0; color: rgba(255, 255, 255, .6); }
.toy-unlock-checks .complete { color: var(--good); }
body.touch-device #ui .toy-unlock-layout { position: static; padding: 12px; }
body.touch-device #pg-toy-unlock :is(button, .btn) { min-height: 44px; }
@media (max-width: 600px) {
  body.touch-device #ui .toy-profile {
    grid-column: 1;
    grid-row: auto;
  }
}

/* --- P2P 联机：房间码 / 邀请二维码 / 语音 / 表情 ---------------------- */
.online-code {
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
}
.online-code input {
  border-bottom: 1px solid var(--line);
  padding: 0.3rem 0;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.online-code input:focus-visible {
  border-bottom-color: var(--or2);
}
.online-share {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem;
  margin-bottom: 1.4rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-left: 0.3rem solid var(--or);
}
.online-share-main {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
  min-width: 0;
}
.online-share-label {
  font-size: var(--f1);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.55);
}
.online-share-code {
  font-size: 3.4rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.26em;
  color: var(--or2);
  text-shadow: 0 0 1.2rem rgba(255, 179, 92, 0.35);
}
.online-share-qr {
  flex: none;
  width: 10.6rem;
  height: 10.6rem;
  padding: 0.5rem;
  background: #14110e;
  border: 1px solid var(--line);
}
.online-share-qr .gh-qr {
  display: block;
  width: 100%;
  height: 100%;
}
.online-tools {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.online-tools .btn.active {
  border-color: var(--or2);
  color: var(--or2);
}
.gh-emote-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.gh-emote {
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border-radius: 0.3rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.gh-emote:hover,
.gh-emote:focus-visible {
  transform: translateY(-2px);
  border-color: var(--or2);
  background: rgba(255, 179, 92, 0.12);
}
.gh-emote-layer {
  position: fixed;
  left: 50%;
  bottom: 7rem;
  transform: translateX(-50%);
  display: grid;
  gap: 0.8rem;
  justify-items: center;
  pointer-events: none;
  z-index: 60;
}
.gh-emote-toast {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1.6rem;
  background: rgba(20, 17, 14, 0.9);
  border: 1px solid var(--line);
  border-left: 0.3rem solid var(--or2);
  backdrop-filter: blur(8px);
  animation: gh-emote-in 220ms ease-out;
}
.gh-emote-toast b {
  font-size: 2rem;
  line-height: 1;
}
.gh-emote-toast span {
  font-size: var(--f2);
  letter-spacing: 0.08em;
}
.gh-emote-toast em {
  font-style: normal;
  font-size: var(--f1);
  color: rgba(255, 255, 255, 0.55);
}
.gh-emote-toast.out {
  opacity: 0;
  transform: translateY(-1rem);
  transition: opacity 320ms ease, transform 320ms ease;
}
.gh-voice-sinks {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
@keyframes gh-emote-in {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}
