/* Molecularium, second version (2026-12-03). Source: ~/molecularium/site/molecularium.css.
   Colors: cyan (#7ef9ff) is the instrument and the current choice (the pore's glow, the trace, the chosen scale, focus);
   magenta (#ff4fd8) is an event (a spike in the trace, the pore while something passes, a decade just filled); the six
   family colors are the Everything list's; controls are dark glass so the water shows through. */
:root { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: #0a0630; color: #f3f0ff; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; overscroll-behavior: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mc-loading, .mc-noscript { position: fixed; left: 0; right: 0; top: 42%; text-align: center; font-size: 15px; color: #b9b2e8; margin: 0; padding: 0 16px; }
.mc-noscript a { color: #7ef9ff; }

/* The game fills the window under the site's corner button (the site bar's host sits at z-index 60). */
.mc {
  position: fixed; inset: 0; z-index: 10; touch-action: none; user-select: none; -webkit-user-select: none;
  --mc-band: 0px; --mc-trace: 64px; --mc-memy: 600px; --cyan: #7ef9ff; --magenta: #ff4fd8; --muted: #b9b2e8;
  --glass: rgba(10, 8, 40, 0.58); --edge: rgba(126, 249, 255, 0.3);
}
.mc-c { position: absolute; inset: 0; display: block; touch-action: none; cursor: pointer; }
.mc button { font-family: inherit; }
.mc :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* top left: analytes found and the decades they were first measured in */
.mc-hud { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--mc-band) + 8px); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.mc-count { display: inline-flex; align-items: center; gap: 6px; font: 700 15px/1 system-ui, sans-serif; background: var(--glass); border: 1px solid rgba(126, 249, 255, 0.35);
  padding: 5px 10px 5px 6px; border-radius: 999px; width: max-content; font-variant-numeric: tabular-nums; }
.mc-count svg { width: 18px; height: 18px; }
.mc-decades { display: flex; gap: 4px; }
.mc-dec { font: 700 9.5px/1 system-ui, sans-serif; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  color: rgba(255, 255, 255, 0.45); border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(10, 8, 40, 0.5); transition: all 0.3s; }
.mc-dec.on { color: #0a0630; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(126, 249, 255, 0.8); }
.mc-dec.flash { animation: mcFlash 0.9s ease-out; }
@keyframes mcFlash { 0% { transform: scale(1.8); background: var(--magenta); } 100% { transform: scale(1); } }

/* top right: sound */
.mc-tools { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(var(--mc-band) + 8px); display: flex; gap: 8px; }
.mc-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); background: var(--glass); color: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mc-btn svg { width: 21px; height: 21px; }
.mc-btn[aria-pressed="false"] { color: rgba(255, 255, 255, 0.55); }

/* the scale: one small pill above the membrane at the left; its five choices open upward and close after a choice */
.mc-scale { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--mc-memy) - 38px); }
.mc-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 8px; border-radius: 999px; border: 1px solid var(--edge);
  background: var(--glass); color: #dff9ff; font: 600 12px/1 system-ui, sans-serif; letter-spacing: 0.01em; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: border-color 0.2s, color 0.2s; }
.mc-pill:hover, .mc-pill[aria-expanded="true"] { border-color: rgba(126, 249, 255, 0.7); color: #fff; }
.mc-pill svg { flex: none; }
.mc-ruler { width: 14px; height: 14px; color: var(--cyan); }
.mc-chev { width: 10px; height: 10px; opacity: 0.7; transition: transform 0.2s; }
.mc-pill[aria-expanded="true"] .mc-chev { transform: rotate(180deg); }
.mc-pill.is-loading .mc-ruler { animation: mcPulse 0.9s ease-in-out infinite alternate; }
@keyframes mcPulse { to { opacity: 0.25; } }
.mc-menu { position: absolute; left: 0; bottom: calc(100% + 6px); min-width: 200px; width: max-content; padding: 4px; border-radius: 10px; display: grid; gap: 2px;
  background: rgba(10, 8, 40, 0.8); border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.mc-menu.side { left: calc(100% + 8px); bottom: 0; }
.mc-menu[hidden] { display: none; }
.mc-opt span { white-space: nowrap; }
.mc-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%; text-align: left; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, 0.82); font: 500 13px/1.1 system-ui, sans-serif; cursor: pointer; }
.mc-opt:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.mc-opt[aria-checked="true"] { color: var(--cyan); border-color: rgba(126, 249, 255, 0.45); background: rgba(126, 249, 255, 0.08); }
.mc-opt small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-opt[aria-checked="true"] small { color: rgba(126, 249, 255, 0.75); }

