/* The stream page (pc.js): the remote screen and what floats over it: the
   top bar and its menu, the connecting page, the reconnecting and ended
   panels, toasts and the restart dialog. Everything is under #pc-view so
   the rest of the site's styles (style.css) cannot reach in and these
   cannot reach out.

   The sticker look of the portal: what floats is a white sticker (a thin blue
   line inside a white ring), set off from the picture by them; buttons are
   pressed in, the main one in the accent. */

#pc-view {
  /* The portal's palette (style.css :root), restated here so this page
     looks the same whatever style.css does. */
  --pc-bg: #ffffff;
  --pc-text: #1b2547;
  --pc-muted: #5f6b8e;
  --pc-fill: #e9eefb;                          /* buttons */
  --pc-fill-strong: #dbe5fb;                   /* buttons, hovered; the progress track */
  --pc-hover: rgba(79, 120, 245, 0.1);         /* on a sticker: bar buttons, menu rows */
  --pc-pressed: rgba(79, 120, 245, 0.18);
  --pc-separator: #d8e3fb;                     /* between the bar's groups */
  --pc-glass: #ffffff;                         /* the bar, the menu, panels, dialog, toasts: white stickers */
  --pc-glass-strong: #ffffff;
  --pc-blur: none;
  --pc-line: #4f78f5;                          /* a sticker: a thin blue line inside a white ring */
  --pc-ring: #ffffff;
  --pc-shadow: 0 0 0 3px #ffffff;
  --pc-shadow-sm: 0 0 0 3px #ffffff;
  --pc-radius: 12px;       /* buttons */
  --pc-radius-panel: 16px; /* the bar, the menu, toasts */
  --pc-radius-lg: 22px;    /* the dialog and the panels in the middle */
  --pc-accent: #4f78f5;
  --pc-accent-hover: #6a8cf7;
  --pc-accent-ink: #ffffff; /* text on the accent */
  --pc-accent-soft: rgba(79, 120, 245, 0.14);
  --pc-danger: #b83030;     /* red text and icons */
  --pc-danger-soft: #ffe9e9;
  --pc-green: #17a35a;
  --pc-red: #e5484d;
  --pc-grey: #8a96bb;
  --pc-note: #a06a00;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #000;
  color: var(--pc-text);
  color-scheme: light;
  font: 15px/1.45 var(--font);
  word-break: keep-all; /* Korean lines break between words */
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#pc-view [hidden] { display: none !important; }
#pc-view *, #pc-view *::before, #pc-view *::after { box-sizing: border-box; }

/* Entrances: the toast, the panels, the menu and the dialog fade in (the
   menu also drops a little into place, the dialog grows a little); they
   leave at once. */
@keyframes pc-fade-in { from { opacity: 0; } }
@keyframes pc-menu-in {
  from { opacity: 0; transform: translate(-50%, -4px); }
  to { transform: translate(-50%, 0); }
}
@keyframes pc-dialog-in { from { opacity: 0; transform: scale(0.97); } }

/* ---- the remote screen ---- */
#pc-view .pc-screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none; /* it takes the keys for the PC: no ring around the picture */
  cursor: none; /* the PC draws its own pointer */
}
/* Reconnecting or ended: the picture is frozen, the buttons must be found. */
#pc-view.reconnecting .pc-screen,
#pc-view.is-ended .pc-screen { cursor: default; }
#pc-view.is-ended .pc-screen { opacity: 0.35; }

/* The statistics (shown with a hotkey). */
#pc-view .pc-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: var(--pc-radius);
  background: rgba(28, 28, 30, 0.78);
  color: #f5f5f7;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  pointer-events: none;
}

