/* ===== The Fast and the Crustaceous — Pack multiplayer UI (js/netui.js, name tags from js/remote.js) ===== */

/* ---------- menu + lobby panels ---------- */
.net-panel { text-align: left; max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px 32px; }
.net-panel .popup-title { text-align: center; }
.net-sub { text-align: center; color: var(--ink-dim); font-size: 14px; margin: -6px 0 16px; }
.net-head {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 3px; font-weight: 800;
  color: var(--pink-soft); margin: 16px 0 8px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.net-field { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.net-label {
  flex: 0 0 112px;
  font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; font-weight: 700;
  color: var(--ink-faint);
}
.net-input {
  flex: 1; min-width: 0;
  font: 600 14px var(--font-display); letter-spacing: 1px; color: var(--ink);
  background: rgba(13, 6, 34, 0.7);
  border: 1px solid rgba(255, 138, 194, 0.4); border-radius: 6px;
  padding: 9px 12px; outline: none; user-select: text;
}
.net-input:focus { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 77, 157, 0.4); }
.net-input::placeholder { color: var(--ink-faint); font-weight: 500; }
.net-code-in { text-transform: uppercase; letter-spacing: 4px; font-size: 18px; text-align: center; }
.net-car { flex: 1; font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: 2px; color: var(--aqua); }
.net-box { padding: 4px 0 0; }
.net-note { font-size: 12px; color: var(--ink-dim); margin: 2px 0 8px; }
.net-warn-note {
  color: var(--gold); text-align: center; font-family: var(--font-display);
  font-size: 11px; letter-spacing: 2px; font-weight: 700; margin: 10px 0 0;
}
.net-status { min-height: 18px; margin: 10px 0; text-align: center; font-size: 13px; color: var(--ink-dim); }
.net-status.err { color: var(--danger); }
.net-link {
  background: none; border: none; cursor: pointer; padding: 6px 0; margin: 4px 0 8px;
  font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--ink-faint);
}
.net-link:hover { color: var(--pink-soft); }
.net-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-dim); cursor: pointer; margin-bottom: 6px; }
.net-check input { accent-color: var(--pink); width: 16px; height: 16px; }
.net-back { display: block; margin: 6px auto 0; padding: 10px 28px; font-size: 13px; }
.net-panel .btn-row .btn { padding: 12px 24px; font-size: 14px; }

/* segmented selector */
.net-seg { display: flex; flex: 1; gap: 6px; margin-bottom: 10px; }
.net-field .net-seg { margin-bottom: 0; }
.net-seg-btn {
  flex: 1; cursor: pointer; padding: 8px 6px; border-radius: 6px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 1.5px; font-weight: 800;
  color: #ffc4e3; background: rgba(255, 77, 157, 0.04); border: 1px solid rgba(255, 138, 194, 0.4);
}
.net-seg-btn:hover:not(:disabled) { background: rgba(255, 77, 157, 0.14); }
.net-seg-btn.active {
  color: #2a0930; border-color: transparent;
  background: linear-gradient(180deg, var(--coral), var(--pink));
}
.net-seg-btn:disabled { cursor: default; opacity: 0.55; }
.net-seg-btn.active:disabled { opacity: 0.85; }
.net-tx { margin-bottom: 4px; }
.net-tx:last-of-type { margin-bottom: 14px; }

