@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

#pvpOverlay {
  z-index: 5000;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(44, 112, 255, 0.22), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(255, 204, 0, 0.14), transparent 32%),
    rgba(5, 9, 18, 0.97);
  color: #edf5ff;
  font-family: "Segoe UI", Arial, sans-serif;
}

.online-shell {
  position: relative;
  z-index: 2;                 /* float above the animated team-room backdrop (#lobbyCanvas) */
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: rgba(13, 23, 40, 0.92);
  border: 1px solid #29456b;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.online-header,
.online-footer,
.online-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.online-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid #203652;
}

.online-header h2 {
  margin: 2px 0 4px;
  color: #fff !important;
  font-size: clamp(1.8rem, 4vw, 2.6rem) !important;
}

.online-header p:last-child,
.online-card p,
.online-hero-card p {
  color: #93a8c3;
  line-height: 1.5;
}

.online-kicker,
.online-label {
  color: #74a7ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.online-close {
  width: 42px;
  height: 42px;
  border: 1px solid #355276;
  border-radius: 50%;
  background: #14243a;
  color: #dceaff;
  cursor: pointer;
  font-weight: 800;
}

.online-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: #0a1322;
  border-bottom: 1px solid #203652;
}

.online-tab {
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8fa4bf;
  font-weight: 800;
  cursor: pointer;
}

.online-tab.active {
  background: #1d3658;
  color: #fff;
}

.online-content {
  display: block !important;
  overflow-y: auto;
  padding: 24px 28px;
}

.online-panel { display: none; }
.online-panel.active { display: block; }

.online-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid #315b8f;
  border-radius: 18px;
  background: linear-gradient(135deg, #17365e, #102238);
}

.online-hero-card h3,
.online-section-heading h3 {
  margin: 6px 0;
  font-size: 1.4rem;
}

.online-grid,
.profile-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.profile-layout {
  grid-template-columns: 1.1fr 0.9fr;
  margin-top: 0;
}

.account-layout,
.clan-dashboard {
  margin-top: 16px;
}