#pc-view .pc-toast {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 6;
  width: max-content; /* as wide as its text up to max-width, not half the screen */
  max-width: min(640px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: var(--pc-radius-panel);
  background: var(--pc-glass-strong);
  -webkit-backdrop-filter: var(--pc-blur);
  backdrop-filter: var(--pc-blur);
  box-shadow: var(--pc-shadow-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  animation: pc-fade-in 0.2s ease-out;
}

/* ---- reconnecting / ended panels ---- */
#pc-view .pc-reconnect,
#pc-view .pc-ended {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 24px 24px 20px;
  border-radius: var(--pc-radius-lg);
  background: var(--pc-glass-strong);
  -webkit-backdrop-filter: var(--pc-blur);
  backdrop-filter: var(--pc-blur);
  box-shadow: var(--pc-shadow);
  text-align: center;
  transform: translate(-50%, -50%);
  cursor: default;
  animation: pc-fade-in 0.2s ease-out;
}
#pc-view .pc-reconnect p,
#pc-view .pc-ended p { margin: 0 0 6px; }
#pc-view .pc-note { color: var(--pc-note); font-weight: 600; }
#pc-view .pc-ended-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
#pc-view .pc-ended-reason { color: var(--pc-muted); overflow-wrap: anywhere; }
#pc-view .pc-ended-reason:empty { display: none; }

/* Text buttons: a tinted fill, the main one in the accent, a destructive
   one in red on a red tint. */
#pc-view .pc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
#pc-view .pc-action {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--pc-radius);
  background: var(--pc-fill);
  color: var(--pc-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
/* Hover only where there is a pointer to hover with: on a touch screen a
   tapped button would stay lit. */
@media (hover: hover) {
  #pc-view .pc-action:hover { background: var(--pc-fill-strong); }
  #pc-view .pc-action.primary:hover { background: var(--pc-accent-hover); }
  #pc-view .pc-action.danger:hover { background: rgba(255, 69, 58, 0.24); }
}
#pc-view .pc-action:active { opacity: 0.8; }
#pc-view .pc-action.primary { background: var(--pc-accent); color: var(--pc-accent-ink); }
#pc-view .pc-action.danger { background: var(--pc-danger-soft); color: var(--pc-danger); }
#pc-view .pc-action:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }

/* ---- connecting: the full screen loading page ----
   Shown from the first attempt until the first picture is drawn
   (#pc-view.is-loading). It is frosted glass over the screen, so when the
   picture arrives it comes into focus as the glass fades away. */
#pc-view .pc-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, #f5f8ff, #e3ecff);
  cursor: default;
  transition: opacity 0.5s ease, -webkit-backdrop-filter 0.5s ease, backdrop-filter 0.5s ease, visibility 0s linear 0s;
}
#pc-view:not(.is-loading) .pc-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: opacity 0.5s ease, -webkit-backdrop-filter 0.5s ease, backdrop-filter 0.5s ease, visibility 0s linear 0.5s;
}
#pc-view.is-loading .pc-toast { display: none; } /* the loader says the same */
#pc-view.reconnecting .pc-loader .pc-actions { visibility: hidden; }

#pc-view .pc-loader-body { width: min(420px, 100%); text-align: center; }
#pc-view .pc-loader-kicker {
  margin: 0 0 8px;
  color: var(--pc-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
#pc-view .pc-loader-name {
  margin: 0;
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#pc-view .pc-loader-track {
  position: relative;
  height: 4px;
  margin: 28px 0 14px;
  border-radius: 999px;
  background: var(--pc-fill-strong);
  overflow: hidden;
}
#pc-view .pc-loader-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 28%;
  border-radius: inherit;
  background: var(--pc-accent);
  overflow: hidden;
  transition: width 0.7s cubic-bezier(0.22, 0.8, 0.3, 1);
}
#pc-view .pc-loader[data-step="2"] .pc-loader-fill { width: 66%; }
#pc-view .pc-loader[data-step="3"] .pc-loader-fill { width: 100%; }
/* A soft highlight sweeps along the bar so it never looks stuck. */
#pc-view .pc-loader-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: pc-loader-sweep 1.5s ease-in-out infinite;
}
@keyframes pc-loader-sweep { to { transform: translateX(100%); } }
#pc-view .pc-loader-msg {
  min-height: 2.9em; /* two lines, so the bar does not jump when the text changes */
  margin: 0;
  color: var(--pc-muted);
  overflow-wrap: anywhere;
}
#pc-view .pc-loader .pc-actions { margin-top: 12px; }

