/* Midorado Web (app.midnightservices.dev). Two parts:
   1. .web-shell: the web-only screens (sign in, set up, connect, starting, expired).
   2. body.web: the desktop UI running in a browser: no window chrome, desktop-only
      settings hidden, and a phone layout (sidebar -> bottom tab bar).
   Nothing here matches in the desktop app. */

/* ===== 1. shell screens ===== */
body.web-shell {
  min-height: 100vh; margin: 0; overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(124, 92, 255, 0.22), transparent 70%),
    radial-gradient(700px 420px at 100% 110%, rgba(34, 211, 238, 0.08), transparent 70%),
    var(--bg);
  color: var(--text); font-family: var(--font); font-size: var(--fs-base);
}
.ws-wrap { min-height: 100vh; display: flex; flex-direction: column; }
/* theme.css locks html/body (the desktop app scrolls inside #view); web pages scroll the page. */
html:has(body.web-shell) { height: auto; overflow-y: auto; overflow-x: hidden; }
body.web-shell { height: auto; overflow: visible; }
.ws-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
}
.ws-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.3px; }
.ws-brand img { width: 30px; height: 30px; border-radius: 9px; }
.ws-brand b { font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-lang {
  background: var(--raised); color: var(--text-dim); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.ws-main { flex: 1; display: grid; place-items: center; padding: 24px clamp(16px, 4vw, 40px) 48px; }
.ws-foot { text-align: center; padding: 20px; color: var(--text-faint); font-size: 12px; }
.ws-foot a { color: var(--text-dim); text-decoration: none; font-weight: 600; }
.ws-foot a:hover { color: var(--text); }

.ws-hero { position: relative; max-width: 620px; text-align: center; animation: fadeUp 0.4s var(--ease) both; }
.ws-h1 {
  font-family: var(--display); font-weight: 600; letter-spacing: -1.4px; line-height: 1.04;
  font-size: clamp(36px, 7vw, 60px); margin: 0 0 18px;
}
.ws-h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.8px; line-height: 1.1; font-size: clamp(26px, 4.4vw, 36px); margin: 0 0 10px; }
.ws-lead { color: var(--text-dim); font-size: clamp(14.5px, 1.6vw, 16.5px); line-height: 1.6; margin: 0 auto 26px; max-width: 54ch; }
.ws-points { list-style: none; padding: 0; margin: 0 auto 30px; display: grid; gap: 10px; max-width: 420px; text-align: start; }
.ws-points li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-md); color: var(--text);
}
.ws-points svg { color: var(--accent-hi); flex-shrink: 0; }
.ws-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; border-radius: 12px; text-decoration: none;
  background: #5865f2; color: #fff; font-weight: 650; font-size: 15.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 30px -10px rgba(88, 101, 242, 0.9);
  transition: transform var(--trans), filter var(--trans);
}
.ws-discord:hover { filter: brightness(1.08); }
.ws-discord:active { transform: translateY(1px); }
.ws-discord:focus-visible, .ws-link:focus-visible, .ws-lang:focus-visible, .ws-input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.ws-note { color: var(--text-faint); font-size: 12.5px; line-height: 1.55; margin: 14px auto 0; max-width: 56ch; }
.ws-error { color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 auto 18px; max-width: 460px; }

