/* Styling for the standalone Sphere demo */
.sphere-wrap { width: min(100% - 2rem, 1000px); padding-block: 22px 56px; }
.sphere-header,
.sphere-panel {
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sphere-header { margin-bottom: 16px; }
.sphere-header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1.12; letter-spacing: -0.045em; }
.sphere-subtitle { margin: 10px 0 0; color: var(--muted); font-size: 1.08rem; }
.sphere-byline { margin: 14px 0 0; color: var(--muted); font-size: 0.92rem; }
.sphere-page a { color: #405d61; font-weight: 580; text-decoration: none; }
.sphere-page a:hover { border-radius: 4px; background: #edf4f2; color: var(--accent-strong); }
.sphere-panel + .sphere-panel { margin-top: 16px; }
.sphere-panel h2 { margin: 0 0 14px; font-size: clamp(1.25rem, 2.5vw, 1.6rem); line-height: 1.25; letter-spacing: -0.025em; }
.sphere-panel h3 { margin: 26px 0 10px; font-size: 1.08rem; line-height: 1.3; }
.sphere-panel p { margin: 0 0 14px; }
.sphere-panel p:last-child { margin-bottom: 0; }
.sphere-help { color: var(--muted); }
.sphere-player { width: min(100%, 643px); margin: 20px auto 26px; }
.sphere-player object,
.sphere-player ruffle-player,
.sphere-player ruffle-object {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 643 / 466;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sphere-player-doodle { max-width: 600px; }
.sphere-player-doodle object,
.sphere-player-doodle ruffle-player,
.sphere-player-doodle ruffle-object { aspect-ratio: 2 / 1; }
.sphere-doodle-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}
.sphere-doodle-canvas:focus-visible { outline: 3px solid #7da4a1; outline-offset: 3px; }
.sphere-demo-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sphere-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 24px; margin: 0; padding-left: 1.25rem; }
.sphere-view-labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; text-align: center; color: var(--muted); font-size: 0.93rem; }
.sphere-view-labels strong { color: var(--ink); }
.sphere-equation { margin: 18px 0 !important; text-align: center; font-weight: 650; overflow-wrap: anywhere; }
.sphere-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.sphere-coordinate-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.sphere-coordinate-table th,
.sphere-coordinate-table td { width: 50%; padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sphere-coordinate-table th { background: var(--surface-soft); color: var(--ink); text-align: center; }
.sphere-coordinate-table tr:last-child td { border-bottom: 0; }
.sphere-resources { margin-bottom: 0; padding-left: 1.25rem; }
.sphere-resources li + li { margin-top: 8px; }
.sphere-page noscript p { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 560px) {
  .sphere-controls { grid-template-columns: 1fr; gap: 4px; }
  .sphere-view-labels { font-size: 0.82rem; }
  .sphere-coordinate-table { font-size: 0.82rem; }
  .sphere-coordinate-table th,
  .sphere-coordinate-table td { padding: 8px; }
}