/* ---- the top bar ---- */
#pc-view .pc-bar {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--pc-radius-panel);
  background: var(--pc-glass);
  -webkit-backdrop-filter: var(--pc-blur);
  backdrop-filter: var(--pc-blur);
  box-shadow: var(--pc-shadow-sm);
  transform: translateX(-50%);
  transition: opacity 0.15s ease, visibility 0s linear 0s;
}
/* Hidden: out of reach (no clicks, no focus). It only fades: a bar that
   slid in would let a quick click at its place land on the stream. */
#pc-view .pc-bar.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

#pc-view .pc-btn {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--pc-radius);
  color: var(--pc-text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
@media (hover: hover) {
  #pc-view .pc-btn:hover { background: var(--pc-hover); }
  #pc-view .pc-btn.danger:hover:not(:disabled) { background: var(--pc-danger-soft); color: var(--pc-danger); }
}
#pc-view .pc-btn:active { background: var(--pc-pressed); }
#pc-view .pc-btn:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 1px; }
/* A toggle that is on (the pin) is tinted with the accent, a button whose
   menu is open stays pressed, and game mode holding the mouse colours its
   icon. */
#pc-view .pc-btn[aria-pressed="true"] { background: var(--pc-accent-soft); color: var(--pc-accent); }
#pc-view .pc-btn[aria-expanded="true"] { background: var(--pc-pressed); }
#pc-view .pc-btn.is-active { color: var(--pc-accent); }
#pc-view .pc-btn:disabled { background: none; opacity: 0.4; cursor: default; }

#pc-view .pc-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Permission dot: green allowed, red blocked or not asked yet, grey unknown.
   The clipboard's dot is about this PC: on (green), off (red), or not
   possible here (grey, "na"): someone else's PC, or no clipboard. A clear
   gap is cut into the icon around the dot (no ring, which would show as an
   outline on the glass over a bright picture). The dot's centre is at
   17px of the 18px icon on 34px and 30px buttons (the dot moves in with
   the smaller one); the 40px touch buttons leave room without a gap. */
#pc-view .pc-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc-grey);
}
#pc-view .pc-perm .pc-icon {
  -webkit-mask: radial-gradient(circle at 17px 17px, transparent 6px, #000 6.5px);
  mask: radial-gradient(circle at 17px 17px, transparent 6px, #000 6.5px);
}
#pc-view .pc-dot[data-state="granted"],
#pc-view .pc-dot[data-state="on"] { background: var(--pc-green); }
#pc-view .pc-dot[data-state="denied"],
#pc-view .pc-dot[data-state="prompt"],
#pc-view .pc-dot[data-state="off"] { background: var(--pc-red); }

/* Between the bar's groups: a short hairline inside the bar, not an edge. */
#pc-view .pc-sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 4px;
  border-radius: 1px;
  background: var(--pc-separator);
}

/* ---- game mode menu ---- */
#pc-view .pc-menu-anchor { position: relative; display: inline-flex; }
#pc-view .pc-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 240px;
  padding: 6px;
  border-radius: var(--pc-radius-panel);
  background: var(--pc-glass-strong);
  -webkit-backdrop-filter: var(--pc-blur);
  backdrop-filter: var(--pc-blur);
  box-shadow: var(--pc-shadow);
  font-size: 14px;
  transform: translateX(-50%);
  animation: pc-menu-in 0.15s ease-out;
}
/* Lined up with the item labels (8 + the 18 check column + 8). */
#pc-view .pc-menu-title { padding: 4px 10px 6px 34px; color: var(--pc-muted); font-size: 12px; font-weight: 600; }
#pc-view .pc-menu-item {
  all: unset;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  border-radius: 8px; /* the menu's 14 less the 6 around it */
  cursor: pointer;
  transition: background-color 0.15s ease;
}
@media (hover: hover) {
  #pc-view .pc-menu-item:hover { background: var(--pc-hover); }
}
#pc-view .pc-menu-item:active { background: var(--pc-pressed); }
#pc-view .pc-menu-item:focus-visible { background: var(--pc-hover); outline: 2px solid var(--pc-accent); outline-offset: -2px; }
#pc-view .pc-menu-item .pc-icon { grid-row: span 2; width: 16px; height: 16px; color: var(--pc-accent); stroke-width: 2.4; }
#pc-view .pc-menu-item[aria-checked="false"] .pc-icon { visibility: hidden; }
#pc-view .pc-menu-label { font-weight: 600; }
#pc-view .pc-menu-hint { grid-column: 2; color: var(--pc-muted); font-size: 12px; }

