/*
Copyright 2026 the Spiral authors. AGPL-3.0-or-later.

The web player's page: a quiet bar, the phones, nothing else. Its own
system fonts only — the player loads nothing from anywhere but itself.
*/

:root {
  color-scheme: light dark;
  --ink: #1c1c1e;
  --ink2: #6c6c70;
  --panel: #ffffff;
  --hair: rgb(60 60 67 / 0.18);
  --accent: #2e6be6;
  --chip: rgb(46 107 230 / 0.1);
}
/* `theme=light`: a host page that is light only (the landing) keeps the
   player light, so the frame never paints a dark canvas inside it. */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ffffff;
    --ink2: #aeaeb2;
    --panel: #1c1c1e;
    --hair: rgb(235 235 245 / 0.18);
    --accent: #4c8dff;
    --chip: rgb(76 141 255 / 0.16);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink);
  font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px 6px;
}
.note { flex: 1 1 auto; min-width: 0; color: var(--ink2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tools { display: flex; gap: 6px; flex: none; }
.bar button, .tabs button {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.bar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs { display: none; flex: none; padding: 2px; border-radius: 999px; background: var(--chip); }
.tabs button { border: 0; background: transparent; color: var(--ink2); min-height: 28px; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
body.single .tabs { display: flex; }
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4px 8px 8px;
}
.fit { position: relative; flex: none; }
.phones {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  transform-origin: 0 0;
}
.phone { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.phone.away { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.bubble { background: var(--panel); border-radius: 22px; padding: 5px; box-shadow: 0 2px 10px rgb(20 35 80 / 0.14); }
.bubble iframe { display: block; border: 0; border-radius: 18px; background: transparent; }
.phone.loading .bubble { background-image: linear-gradient(100deg, transparent 30%, rgb(127 127 127 / 0.08) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
figcaption { height: 20px; color: var(--ink2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.failed { margin: 24px 16px; color: var(--ink2); text-align: center; }
.cta {
  align-self: center;
  margin: 0 0 14px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) { .phone.loading .bubble { animation: none; } }

/* A host page that says it all already (`chrome=lite`), and a lone phone. */
:root[data-chrome="lite"] .note, :root[data-chrome="lite"] .count { display: none; }
:root[data-chrome="lite"] .bar { justify-content: flex-start; }
body.one-phone figcaption { display: none; }