.online-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clan-heading {
  margin-bottom: 10px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.online-card {
  padding: 18px;
  border: 1px solid #243d5e;
  border-radius: 15px;
  background: #111f33;
}

.online-card strong {
  display: block;
  margin: 7px 0;
  color: #fff;
  font-size: 1.02rem;
}

.party-select-card {
  margin-top: 16px;
}

.party-select-card > p {
  margin: 8px 0 14px;
  color: #93a8c3;
  line-height: 1.45;
}

.party-selection-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.party-choice {
  position: relative;
  min-height: 82px;
  padding: 12px 14px;
  border: 1px solid #304c70;
  border-radius: 12px;
  background: #0a1728;
  color: #dceaff;
  text-align: left;
  cursor: pointer;
}

.party-choice strong,
.party-choice span {
  display: block;
}

.party-choice strong {
  margin: 0 0 5px;
}

.party-choice span {
  color: #8fa4bf;
  font-size: 0.8rem;
}

.party-choice.active {
  border-color: #ffd83d;
  background: #29304a;
  box-shadow: inset 0 0 0 1px #ffd83d;
}

.party-choice.active::after {
  content: "ACTIVE";
  position: absolute;
  top: 9px;
  right: 9px;
  color: #ffd83d;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.party-choice:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.online-card label {
  display: block;
  margin: 16px 0 6px;
  color: #b8c9dc;
  font-size: 0.85rem;
  font-weight: 700;
}

.online-card input {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid #36577e;
  border-radius: 10px;
  outline: none;
  background: #081321;
  color: #fff;
  font: inherit;
}

.online-card select {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 13px;
  border: 1px solid #36577e;
  border-radius: 10px;
  outline: none;
  background: #081321;
  color: #fff;
  font: inherit;
}

.online-card input:focus,
.online-card select:focus { border-color: #73a8ff; }

.online-inventory-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.online-inventory-mon {
  position: relative;
  padding: 13px;
  border: 1px solid #304c70;
  border-radius: 12px;
  background: #0a1728;
}

.online-inventory-mon.ranked-selected {
  border-color: #5b89c4;
}

.online-inventory-mon.ranked-active {
  border-color: #ffd83d;
  box-shadow: inset 0 0 0 1px #ffd83d;
}

.online-inventory-mon.ranked-active::after {
  content: "ACTIVE";
  position: absolute;
  top: 9px;
  right: 9px;
  color: #ffd83d;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.online-inventory-mon strong,
.online-inventory-mon span,
.online-inventory-mon code {
  display: block;
}

.online-inventory-mon span,
.online-inventory-mon code {
  margin-top: 4px;
  color: #8fa4bf;
  font-size: 0.75rem;
}

.ranked-selection-controls {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.ranked-selection-controls .pvp-btn {
  flex: 1;
}

#rankedSelectionSummary {
  display: block;
  margin-top: 5px;
  color: #b8c9dc;
  font-size: 0.86rem;
}

.trade-heading {
  margin-top: 20px;
}

#onlineInventoryStatus {
  color: #b8c9dc;
}

.profile-stats div {
  padding: 12px 0;
  border-bottom: 1px solid #263b56;
}

.profile-stats div:last-child { border-bottom: 0; }
.profile-stats small { color: #8297b0; }

.online-warning {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #7a5c1b;
  border-radius: 10px;
  background: #2a210e;
  color: #f1d58c;
  line-height: 1.45;
}

#accountStatus.error {
  color: #ff9c9c;
}

.leaderboard-list {
  overflow: hidden;
  border: 1px solid #243d5e;
  border-radius: 14px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 100px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #203652;
  background: #101d30;
}

.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row span { color: #8fa4bf; }
.leaderboard-row strong { color: #fff; }
.online-empty { padding: 24px; color: #8297b0; text-align: center; }

.online-footer {
  padding: 14px 20px;
  border-top: 1px solid #203652;
  background: #091320;
  color: #8197b1;
  font-size: 0.78rem;
}

#pvpOverlay .pvp-btn {
  border: 0;
  border-radius: 11px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

#pvpOverlay .pvp-btn:hover { transform: translateY(-1px); }
#pvpOverlay .pvp-btn.primary { background: #ffd83d; color: #172033; }
#pvpOverlay .pvp-btn.secondary { background: #1a2d47; color: #dceaff; }
#pvpOverlay .pvp-btn.danger { background: #522331; color: #ffdce5; }
#pvpOverlay .pvp-btn.compact { padding: 9px 14px; font-size: 0.82rem; }
#pvpOverlay .pvp-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

@media (max-width: 720px) {
  #pvpOverlay { padding: 8px; }
  .online-shell { max-height: calc(100vh - 16px); border-radius: 14px; }
  .online-header, .online-content { padding: 18px; }
  .online-grid, .profile-layout { grid-template-columns: 1fr; }
  .online-inventory-list { grid-template-columns: 1fr 1fr; }
  .party-selection-list { grid-template-columns: 1fr 1fr; }
  .online-hero-card { align-items: stretch; flex-direction: column; }
  .leaderboard-row { grid-template-columns: 40px minmax(0, 1fr) 76px; }
  .leaderboard-clan { display: none; }
  .online-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  .party-selection-list { grid-template-columns: 1fr; }
  .online-inventory-list { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════════
   RETRO-GBA LOBBY THEME (override layer) — game-launcher look over the team room.
   Pixel font on the SHORT text (title / labels / buttons); body copy stays readable.
   ════════════════════════════════════════════════════════════════════════════ */
#pvpOverlay {
  background:
    radial-gradient(circle at 50% -10%, rgba(46, 96, 176, 0.22), transparent 50%),
    rgba(4, 8, 16, 0.55);                 /* lighter veil so the team room reads through */
}

.online-shell {
  border: 4px solid #eaf1fc;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(19, 39, 70, 0.95), rgba(10, 22, 42, 0.96));
  box-shadow:
    inset 0 0 0 3px #22417c,             /* GBA dialogue inner frame */
    0 0 0 3px #050b16,
    0 22px 60px rgba(0, 0, 0, 0.62);
}

.online-kicker, .online-label,
.online-header h2,
.online-hero-card h3, .online-section-heading h3,
.online-card strong,
#pvpOverlay .pvp-btn, .online-close,
.online-footer {
  font-family: "Press Start 2P", "Courier New", monospace;
}

.online-header {
  background: linear-gradient(180deg, #17315c, #0e2244);
  border-bottom: 3px solid #22417c;
}
.online-kicker { color: #ffd23d !important; font-size: 0.56rem; letter-spacing: 0.1em; }
.online-header h2 {
  font-size: clamp(1.05rem, 2.6vw, 1.55rem) !important;
  color: #fdf6df !important;
  line-height: 1.35;
  text-shadow: 2px 2px 0 #081226, 0 0 10px rgba(120, 170, 255, 0.35);
}
.online-header p:last-child { font-size: 0.8rem; }

.online-close {
  border: 3px solid #eaf1fc;
  border-radius: 8px;
  background: #b3373f;
  color: #fff;
  font-size: 0.66rem;
  box-shadow: 0 3px 0 #6c1d23;
}
.online-close:hover { background: #d2434c; }
.online-close:active { transform: translateY(3px); box-shadow: none; }

.online-tabs {
  background: #091523;
  border-bottom: 3px solid #22417c;
  gap: 4px;
}
.online-tab {
  border: 2px solid transparent;
  border-radius: 7px;
  color: #84a0c6;
  letter-spacing: 0.02em;
}
.online-tab:hover { color: #d6e6ff; }
.online-tab.active {
  background: #ffd23d;
  color: #182338;
  border-color: #fff3c4;
  box-shadow: 0 3px 0 #b8932a;
}

.online-hero-card {
  border: 3px solid #3f6fb0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b3d6e, #0f2441);
  box-shadow: inset 0 0 0 2px #0a1830, 0 6px 0 #0a1526;
}
.online-hero-card h3 {
  font-size: 0.95rem; color: #fdf6df; line-height: 1.4;
  text-shadow: 2px 2px 0 #091428;
}

.online-card, .party-choice, .online-inventory-mon, .leaderboard-list {
  border: 3px solid #2a4b78;
  border-radius: 10px;
}
.online-card strong { font-size: 0.7rem; line-height: 1.6; color: #fdf6df; }
.online-section-heading h3 { font-size: 0.86rem; color: #fdf6df; line-height: 1.4; }
.online-label { color: #ffd23d !important; font-size: 0.54rem; }

#pvpOverlay .pvp-btn {
  border-radius: 7px;
  border: 3px solid rgba(255, 255, 255, 0.82);
  padding: 12px 18px;
  font-size: 0.64rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
#pvpOverlay .pvp-btn.primary   { background: #ffd23d; color: #182338; border-color: #fff3c4; box-shadow: 0 4px 0 #b8932a; }
#pvpOverlay .pvp-btn.secondary { background: #2a5fa6; color: #fff;    border-color: #7fb0ee; box-shadow: 0 4px 0 #163a6b; }
#pvpOverlay .pvp-btn.danger    { background: #b3373f; color: #fff;    border-color: #f0a0aa; box-shadow: 0 4px 0 #6c1d23; }
#pvpOverlay .pvp-btn:hover  { transform: translateY(-1px); filter: brightness(1.07); }
#pvpOverlay .pvp-btn:active { transform: translateY(4px); box-shadow: none; }
#pvpOverlay .pvp-btn.compact { font-size: 0.54rem; padding: 9px 12px; }

.online-footer {
  background: #071120;
  border-top: 3px solid #22417c;
  color: #8aa0bd;
  font-size: 0.54rem;
  letter-spacing: 0.04em;
}

.online-content::-webkit-scrollbar { width: 12px; }
.online-content::-webkit-scrollbar-track { background: #091523; }
.online-content::-webkit-scrollbar-thumb { background: #2a5fa6; border: 3px solid #091523; }

#pvpOverlay .online-controller-focus,
#pvpOverlay button.online-controller-focus,
#pvpOverlay input.online-controller-focus,
#pvpOverlay select.online-controller-focus,
#pvpOverlay textarea.online-controller-focus,
#pvpOverlay summary.online-controller-focus,
#pvpOverlay button:focus-visible,
#pvpOverlay input:focus-visible,
#pvpOverlay select:focus-visible,
#pvpOverlay textarea:focus-visible,
#pvpOverlay summary:focus-visible {
  outline: 3px solid #ffd23d;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(10, 18, 38, 0.95), 0 0 18px rgba(255, 210, 61, 0.78) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   CABLE CLUB — Union Room lobby (online count, global chat, seek-a-match).
   Reuses the GBA panel theme; adds its own feed / player-row / counter styling.
   ════════════════════════════════════════════════════════════════════════════ */
.cc-hero { align-items: stretch; }
.cc-counts {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cc-count {
  min-width: 78px;
  padding: 12px 10px;
  text-align: center;
  border: 3px solid #2a4b78;
  border-radius: 10px;
  background: #0a1728;
}
.cc-count strong {
  display: block;
  color: #ffd23d;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 1.4rem;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #081226;
}
.cc-count span {
  display: block;
  margin-top: 6px;
  color: #84a0c6;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cc-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
  margin-top: 16px;
}

.cc-players-card,
.cc-chat-card { display: flex; flex-direction: column; }

.cc-players {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 330px;
  overflow-y: auto;
}
.cc-player {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 2px solid #26426b;
  border-radius: 9px;
  background: #0a1728;
}
.cc-player.seeking { border-color: #ffd23d; box-shadow: inset 0 0 0 1px rgba(255, 210, 61, 0.5); }
.cc-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #46d17a;
  box-shadow: 0 0 8px rgba(70, 209, 122, 0.8);
}
.cc-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eaf1fc;
  font-weight: 700;
  font-size: 0.9rem;
}
.cc-you {
  margin-left: 4px;
  color: #74a7ff;
  font-size: 0.68rem;
  font-weight: 800;
}
.cc-rating {
  flex-shrink: 0;
  color: #8fa4bf;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.cc-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  background: #ffd23d;
  color: #182338;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cc-player .pvp-btn { flex-shrink: 0; }

.cc-feed {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 10px 12px;
  border: 2px solid #26426b;
  border-radius: 9px;
  background: rgba(4, 10, 20, 0.55);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cc-msg { line-height: 1.4; font-size: 0.9rem; word-break: break-word; color: #dfe9f7; }
.cc-msg b { color: #9fb7ff; }
.cc-sys { line-height: 1.4; font-size: 0.82rem; color: #8aa0bd; font-style: italic; }
.cc-sys b { color: #ffd23d; font-style: normal; }

.cc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cc-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.cc-input-row input {
  flex: 1;
  margin: 0;
  padding: 11px 12px;
  border: 2px solid #36577e;
  border-radius: 9px;
  background: #081321;
  color: #fff;
  font: inherit;
  outline: none;
}
.cc-input-row input:focus { border-color: #73a8ff; }
.cc-input-row .pvp-btn { flex-shrink: 0; }

.cc-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.cc-status { color: #b8c9dc; font-size: 0.85rem; }

@media (max-width: 720px) {
  .cc-grid { grid-template-columns: 1fr; }
  .cc-hero { flex-direction: column; }
  .cc-counts { justify-content: flex-start; }
  .cc-cta { flex-direction: column; align-items: stretch; }
}