/* ---- restart confirmation ---- */
#pc-view .pc-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 24px 24px 20px;
  border: 0; /* the browser gives a dialog one */
  border-radius: var(--pc-radius-lg);
  background: var(--pc-glass-strong);
  -webkit-backdrop-filter: var(--pc-blur);
  backdrop-filter: var(--pc-blur);
  color: var(--pc-text);
  box-shadow: var(--pc-shadow);
  cursor: default;
  animation: pc-dialog-in 0.2s ease-out;
}
/* Plain values, no --pc tokens: not every browser lets ::backdrop inherit them. */
#pc-view .pc-dialog::backdrop {
  background: rgba(8, 14, 43, 0.45);
  animation: pc-fade-in 0.2s ease-out;
}
#pc-view .pc-dialog h2 { margin: 0 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
#pc-view .pc-dialog p { margin: 0 0 6px; color: var(--pc-muted); }
#pc-view .pc-dialog-hint { font-size: 13px; }
#pc-view .pc-dialog .pc-actions { justify-content: flex-end; margin-top: 20px; }

/* Narrow screens: the bar has to fit (9 buttons in 288px leave 16px on
   each side of a 320px screen), and the dialog's buttons stack, the main
   one on top. */
@media (max-width: 460px) {
  #pc-view .pc-bar { gap: 0; padding: 3px; border-radius: 12px; }
  #pc-view .pc-btn { width: 30px; height: 30px; border-radius: 9px; }
  /* The dot moves with the smaller button, so it sits on the icon where it
     does on 34px buttons and the same cut-out fits (centre at 17px). */
  #pc-view .pc-dot { right: 3px; bottom: 3px; }
  #pc-view .pc-sep { margin: 0 1px; }
}
@media (max-width: 520px) {
  #pc-view .pc-dialog .pc-actions { flex-direction: column-reverse; }
  #pc-view .pc-dialog .pc-action { width: 100%; }
}
/* Touch: bigger targets where they fit. */
@media (pointer: coarse) {
  #pc-view .pc-action { min-height: 44px; }
}
@media (pointer: coarse) and (min-width: 600px) {
  #pc-view .pc-btn { width: 40px; height: 40px; }
  #pc-view .pc-perm .pc-icon { -webkit-mask: none; mask: none; }
}

@media (prefers-reduced-motion: reduce) {
  #pc-view .pc-bar,
  #pc-view .pc-bar.is-hidden,
  #pc-view .pc-loader,
  #pc-view:not(.is-loading) .pc-loader,
  #pc-view .pc-loader-fill { transition: none; }
  #pc-view .pc-loader-fill::after,
  #pc-view .pc-toast,
  #pc-view .pc-reconnect,
  #pc-view .pc-ended,
  #pc-view .pc-menu,
  #pc-view .pc-dialog { animation: none; }
  #pc-view .pc-dialog::backdrop { animation: none; }
}

/* No blur available, or asked not to: solid surfaces. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #pc-view .pc-loader { background-color: var(--pc-bg); }
}
@media (prefers-reduced-transparency: reduce) {
  #pc-view .pc-loader { background-color: var(--pc-bg); }
  #pc-view .pc-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
}

/* Forced colours (e.g. Windows high contrast) put the system's colours in
   place of the fills and drop the shadows, so what floats gets an edge,
   the buttons get theirs back and the states use the system highlight. */
