/* Quiet chrome — sphere/quiet-chrome.js. Bare glyphs, no plates: the sphere is
   the whole screen and the chrome stays out of its way. Ink follows page
   chrome via body[data-sphere-chrome]. */
.quiet-chrome {
  --qc-ink: #111318;
  --qc-halo: rgba(255, 255, 255, 0.85);
  --qc-armed: #e5222a;
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
body[data-sphere-chrome="dark"] .quiet-chrome {
  --qc-ink: #f2f6fb;
  --qc-halo: rgba(0, 0, 0, 0.7);
}

/* Legacy HUD stays in the DOM for sphere.js wiring; this chrome replaces it. */
body.quiet-chrome-ui .hud-cluster,
body.quiet-chrome-ui .hud-help-fixed {
  display: none !important;
  pointer-events: none !important;
}

.qc-stats {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.1rem;
  color: var(--qc-ink);
  opacity: 0.62;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 0 6px var(--qc-halo), 0 0 2px var(--qc-halo);
}
.qc-stat { display: inline-flex; align-items: center; gap: 0.35rem; }
.qc-stat svg { width: 14px; height: 14px; opacity: 0.8; }
.qc-stat b { font-weight: 600; min-width: 2ch; }

/* The mine count is a door: hold it and water rises through the readout;
   hold through the fill and the Water Wheel opens (quiet-chrome.js). */
.qc-egg-door {
  position: relative;
  padding: 0.35rem 0.55rem;
  margin: -0.35rem -0.55rem;
  border-radius: 999px;
  pointer-events: auto;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overflow: hidden;
  isolation: isolate;
}
.qc-egg-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(to top, rgba(28, 120, 150, 0.55), rgba(143, 233, 242, 0.35));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.9s linear;
}
.qc-egg-door.is-hinting::after { transform: scaleY(1); }
.qc-egg-door.is-hinting { color: var(--qc-ink); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .qc-egg-door::after { transition: none; }
}
.qc-egg-btn {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  pointer-events: auto;
}
.qc-egg-btn:focus-visible {
  position: fixed !important;
  top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, 2.2rem);
  width: auto; height: auto; padding: 0.4rem 0.8rem; margin: 0; clip: auto;
  border-radius: 999px; background: var(--qc-halo); color: var(--qc-ink);
  outline: 2px solid var(--qc-ink); font: inherit;
}

.qc-bar {
  position: absolute;
  left: max(10px, calc(env(safe-area-inset-left, 0px) + 8px));
  right: max(10px, calc(env(safe-area-inset-right, 0px) + 8px));
  bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) + 6px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.qc-group { display: flex; gap: 6px; pointer-events: auto; }
.qc-btn {
  appearance: none;
  width: 48px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--qc-ink);
  opacity: 0.66;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 0 3px var(--qc-halo)) drop-shadow(0 0 1px var(--qc-halo));
  transition: opacity 0.16s ease, transform 0.12s ease, color 0.16s ease;
}
.qc-btn svg { width: 26px; height: 26px; }
.qc-btn:hover, .qc-btn:focus-visible { opacity: 1; outline: none; }
.qc-btn:focus-visible { box-shadow: 0 0 0 3px #7fc4f2; }
.qc-btn:active { transform: scale(0.94); }
.qc-btn.is-idle { opacity: 0.32; }
.qc-btn.is-armed { color: var(--qc-armed); opacity: 1; }
.qc-help { opacity: 0.6; }

.qc-live {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  margin: -1px !important;
}

@media (hover: none) and (pointer: coarse) {
  .qc-btn { width: 52px; height: 56px; opacity: 0.72; }
  .qc-btn svg { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .qc-btn { transition: none; }
}
@media (forced-colors: active) {
  .qc-btn { border: 1px solid ButtonText; }
  .qc-btn.is-armed { color: Highlight; }
}
