/* RABLA — css/online.css (Phase 3, N3; PHASE3_SPEC §4)
   The online UI: status pills (menu footer, map / galaxy top bars), the account panel overlay
   (#screen-online: ACCOUNT / FRIENDS / CHAT / RANKS / CHALLENGES), the slim chat bar on MAP and
   SPACE, the cloud conflict dialog, the ghost row on the level intro, the rank / challenge rows on
   the results screen and the ONLINE section of the settings panel. Colours are the :root tokens of
   style.css; everything is in stage pixels (1280×720). `.online-only` elements are hidden by
   js/ui/online.js whenever WM.net.status is not 'online'. */

/* ---------------------------------------------------------------- status pill */
.net-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 12px 3px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 0 var(--ink-2), inset 0 0 0 2px rgba(255, 255, 255, .08);
  transition: transform .08s ease-out, filter .12s;
}
.net-pill::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--steel-dk);
  border: 2px solid var(--ink-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}
.net-pill.online { color: var(--green); box-shadow: 0 3px 0 var(--ink-2), inset 0 0 0 2px rgba(118, 255, 3, .25); }
.net-pill.online::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.net-pill.connecting { color: var(--yellow); }
.net-pill.connecting::before { background: var(--yellow); animation: pulse .8s ease-in-out infinite; }
.net-pill.offline { color: var(--muted); }
.net-pill.disabled { display: none !important; }
.net-pill:hover { transform: translateY(-1px); filter: brightness(1.15); }
.net-pill:active { transform: translateY(1px); }
.panel.menu .footer .net-pill { margin-left: 12px; }
.topbar .net-pill, .galaxy-top .net-pill { margin-left: 2px; }

/* ---------------------------------------------------------------- account panel overlay */
.online-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 16, 48, .62);
  font-family: var(--font);
  color: var(--text);
}
.online-overlay.hidden { display: none !important; }
.panel.online {
  width: 860px;
  height: 600px;
  padding: 18px 26px 20px;
  gap: 10px;
}
.panel.online .online-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel.online .online-head h2 { font-size: 30px; margin-right: 6px; }
.panel.online .online-head .net-pill { cursor: default; }
.panel.online .online-head > .btn:last-child { margin-left: auto; }
.panel.online .tabs { margin: 0; justify-content: flex-start; }
.online-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: rgba(26, 16, 48, .55);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.online-body h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--ink);
}
.online-body .hint { margin: 0; color: var(--muted); font-size: 14px; }
.online-body .row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 2px solid transparent;
}
.online-body .row + .row { border-top-color: rgba(255, 255, 255, .08); border-radius: 0; }
.online-body .row .grow { flex: 1; min-width: 0; }
.online-body .row .name { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-body .row .sub { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.online-body .row .act { display: flex; gap: 6px; flex: none; }
.online-body .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-bottom: 1px dashed rgba(255, 255, 255, .12); }
.online-body .kv .k { color: var(--dim); font-weight: 900; letter-spacing: 1px; font-size: 11px; }
.online-body .kv .v { color: var(--text); font-weight: 900; text-align: right; }
.online-body .form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.online-body .card {
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.online-body .card.accent { background: linear-gradient(180deg, rgba(255, 214, 0, .16), rgba(255, 214, 0, .05)); }
.online-body .dot {
  flex: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--steel-dk);
}
.online-body .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.online-body .friendtag {
  padding: 1px 7px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--cyan);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.online-body .honor {
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.online-body .state { font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.online-body .state.done.won { color: var(--green); }
.online-body .state.done.lost { color: var(--red); }
.online-body .state.declined { color: var(--dim); }

/* inputs */
.online-input, .chatbar input, .settings-online input[type="text"] {
  min-height: 36px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #0E1430;
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .35);
}
.online-input:focus, .chatbar input:focus, .settings-online input[type="text"]:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 214, 0, .25); }
.online-input::placeholder, .chatbar input::placeholder { color: var(--dim); font-weight: 700; }
.online-body select, .online-input.sel {
  min-height: 36px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: #0E1430;
  color: var(--text);
  font-family: var(--font);
  font-weight: 900;
  font-size: 14px;
}