/* ---------- lobby ---------- */
.net-codebox {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 14px;
}
.net-codebox .net-label { flex-basis: 100%; text-align: center; }
.net-code {
  font-family: var(--font-display); font-size: 44px; font-weight: 900; letter-spacing: 10px;
  color: #fff; padding-left: 10px; user-select: text;
  text-shadow: 0 0 18px rgba(255, 46, 121, 0.8), 0 0 50px rgba(255, 77, 157, 0.4);
}
.net-copy { padding: 8px 18px !important; font-size: 12px !important; }
.net-slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.net-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: 6px;
  background: rgba(13, 6, 34, 0.6); border: 1px solid rgba(255, 138, 194, 0.22);
}
.net-slot.me { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 77, 157, 0.25); }
.net-slot.empty { justify-content: center; color: var(--ink-faint); font-size: 11px; letter-spacing: 2px; border-style: dashed; font-family: var(--font-display); }
.net-slot-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.net-slot-car { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: 1px; color: var(--aqua); font-family: var(--font-display); }
.net-slot-ping { flex: 0 0 62px; text-align: right; font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.net-slot-ping.warn { color: var(--gold); font-weight: 700; }
.net-slot-tags { flex: 0 0 auto; display: flex; gap: 6px; min-width: 120px; justify-content: flex-end; }
.net-badge {
  font-style: normal; font-family: var(--font-display); font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
  padding: 3px 7px; border-radius: 4px; color: var(--ink-dim); border: 1px solid rgba(255, 255, 255, 0.2);
}
.net-badge.you { color: var(--pink-soft); border-color: var(--pink); }
.net-badge.ok { color: #08342c; background: var(--aqua); border-color: var(--aqua); }
.net-badge.wait { color: var(--ink-faint); }

/* ---------- in-heat HUD (left side, under the HUD boxes) ---------- */
#net-hud {
  position: fixed; top: 112px; left: 18px;
  z-index: 11; pointer-events: none; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  font-family: var(--font-display);
}
.net-hud-box {
  display: flex; align-items: baseline; gap: 12px; white-space: nowrap;
  background: rgba(24, 11, 50, 0.82); border: 1px solid var(--panel-line); border-radius: 6px;
  padding: 7px 14px; box-shadow: 0 0 18px rgba(255, 77, 157, 0.16);
}
.net-pos { font-size: 24px; font-weight: 900; letter-spacing: 2px; color: #fff; text-shadow: 0 0 12px rgba(255, 77, 157, 0.7); }
.net-alive, .net-heat { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--ink-dim); }
.net-gap {
  font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--pink-soft);
  background: rgba(24, 11, 50, 0.82); border-radius: 4px; padding: 3px 10px;
}
.net-gap.lead { color: var(--aqua); }
.net-drop { display: flex; align-items: center; gap: 8px; }
.net-drop-label { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: var(--ink-faint); }
.net-drop-track {
  display: block; width: 150px; height: 8px; border-radius: 4px; overflow: hidden;
  background: rgba(24, 11, 50, 0.85); border: 1px solid var(--panel-line);
}
.net-drop-track i {
  display: block; width: 100%; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--aqua), var(--orange));
}
.net-drop.warn .net-drop-label { color: var(--danger); animation: netFlash 0.4s steps(2, jump-none) infinite; }
.net-drop.warn .net-drop-track { border-color: var(--danger); animation: netFlash 0.4s steps(2, jump-none) infinite; }
.net-drop.warn .net-drop-track i { background: var(--danger); }
@keyframes netFlash { 0% { opacity: 1; } 100% { opacity: 0.35; } }

/* ---------- scores (HUD, intermission, match end) ---------- */
.net-scores {
  display: flex; flex-direction: column; gap: 3px; min-width: 150px;
  background: rgba(24, 11, 50, 0.78); border-radius: 6px; padding: 5px 10px;
}
.net-score { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink-dim); }
.net-score.me { color: #fff; }
.net-score.out { opacity: 0.45; }
.net-score.out .net-score-name { text-decoration: line-through; }
.net-score-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-dots { display: inline-flex; gap: 4px; }
.net-dots i { display: block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--pink-soft); }
.net-dots i.full { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px rgba(255, 209, 102, 0.8); }
.net-scores-big { background: none; padding: 0; margin: 4px auto 14px; gap: 8px; width: fit-content; }
.net-scores-big .net-score { font-size: 15px; gap: 28px; }
.net-scores-big .net-score-name { max-width: 200px; }
.net-scores-big .net-dots i { width: 14px; height: 14px; }