@media (forced-colors: active) {
  #pc-view .pc-bar,
  #pc-view .pc-menu,
  #pc-view .pc-dialog,
  #pc-view .pc-toast,
  #pc-view .pc-reconnect,
  #pc-view .pc-ended,
  #pc-view .pc-hud { border: 1px solid CanvasText; background: Canvas; }
  #pc-view .pc-loader { background: Canvas; }
  #pc-view .pc-btn,
  #pc-view .pc-action { border: 1px solid ButtonText; }
  #pc-view .pc-btn.is-active { color: Highlight; }
  #pc-view .pc-btn[aria-pressed="true"],
  #pc-view .pc-btn[aria-expanded="true"],
  #pc-view .pc-menu-item:hover,
  #pc-view .pc-menu-item:focus-visible { background: Highlight; color: HighlightText; }
  #pc-view .pc-btn:focus-visible,
  #pc-view .pc-action:focus-visible,
  #pc-view .pc-menu-item:focus-visible { outline-color: Highlight; }
  #pc-view .pc-sep { background: CanvasText; }
  #pc-view .pc-loader-track { outline: 1px solid CanvasText; }
  #pc-view .pc-loader-fill { background: Highlight; }
  #pc-view .pc-dot { forced-color-adjust: none; right: 4px; bottom: 4px; } /* its colour is what it says; 1px in for the button's border */
}
@media (forced-colors: active) and (max-width: 460px) {
  #pc-view .pc-dot { right: 2px; bottom: 2px; }
}

/* ---- the sticker edges and the connecting card ---- */
#pc-view .pc-bar,
#pc-view .pc-menu,
#pc-view .pc-toast,
#pc-view .pc-reconnect,
#pc-view .pc-ended,
#pc-view .pc-dialog { border: 1.5px solid var(--pc-line); }
/* The connecting page: paper, with the card in the middle (the name of the site on top). */
#pc-view .pc-loader-body {
  padding: 26px 26px 22px;
  border: 1.5px solid var(--pc-line);
  border-radius: var(--pc-radius-lg);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--pc-ring);
}
#pc-view .pc-loader-body::before {
  content: "달콤한호스팅";
  display: block;
  width: fit-content;
  margin: 0 auto 14px;
  padding-left: 30px;
  background: url("/static/img/favicon.svg") no-repeat left center / 24px 24px;
  color: var(--pc-text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 26px;
}
#pc-view .pc-loader-fill { background: var(--pc-accent); }
/* Buttons: a thin edge, the main one pressed in with a hard edge under it. */
#pc-view .pc-action { border: 1.5px solid var(--pc-separator); background: #ffffff; }
#pc-view .pc-action.primary { border-color: var(--pc-accent); background: var(--pc-accent); color: var(--pc-accent-ink); box-shadow: 0 3px 0 #2f4fb8; }
#pc-view .pc-action.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #2f4fb8; opacity: 1; }
#pc-view .pc-action.danger { border-color: #ffc2c2; }

/* ---- connecting, as it is now: plain black, a big title, a big bar, and the name of the PC under it (loaded last) ---- */
#pc-view .pc-loader { background: #000; color: #fff; }
#pc-view .pc-loader-body { width: min(720px, 100%); padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#pc-view .pc-loader-body::before { content: none; }
#pc-view .pc-loader-title { margin: 0; color: #fff; font-size: clamp(40px, 11vw, 88px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
#pc-view .pc-loader-track { height: 14px; margin: 40px 0 22px; background: rgba(255, 255, 255, 0.16); }
#pc-view .pc-loader-name { margin: 0 0 6px; color: #fff; font-size: clamp(20px, 4vw, 28px); font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
#pc-view .pc-loader-msg { color: rgba(255, 255, 255, 0.65); }
#pc-view .pc-loader .pc-action { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); }