/* ranks table */
.ranks-scope { display: flex; gap: 6px; flex-wrap: wrap; }
.ranks-scope .btn.tab { opacity: .75; }
.ranks-scope .btn.tab.active { opacity: 1; background: linear-gradient(180deg, #84FFFF, var(--cyan)); }
.ranks-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ranks-table th { text-align: left; color: var(--dim); font-size: 11px; letter-spacing: 2px; padding: 4px 8px; border-bottom: 2px solid rgba(255, 255, 255, .15); }
.ranks-table td { padding: 5px 8px; border-bottom: 1px dashed rgba(255, 255, 255, .1); font-weight: 700; }
.ranks-table td.num, .ranks-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ranks-table tr.me td { color: var(--yellow); }
.ranks-table tr.top1 td:first-child { color: var(--gold); }
.ranks-table tr.top2 td:first-child { color: var(--silver); }
.ranks-table tr.top3 td:first-child { color: var(--bronze); }
.ranks-mine { font-weight: 900; color: var(--yellow); font-size: 14px; letter-spacing: 1px; }

/* chat log (panel tab) */
.chat-log {
  flex: 1;
  min-height: 160px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
  font-size: 14px;
}
.chat-line { line-height: 1.3; word-break: break-word; }
.chat-line .who { font-weight: 900; color: var(--cyan); margin-right: 6px; }
.chat-line.me .who { color: var(--yellow); }
.chat-line.whisper { color: var(--pink); font-style: italic; }
.chat-line.whisper .who { color: var(--pink); }
.chat-line .at { color: var(--dim); font-size: 11px; margin-right: 6px; }

/* ---------------------------------------------------------------- chat bar (MAP / SPACE) */
.chatbar {
  /* Integration: anchored left of the map's hover panel (panel x 894..1266, VIEW_W 1280) and right of the
     garage thumbnail (x 14..190): the strip spans x 300..860 so it never covers the RANKS chip; its bottom
     edge (28 px) stays above the footer hint line drawn at y 708. */
  position: absolute;
  left: 300px;
  bottom: 28px;
  width: 560px;
  max-width: 560px;
  z-index: 45;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font);
}
.chatbar.hidden { display: none !important; }
.chatbar .chat-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(26, 16, 48, .78);
  border: 2px solid rgba(26, 16, 48, .9);
  font-size: 13px;
  color: var(--text);
  text-shadow: 1px 1px 0 var(--ink);
}
.chatbar .chat-mini:empty { display: none; }
.chatbar .chat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  box-shadow: 0 5px 0 var(--ink-2), 0 10px 24px rgba(0, 0, 0, .45);
}
.chatbar.closed .chat-row { display: none; }
.chatbar .chat-row .tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--cyan);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.chatbar .chat-row .tag.whisper { background: var(--pink); }
.chatbar .chat-row input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- cloud conflict dialog */
.online-dialog {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 16, 48, .7);
  font-family: var(--font);
  color: var(--text);
}
.online-dialog.hidden { display: none !important; }
.panel.conflict { width: 760px; gap: 14px; align-items: stretch; }
.panel.conflict .text { text-align: center; color: var(--muted); font-size: 16px; font-weight: 700; }
.conflict-cards { display: flex; gap: 18px; }
.conflict-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: rgba(26, 16, 48, .6);
  box-shadow: 0 5px 0 var(--ink-2);
}
.conflict-card.local { background: linear-gradient(180deg, rgba(255, 160, 64, .18), rgba(26, 16, 48, .6)); }
.conflict-card.cloud { background: linear-gradient(180deg, rgba(0, 229, 255, .18), rgba(26, 16, 48, .6)); }
.conflict-card h3 { margin: 0 0 4px; font-size: 20px; text-shadow: 2px 2px 0 var(--ink); }
.conflict-card.local h3 { color: var(--orange-lt); }
.conflict-card.cloud h3 { color: var(--cyan); }
.conflict-card .kv { display: flex; justify-content: space-between; font-size: 15px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .14); }
.conflict-card .kv .k { color: var(--dim); font-weight: 900; letter-spacing: 1px; font-size: 11px; }
.conflict-card .kv .v { font-weight: 900; }
.conflict-card .btn { margin-top: 8px; align-self: center; }
.conflict-card.better .kv .v { color: var(--green); }
.panel.conflict .auto { text-align: center; color: var(--dim); font-size: 12px; letter-spacing: 1px; }