/* radar rings behind the hero: the app's "midnight radar" motif */
.ws-orbit { position: absolute; inset: -140px 0 auto; height: 380px; pointer-events: none; z-index: -1; display: grid; place-items: center; }
.ws-orbit span { position: absolute; border: 1px solid rgba(157, 133, 255, 0.14); border-radius: 50%; animation: wsPulse 6s var(--ease) infinite; }
.ws-orbit span:nth-child(1) { width: 220px; height: 220px; }
.ws-orbit span:nth-child(2) { width: 380px; height: 380px; animation-delay: 1.2s; }
.ws-orbit span:nth-child(3) { width: 560px; height: 560px; animation-delay: 2.4s; }
@keyframes wsPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.ws-panel { width: 100%; max-width: 860px; animation: fadeUp 0.35s var(--ease) both; }
.ws-panel.ws-center { max-width: 520px; text-align: center; display: grid; justify-items: center; }
.ws-panel:not(.ws-center) .ws-lead, .ws-panel:not(.ws-center) .ws-note { margin-inline: 0; }
.ws-user { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--text-dim); font-size: 13px; }
.ws-user img, .ws-av { width: 30px; height: 30px; border-radius: 50%; }
.ws-av { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-weight: 700; font-size: 13px; }
.ws-user > span:not(.ws-av) { color: var(--text); font-weight: 600; }
.ws-link {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; color: var(--text-dim); font: inherit; cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.ws-link:hover { color: var(--text); background: var(--hover); }
.ws-grid { display: grid; gap: 16px; margin-top: 6px; }
.ws-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-card {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--inner);
}
.ws-card.accent { border-color: rgba(124, 92, 255, 0.45); background: radial-gradient(420px 220px at 100% 0%, rgba(124, 92, 255, 0.12), transparent 70%), var(--panel); }
.ws-card h2 { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.3px; margin: 4px 0 0; }
.ws-card p { color: var(--text-dim); line-height: 1.6; margin: 0; flex: 1; }
.ws-card-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); }
.ws-card-ic.big { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 18px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ws-actions .btn, .ws-keyform .btn, .ws-panel > .btn { text-decoration: none; }
.ws-keyform { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ws-input {
  flex: 1 1 220px; min-height: 42px; padding: 0 14px; border-radius: var(--radius-md);
  background: var(--raised); border: 1px solid var(--line-2); color: var(--text);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase;
}
.ws-input::placeholder { color: var(--text-faint); text-transform: none; }
.ws-status { min-height: 1.4em; margin: 14px 0 0; font-size: 13px; line-height: 1.5; }
.ws-status.ok { color: var(--ok); }
.ws-status.warn { color: var(--warn); }
.ws-status a { color: inherit; font-weight: 650; }
.ws-wait { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; color: var(--text-faint); font-size: 13px; }
.ws-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent-hi); animation: wsSpin 0.8s linear infinite; flex-shrink: 0; }
@keyframes wsSpin { to { transform: rotate(360deg); } }
.ws-radar { position: relative; width: 120px; height: 120px; margin-bottom: 24px; border-radius: 50%; border: 1px solid var(--line-3); background: radial-gradient(circle, rgba(124, 92, 255, 0.18), transparent 70%); overflow: hidden; }
.ws-radar span { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(157, 133, 255, 0.55), transparent 25%); animation: wsSpin 2.4s linear infinite; }
@media (max-width: 720px) {
  .ws-grid.two { grid-template-columns: minmax(0, 1fr); }
  .ws-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-orbit span, .ws-radar span, .ws-spin { animation: none; }
  .ws-hero, .ws-panel { animation: none; }
}

/* ===== 2. the app in a browser ===== */
html.web-boot #titlebar, html.web-boot #shell { visibility: hidden; }
body.web #win-min, body.web #win-max, body.web #win-close, body.web #titlebar .tb-sep { display: none; }
/* Account menu on the web: no Eldorado log-out (sign out lives in the Discord
   menu up top) and no extra-account windows (desktop Team feature). */
body.web #acct-pop .pop-accounts, body.web #acct-pop .pop-item.danger { display: none; }
/* The back button in a chat exists for phones only. */
.ch-back { display: none; }
/* Desktop-only settings: startup/tray, cloud backups, key activation, diagnostics. */
body.web #set-behavior, body.web #set-diag { display: none; }
/* The licence is shown (status, expiry, key); what belongs to a PC is not. */
body.web #set-license :is(.lic-device, .set-actions, .msg-sep, .lw-pass) { display: none; }

.web-user-wrap { position: relative; }
.web-user {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 4px;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-pill);
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.web-user:hover { border-color: var(--line-3); }
.web-user img, .web-user .ws-av { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; }
.web-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50; min-width: 220px;
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--radius-md);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6); padding: 6px;
}
.web-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: start;
}
.web-menu button:hover { background: var(--hover); }
.web-offline-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: none; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; backdrop-filter: blur(6px);
}
body.web-offline .web-offline-bar { display: flex; }

