/* Online co-op: the lobby on hero select (host / join with code, the room code, the connection state) and the
   "Game paused" overlay after a lost connection (src/ui/coop-view.js). Paper panels, royal ink, claw red. */
#netPause .net-pause-box {
  background: var(--ivory); color: var(--ink); border: 0; border-radius: 0; text-align: center;
  box-shadow: inset 0 0 0 5px var(--ivory), inset 0 0 0 7px var(--royal), 0 16px 40px var(--night-55);
  width: min(440px, 100%); padding: 20px 22px 18px; animation: none;
}
#coopLobby {
  background: var(--ivory); color: var(--ink); border: 0; border-radius: 0; text-align: center;
  box-shadow: inset 0 0 0 5px var(--ivory), inset 0 0 0 7px var(--royal), 0 16px 40px var(--night-55); position: fixed; right: 16px; bottom: 16px;
  z-index: 8000; width: min(360px, calc(100% - 32px)); padding: 18px 18px 14px;
}
#coopLobby b { color: var(--royal); font-family: var(--font-display); font-weight: 400; }
#netPause .net-pause-box b {
  color: var(--royal); font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.15; margin-bottom: 10px;
}
#coopLobby p, #netPause .net-pause-box p { color: var(--ink); }
#coopLobby .ew-btns .btn.primary { font-size: 17px; }
#coopLobby .bug-form input[type=text] {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 0; text-align: center;
  font-family: var(--font-display); font-size: 20px; letter-spacing: .12em; text-transform: uppercase;
}
#coopLobby .bug-form input[type=text]:focus { outline: 2px solid var(--royal); outline-offset: 1px; }
#coopLobby .bug-form input[type=text]::placeholder { color: var(--ink-muted); opacity: .55; }

/* the room code, big enough to read out loud */
.net-code { margin: 2px auto 10px; padding: 6px 10px 4px; width: max-content; max-width: 100%;
  font-family: var(--font-display); font-size: 34px; line-height: 1.1; letter-spacing: .12em; color: var(--claw-dark);
  border: 2px dashed var(--royal); background: var(--paper); user-select: all; -webkit-user-select: all; }

/* the connection state: a dot (moss: connected, gilt: working on it, claw: a problem) and a plain line */
.net-state { display: flex; align-items: flex-start; justify-content: center; gap: 8px; text-align: left; font-size: 14px !important; line-height: 1.35 !important; }
.net-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--gilt); box-shadow: 0 0 0 2px var(--ink-25); }
.net-state[data-net="ok"] .net-dot { background: var(--moss, var(--moss)); }
.net-state[data-net="bad"] .net-dot { background: var(--claw); }
.net-state[data-net="wait"] .net-dot { animation: netPulse 1.2s ease-in-out infinite; }
@keyframes netPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .net-state[data-net="wait"] .net-dot { animation: none; } }
.net-err { color: var(--claw-dark) !important; font-style: italic; }

/* developer switch: online or tabs on this computer (?dev=1) */
.net-dev { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-muted); }
.net-dev .seg-btn { padding: 3px 8px; font-size: 12px; min-height: 0; }

/* paused: over everything, nothing behind it can be clicked */
#netPause { position: fixed; inset: 0; z-index: 99996; display: grid; place-items: center; padding: 16px; background: rgba(5, 9, 24, .74); }
.net-tag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 2px 10px; background: var(--royal); color: var(--ivory);
  font-family: var(--font-display); font-size: 13px; letter-spacing: .08em; }
.net-tag .ico { width: 18px; height: 18px; vertical-align: middle; }
.net-clock .ico { vertical-align: middle; width: 26px; height: 26px; }
.net-clock { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 8px !important;
  font-family: var(--font-display); font-size: 30px !important; color: var(--royal) !important; }
.net-clock[data-left="0"] { font-size: 16px !important; font-style: italic; color: var(--ink-muted) !important; }
.net-note { font-size: 13px !important; color: var(--ink-muted) !important; }
#netPause .ew-btns .btn.primary { font-size: 19px; }

@media (max-width: 600px) {
  #coopLobby { right: 8px; left: 8px; bottom: 8px; width: auto; padding: 14px 14px 12px; }
  #coopLobby b { font-size: 18px; margin-bottom: 4px; }
  #coopLobby p { font-size: 14px; margin-bottom: 8px; }
  .net-code { font-size: 28px; margin-bottom: 8px; }
  #netPause .net-pause-box { padding: 16px 14px 14px; }
  #netPause .net-pause-box b { font-size: 21px; }
  .net-clock { font-size: 26px !important; }
}

/* While a full-screen panel shows (hero select with the lobby, the map, a reward...) or the game is paused, the page
   behind it does not scroll: on a phone the game's table under hero select is a little taller than the window. The
   panels scroll inside themselves when they have to (.overlay). */
html:has(#netPause), html:has(.overlay.show) { overflow: hidden; }
@media (max-width: 700px) { html:has(#netPause) #app, html:has(.overlay.show) #app { max-height: 100vh; overflow: clip; } }