/* ---------------------------------------------------------------- level intro ghost row */
.intro-ghost {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(0, 229, 255, .16), rgba(0, 229, 255, .05));
  font-size: 14px;
  font-weight: 700;
}
.intro-ghost.hidden { display: none !important; }
.intro-ghost .g-label { font-size: 11px; font-weight: 900; letter-spacing: 2px; color: var(--cyan); text-transform: uppercase; }
.intro-ghost .g-text { color: var(--text); font-weight: 900; white-space: nowrap; }
.intro-ghost .g-text .g-kind { color: var(--muted); font-weight: 700; font-size: 12px; margin-left: 6px; }
.intro-ghost label { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); cursor: pointer; white-space: nowrap; }
.intro-ghost input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--cyan); cursor: pointer; }
.intro-ghost select {
  min-height: 30px;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #0E1430;
  color: var(--text);
  font-family: var(--font);
  font-weight: 900;
  font-size: 13px;
}
.intro-ghost select.hidden { display: none !important; }

/* ---------------------------------------------------------------- results rows */
.results-online { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.results-online.hidden { display: none !important; }
.results-online .rank-row {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--cyan);
  text-shadow: 2px 2px 0 var(--ink);
}
.results-online .rank-row.pending { color: var(--dim); animation: pulse 1.2s ease-in-out infinite; }
.results-online .rank-row.best { color: var(--yellow); }
.results-online .challenge-row {
  padding: 2px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
}
.results-online .challenge-row.won { background: var(--green); color: var(--green-ink); }
.results-online .challenge-row.lost { background: var(--red); color: #FFF; }
.results-online .challenge-row.hidden, .results-online .rank-row.hidden { display: none !important; }

/* ---------------------------------------------------------------- settings ONLINE section */
.settings-online {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  padding: 6px 10px 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, .06);
}
.settings-online h3 { font-size: 13px; letter-spacing: 2px; color: var(--cyan); margin: 0 0 2px; text-shadow: 2px 2px 0 var(--ink); }
.panel.settings .settings-online label { padding: 5px 2px; font-size: 15px; border-bottom-color: rgba(255, 255, 255, .1); }
.panel.settings .settings-online label:last-child { border-bottom: 0; }
.panel.settings .settings-online label > span { font-size: 13px; }
.settings-online .field { display: inline-flex; align-items: center; gap: 6px; }
.settings-online input[type="text"] { width: 190px; min-height: 30px; padding: 4px 10px; font-size: 14px; }
.settings-online .status { font-size: 13px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.settings-online .status.online { color: var(--green); }
.settings-online .status.connecting { color: var(--yellow); }
.settings-online .btn.small { min-width: 0; align-self: auto; min-height: 30px; padding: 4px 12px; font-size: 13px; }
/* the ONLINE section needs ~130 px: the rest of the settings panel tightens up so the whole panel
   (title, 5 rows, ONLINE, CONTROLS as two columns, RESET SAVE + BACK) stays inside the 720 px stage */
.panel.settings { padding: 16px 30px 18px; gap: 4px; }
.panel.settings > h2 { font-size: 30px; margin-bottom: 2px; }
.panel.settings label { padding: 5px 4px; font-size: 16px; }
.panel.settings .controls-card { margin: 6px 0 2px; padding: 6px 14px 8px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 0; }
.panel.settings .controls-card h3 { grid-column: 1 / -1; font-size: 13px; margin-bottom: 2px; }
.panel.settings .controls-card p { font-size: 11px; line-height: 1.35; }
.panel.settings .btn { min-height: 42px; padding: 8px 22px; font-size: 18px; }