@media (max-width: 767px) {
  body.web { --tb-h: 52px; }
  html:has(body.web) { height: auto; overflow-y: auto; overflow-x: hidden; }
  body.web { height: auto; overflow: visible; }
  body.web #titlebar { position: sticky; top: 0; z-index: 45; }
  body.web #titlebar .tb-center, body.web #btn-tour, body.web .web-user-name { display: none; }
  body.web #shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: calc(100vh - var(--tb-h)); }
  body.web #sidebar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 40; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-2); border-inline-end: 0; background: var(--panel-solid);
  }
  body.web #nav { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  body.web #nav::-webkit-scrollbar { display: none; }
  body.web .nav-item { flex: 0 0 auto; flex-direction: column; gap: 3px; min-width: 64px; padding: 6px 8px; font-size: 10.5px; }
  body.web .nav-item .nl { flex: none; }
  body.web .nav-sep, body.web #side-sniper, body.web #account-chip, body.web .credit { display: none; }
  body.web #main { min-height: calc(100vh - var(--tb-h)); }
  body.web #view { padding: 18px 16px 96px; overflow: visible; }
  body.web .web-offline-bar { bottom: 64px; }
  /* Page-level layout grids stack on a phone; small stat grids keep two columns.
     Row-shaped grids (rival rows, bids, chips) stay as they are. */
  body.web :is(.grid.cols-4, .grid.cols-3, .grid.cols-2, .cc, .cc.welcome, .cfg-layout, .ch-shell, .dash-cols,
    .kw-lists, .ob-steps, .ord-grid, .orders-grid, .set-grid, .welcome-feats, .rr-quote) { grid-template-columns: minmax(0, 1fr); }
  body.web :is(.cc-stats, .riv-stats, .rr-band) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.web .game-grid { grid-template-columns: minmax(0, 1fr); }
  body.web .msg-row-head { flex-wrap: wrap; row-gap: 6px; }
  body.web .cc-radar svg { width: 120px; height: 120px; }
  body.web #toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; right: 12px; }
  /* Messages: the list, or the open chat full screen with a back button. */
  body.web .ch-back { display: inline-grid; margin-inline-end: 4px; }
  body.web .ch-shell:not(.has-thread) .ch-thread { display: none; }
  body.web .ch-shell.has-thread .ch-list { display: none; }
  body.web .ch-shell.has-thread {
    position: fixed; z-index: 35; inset: var(--tb-h) 0 calc(64px + env(safe-area-inset-bottom)) 0;
    border-radius: 0; border-inline: 0; margin: 0;
  }
  body.web .ch-shell.has-thread .ch-thread { height: 100%; display: flex; flex-direction: column; min-height: 0; }
  body.web .ch-shell.has-thread .ch-body-wrap { flex: 1; min-height: 0; }
  body.web .ch-shell:not(.has-thread) .ch-list { max-height: none; }
  body.web .cc { padding: 18px; gap: 16px; }
  body.web .cc-radar { justify-self: center; }
  body.web .cc-actions .btn { white-space: normal; height: auto; min-height: var(--h, 42px); }
  body.web table { display: block; overflow-x: auto; }
}

/* ===== 3. Midorado Web inside the desktop app (webmove.js) ===== */
body.web-remote-on #side-sniper { display: none; }
.web-card {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-top: 16px;
  border-color: rgba(124, 92, 255, 0.35);
  background: radial-gradient(520px 200px at 0% 50%, rgba(124, 92, 255, 0.14), transparent 70%), var(--panel);
}
.web-card-ic, .web-remote-ic { display: grid; place-items: center; flex-shrink: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent-hi); }
.web-card-ic { width: 48px; height: 48px; }
.web-card-txt { flex: 1; min-width: 0; }
.web-card-txt h3 { font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: -0.2px; margin: 0 0 4px; }
.web-card-txt p { color: var(--text-dim); margin: 0; line-height: 1.55; }
.web-confirm p { color: var(--text-dim); line-height: 1.6; margin: 0 0 14px; }
.web-confirm ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.web-confirm li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.web-confirm li .ico-svg { color: var(--ok); margin-top: 3px; flex-shrink: 0; }
.web-remote { max-width: 640px; margin: 40px auto 0; padding: 36px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.web-remote-ic { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 6px; }
.web-remote .page-sub { max-width: 52ch; }
.web-remote-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--raised); border: 1px solid var(--line-2); font-size: 13px; }
.web-remote-hint { color: var(--warn); font-size: 13px; max-width: 48ch; margin: 0; }
.web-remote-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
@media (max-width: 720px) { .web-card { flex-direction: column; align-items: flex-start; } .web-remote { padding: 24px 18px; } }
.ws-steps { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--text-dim); font-size: 13px; line-height: 1.5; flex-basis: 100%; }
.ws-steps li::marker { color: var(--accent-hi); font-weight: 700; }