/* ---------- countdown / spectate / host away / toasts ---------- */
#net-count {
  position: fixed; top: 34%; left: 0; right: 0; z-index: 21; text-align: center; pointer-events: none;
  font-family: var(--font-display); font-size: 150px; font-weight: 900; letter-spacing: 8px; color: #fff;
  text-shadow: 0 0 20px rgba(255, 237, 247, 0.6), 0 0 50px rgba(255, 46, 121, 0.9), 0 0 100px rgba(255, 126, 95, 0.5);
  animation: netCountPop 0.5s ease-out;
}
#net-count.go { color: var(--aqua); text-shadow: 0 0 24px rgba(46, 230, 200, 0.9), 0 0 80px rgba(46, 230, 200, 0.5); animation: netGo 0.8s ease forwards; }
@keyframes netCountPop { from { transform: scale(1.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes netGo { 0% { transform: scale(0.7); opacity: 0; } 15% { transform: scale(1.1); opacity: 1; } 35% { transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
#net-spec {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 21; pointer-events: none;
  font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: 3px; white-space: nowrap;
  color: #fff; background: rgba(24, 11, 50, 0.85); border: 1px solid var(--panel-line); border-radius: 6px; padding: 8px 18px;
}
#net-away {
  position: fixed; top: 112px; right: 18px; z-index: 23; pointer-events: none;
  font-family: var(--font-display); font-size: 16px; font-weight: 900; letter-spacing: 4px;
  color: #fff; background: rgba(160, 20, 50, 0.9); border: 1px solid var(--danger); border-radius: 6px; padding: 6px 18px;
  animation: netFlash 0.6s steps(2, jump-none) infinite;
}
#net-toasts {
  position: fixed; top: 156px; right: 18px; z-index: 62; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.net-toast {
  font-family: var(--font-display); font-size: 12px; font-weight: 800; letter-spacing: 2px; white-space: nowrap;
  color: #fff; background: rgba(24, 11, 50, 0.92); border: 1px solid var(--panel-line); border-radius: 6px; padding: 7px 16px;
  animation: netToast 3s ease forwards;
}
.net-toast.good { border-color: var(--aqua); color: var(--aqua); }
.net-toast.bad, .net-toast.warn { border-color: var(--danger); color: #ffd5dc; }
@keyframes netToast { 0% { opacity: 0; transform: translateY(-8px); } 8% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- intermission (docked low so the road stays visible) ---------- */
#net-inter { position: fixed; left: 0; right: 0; bottom: 16px; z-index: 30; display: flex; justify-content: center; pointer-events: none; padding: 0 14px; }
.net-inter-panel { text-align: center; padding: 16px 30px 18px; max-width: 460px; }
.net-inter-panel .popup-title { font-size: 20px; margin-bottom: 10px; }
.net-next { font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: 3px; color: var(--pink-soft); }
#net-end .net-panel { text-align: center; max-width: 520px; }

/* ---------- remote-car name tags (created by js/remote.js) ---------- */
#net-tags { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.net-tag {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; text-align: center;
  font-family: var(--font-display); will-change: transform;
}
.net-tag-name {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 46, 121, 0.8);
}
.net-tag-sub { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--pink-soft); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); }
.net-tag-sub:empty { display: none; }
.net-tag.out { opacity: 0.45; }
.net-tag.out .net-tag-name { text-decoration: line-through; }
.net-tag.phone .net-tag-name { color: var(--gold); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 209, 102, 0.9); }
.net-tag.phone .net-tag-sub { font-size: 16px; letter-spacing: 0; line-height: 1.1; }
.net-tag.draft .net-tag-name { color: var(--aqua); text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(46, 230, 200, 0.9); }
.net-tag.draft .net-tag-sub { color: var(--aqua); }

@media (max-width: 640px) {
  .net-panel { padding: 20px 16px; }
  .net-label { flex-basis: 78px; }
  .net-code { font-size: 32px; letter-spacing: 6px; }
  .net-slot-car { display: none; }
  .net-slot-tags { min-width: 0; }
}