/* ---- the dark mode (the same pick as the portal: data-theme, or the system with no pick) ---- */
:root[data-theme="dark"] #pc-view {
  color-scheme: dark;
  --pc-bg: #2c2c2e;
  --pc-text: #f5f5f7;
  --pc-muted: #b0b0b6;
  --pc-fill: rgba(118, 118, 128, 0.28);
  --pc-fill-strong: rgba(118, 118, 128, 0.42);
  --pc-hover: rgba(255, 255, 255, 0.08);
  --pc-pressed: rgba(255, 255, 255, 0.14);
  --pc-separator: rgba(84, 84, 88, 0.8);
  --pc-glass: #2c2c2e;
  --pc-glass-strong: #2c2c2e;
  --pc-line: #6f93f7;
  --pc-ring: #3a3a3c;
  --pc-shadow: 0 0 0 3px #3a3a3c;
  --pc-shadow-sm: 0 0 0 3px #3a3a3c;
  --pc-accent: #ffd43b; /* the main button is yellow in the dark, as in the portal */
  --pc-accent-hover: #ffe074;
  --pc-accent-ink: #1b2547;
  --pc-accent-soft: rgba(255, 212, 59, 0.18);
  --pc-danger: #ff8a8a;
  --pc-danger-soft: rgba(255, 90, 90, 0.18);
}
:root[data-theme="dark"] #pc-view .pc-action { background: #2c2c2e; }
:root[data-theme="dark"] #pc-view .pc-action.primary { box-shadow: 0 3px 0 #c99700; }
:root[data-theme="dark"] #pc-view .pc-action.primary:active { box-shadow: 0 1px 0 #c99700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #pc-view {
    color-scheme: dark;
    --pc-bg: #2c2c2e;
    --pc-text: #f5f5f7;
    --pc-muted: #b0b0b6;
    --pc-fill: rgba(118, 118, 128, 0.28);
    --pc-fill-strong: rgba(118, 118, 128, 0.42);
    --pc-hover: rgba(255, 255, 255, 0.08);
    --pc-pressed: rgba(255, 255, 255, 0.14);
    --pc-separator: rgba(84, 84, 88, 0.8);
    --pc-glass: #2c2c2e;
    --pc-glass-strong: #2c2c2e;
    --pc-line: #6f93f7;
    --pc-ring: #3a3a3c;
    --pc-shadow: 0 0 0 3px #3a3a3c;
    --pc-shadow-sm: 0 0 0 3px #3a3a3c;
    --pc-accent: #ffd43b; /* the main button is yellow in the dark, as in the portal */
    --pc-accent-hover: #ffe074;
    --pc-accent-ink: #1b2547;
    --pc-accent-soft: rgba(255, 212, 59, 0.18);
    --pc-danger: #ff8a8a;
    --pc-danger-soft: rgba(255, 90, 90, 0.18);
  }
  :root:not([data-theme="light"]) #pc-view .pc-action { background: #2c2c2e; }
  :root:not([data-theme="light"]) #pc-view .pc-action.primary { box-shadow: 0 3px 0 #c99700; }
  :root:not([data-theme="light"]) #pc-view .pc-action.primary:active { box-shadow: 0 1px 0 #c99700; }
}
/* the connecting page keeps its own black look in both */
#pc-view .pc-loader .pc-action { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
#pc-view .pc-loader-title { font-family: "BM Hanna", var(--font); font-weight: 400; letter-spacing: 0; }

/* ---- connecting: no bar; coloured circles pop around the title, more and more of them (pc.js startPops) ---- */
#pc-view .pc-loader-track { display: none; }
#pc-view .pc-loader-title { margin-bottom: 36px; }
#pc-view .pc-pops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#pc-view .pc-loader-body { position: relative; z-index: 1; }
#pc-view .pc-pop {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--d, 60px);
  height: var(--d, 60px);
  margin: calc(var(--d, 60px) / -2) 0 0 calc(var(--d, 60px) / -2);
  border-radius: 50%;
  background: #ff8fb1;
  animation: pc-pop 0.85s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
#pc-view .pc-pop-c0 { background: #ff8fb1; }
#pc-view .pc-pop-c1 { background: #6f93f7; }
#pc-view .pc-pop-c2 { background: #ffd43b; }
#pc-view .pc-pop-c3 { background: #ffffff; }
#pc-view .pc-pop-c4 { background: #5ee08a; }
#pc-view .pc-pop-c5 { background: #c792ea; }
/* A pop: it jumps out of nothing, overshoots, then bursts into a ring and is gone. */
@keyframes pc-pop {
  0% { transform: scale(0); opacity: 0.9; }
  25% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
/* A spark of a burst: flies out from where the burst was (--dx, --dy), shrinking and fading. */
#pc-view .pc-spark {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--d, 20px);
  height: var(--d, 20px);
  margin: calc(var(--d, 20px) / -2) 0 0 calc(var(--d, 20px) / -2);
  border-radius: 50%;
  animation: pc-spark 1s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
@keyframes pc-spark {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { #pc-view .pc-pop, #pc-view .pc-spark { animation: none; opacity: 0; } }