/* finds: cards rise from the pore into the top half, fade after a few seconds, wait while hovered, stay when clicked */
.mc-cards { position: absolute; left: 50%; top: var(--mc-cards-top, 106px); transform: translateX(-50%);
  width: min(400px, calc(100% - 20px)); max-height: var(--mc-cards-max, 40vh); display: grid; gap: 8px; align-content: start; pointer-events: none; }
@media (min-width: 900px) { .mc-cards { width: min(816px, calc(100% - 140px)); grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); } }
.mc-card { pointer-events: auto; position: relative; overflow: hidden; cursor: pointer; padding: 10px 12px 11px; border-radius: 14px; color: #f3f0ff;
  background: rgba(12, 9, 46, 0.72); border: 1px solid rgba(255, 255, 255, 0.22); border-color: color-mix(in srgb, var(--fam) 55%, transparent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.2s; }
.mc-card.pinned { cursor: default; background: rgba(12, 9, 46, 0.88); user-select: text; -webkit-user-select: text; }
.mc-card.out { opacity: 0; transform: translateY(-8px) scale(0.98); }
.mc-head { display: flex; gap: 10px; align-items: center; }
.mc-pic { width: 44px; height: 44px; flex: none; background: rgba(255, 255, 255, 0.92); border-radius: 10px; padding: 3px; box-sizing: border-box; }
.mc-title { min-width: 0; flex: 1; }
.mc-name { font-size: 15px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.mc-kind { font-size: 12px; line-height: 1.25; color: var(--muted); margin: 2px 0 0; }
.mc-x { display: none; flex: none; align-self: flex-start; width: 26px; height: 26px; margin: -4px -6px 0 0; border-radius: 50%; border: 0;
  background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 19px; line-height: 1; cursor: pointer; place-items: center; padding: 0; }
.mc-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.mc-card.pinned .mc-x { display: grid; }
.mc-year { margin: 8px 0 4px; font-size: 13px; color: #d9d4ff; }
.mc-year strong { font-size: 19px; color: var(--cyan); margin-left: 3px; }
.mc-size { margin-left: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(126, 249, 255, 0.35); color: #dff9ff; font-size: 12px; white-space: nowrap; }
.mc-paper { margin: 0; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-card.pinned .mc-paper { -webkit-line-clamp: unset; display: block; }
.mc-paper a { color: #ffb3f0; }
.mc-meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.mc-fact { margin: 5px 0 0; font-size: 12px; line-height: 1.3; color: #cfc9f5; overflow-wrap: anywhere; }
.mc-more { display: none; }
.mc-card.pinned .mc-more { display: block; }
.mc-score { margin: 6px 0 0; font-size: 12px; color: #fff; }
.mc-note { margin: 4px 0 0; font-size: 11px; color: #9d96cf; }
.mc-links { margin: 6px 0 0; font-size: 12px; }
.mc-links a { color: var(--cyan); }
.mc-life { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--fam, var(--cyan)); opacity: 0.75; transform-origin: left; }
.mc-card.pinned .mc-life { display: none; }
/* while the live band leaves little room: short cards beside the pore (wide screens) or under the band (phones);
   a clicked card opens in full and scrolls */
.mc-short .mc-cards { left: var(--mc-cards-left, 8px); width: var(--mc-cards-w, 320px); transform: none; grid-template-columns: 1fr; }
.mc-short .mc-card:not(.pinned) :is(.mc-paper, .mc-meta, .mc-fact, .mc-score, .mc-note, .mc-links) { display: none; }
.mc-short .mc-card:not(.pinned) .mc-year { margin-bottom: 0; }
.mc-short .mc-card.pinned { max-height: var(--mc-pin-max, 60vh); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
@media (max-width: 640px) {
  .mc-cards { width: calc(100% - 16px); }
  .mc-card { padding: 8px 10px 9px; }
  .mc-pic { width: 38px; height: 38px; }
  .mc-name { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mc-card, .mc-chev, .mc-dec, .mc-pill { transition: none; } .mc-dec.flash, .mc-pill.is-loading .mc-ruler { animation: none; } }
