/* ==========================================================
   POPUPS.CSS — right-rail old-internet popup ad windows
   Also covers the IRC #spx1 chat floating window.
   ========================================================== */

/* ---------- right-rail popup ads ---------- */
.popup-rail {
  position: fixed;
  top: auto;
  right: 18px;
  bottom: 28px;
  width: 235px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.popup-ad {
  pointer-events: auto;
  background: #c0c0c0;
  border: 3px outset #fff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.55);
  font-family: "Tahoma", "MS Sans Serif", sans-serif;
  font-size: 11px;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.popup-ad.pop-in { transform: scale(1); opacity: 1; }
.popup-ad.hidden { display: none; }
.popup-ad.min .popup-body,
.popup-ad.min .popup-foot { display: none; }

.popup-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  background: linear-gradient(to right, #800, #c00 40%, #f66);
  cursor: grab;
  user-select: none;
}
.popup-title .pt-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup-title .pt-ctrls { display: flex; gap: 2px; }
.popup-title .pt-ctrls button {
  width: 20px;
  height: 16px;
  background: #c0c0c0;
  border: 1px outset #fff;
  font-family: "MS Sans Serif", sans-serif;
  font-weight: bold;
  font-size: 10px;
  line-height: 12px;
  cursor: pointer;
}
.popup-title .pt-ctrls button:active { border-style: inset; }

.popup-url {
  padding: 3px 6px;
  background: #fff;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #808080;
  font-family: "Courier New", monospace;
  font-size: 10px;
  color: #606;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.popup-body {
  padding: 8px 10px;
  background: #fff;
  font-size: 11px;
  line-height: 1.45;
}
.popup-body h4 {
  margin: 0 0 8px;
  color: #c00;
  font-family: Impact, sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #ff0;
}
.popup-body .zh { color: #606; font-size: 11px; }
.popup-body button.action {
  margin-top: 8px;
  padding: 4px 10px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-family: Tahoma, sans-serif;
  font-weight: bold;
  cursor: pointer;
}
.popup-body button.action:active { border-style: inset; }
.popup-body input[type="number"],
.popup-body input[type="text"] {
  width: 72px;
  padding: 2px 4px;
  font-family: "Courier New", monospace;
  border: 1px inset #808080;
  font-size: 12px;
}
.popup-body select {
  padding: 2px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  border: 1px inset #808080;
}
.popup-body .output {
  margin-top: 8px;
  padding: 8px;
  background: #000;
  color: #0f0;
  font-family: "Courier New", monospace;
  font-size: 18px;
  text-align: center;
  border: 2px inset #0f0;
  min-height: 26px;
}
.popup-body .progress {
  margin-top: 8px;
  height: 14px;
  background: #fff;
  border: 2px inset #c0c0c0;
  overflow: hidden;
}
.popup-body .progress .bar {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    45deg,
    #00c 0 6px,
    #66f 6px 12px
  );
  transition: width 0.2s linear;
}

.popup-foot {
  padding: 3px 6px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  font-size: 10px;
  color: #404;
  display: flex;
  justify-content: space-between;
}
.popup-foot .sponsor {
  color: #c00;
  font-weight: bold;
}

/* ---------- IRC chat popup ---------- */
.irc-window {
  position: fixed;
  top: 120px;
  left: 40px;
  width: 540px;
  max-width: calc(100vw - 20px);
  z-index: 25;
  background: #c0c0c0;
  border: 3px outset #fff;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.55);
  font-family: "Tahoma", "MS Sans Serif", sans-serif;
  font-size: 12px;
}
.irc-window.hidden { display: none; }

.irc-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(to right, #0a246a, #3a6ea5);
  cursor: grab;
  user-select: none;
}
.irc-title .irc-topic { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irc-title .pt-ctrls { display: flex; gap: 2px; }
.irc-title .pt-ctrls button {
  width: 20px;
  height: 16px;
  background: #c0c0c0;
  border: 1px outset #fff;
  font-family: "MS Sans Serif", sans-serif;
  font-weight: bold;
  cursor: pointer;
}

.irc-body {
  display: flex;
  height: 280px;
  background: #fff;
}
.irc-userlist {
  width: 140px;
  border-right: 2px inset #c0c0c0;
  background: #eef;
  padding: 4px;
  font-size: 11px;
  overflow-y: auto;
}
.irc-userlist .ul-head {
  font-weight: 700;
  font-size: 10px;
  color: #404;
  letter-spacing: 1px;
  border-bottom: 1px solid #808080;
  padding-bottom: 2px;
  margin-bottom: 4px;
}
.irc-userlist .ul-user { padding: 1px 3px; font-family: "Courier New", monospace; }
.irc-userlist .ul-user.op { color: #c00; font-weight: bold; }
.irc-userlist .ul-user.op::before { content: "@"; }

.irc-log {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: #fff;
  line-height: 1.4;
}
.irc-log .line { margin: 1px 0; }
.irc-log .ts { color: #888; }
.irc-log .sys { color: #060; }
.irc-log .user { color: #c00; font-weight: bold; }
.irc-log .user.op::before { content: "@"; }
.irc-log .body { color: #000; }
.irc-log .zh { color: #606; }

.irc-foot {
  padding: 4px 6px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 11px;
}
.irc-foot input {
  flex: 1;
  padding: 2px 4px;
  border: 1px inset #808080;
  font-family: "Courier New", monospace;
}
.irc-foot button {
  padding: 2px 8px;
  background: #c0c0c0;
  border: 1px outset #fff;
  font-family: Tahoma, sans-serif;
  cursor: pointer;
}

/* ---------- mobile: pin popups to bottom, shrink IRC ---------- */
@media (max-width: 768px) {
  .popup-rail {
    position: static;
    width: auto;
    margin: 10px;
    top: auto;
    right: auto;
  }
  .irc-window {
    position: static;
    width: auto;
    left: 0;
    top: 0;
    margin: 10px;
  }
  .irc-body { height: 220px; }
  .irc-userlist { width: 100px; }
}
