/* Physics game specific styles. Outer chrome comes from /style.css. */

.physics-meta {
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.95rem;
  color: var(--fg-dim);
}
.physics-meta strong { color: var(--fg); }
.physics-meta > span { white-space: nowrap; }

/* --- Level pills (compact 1/2/3 selector) --- */
.level-pills {
  display: inline-flex;
  gap: 0.3rem;
  margin-right: 0.5rem;
}
.level-pill {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: inherit;
  font-weight: 700;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 0.95rem;
}
.level-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #07212a;
}
.level-pill:hover:not(.active) { background: #262a3a; }

/* h1 with a longer dynamic name on a narrow viewport — gently shrink. */
.page-header h1 { font-size: clamp(1rem, 4.2vw, 1.25rem); }

/* --- Stage --- */
.physics-stage {
  position: relative;
  width: min(360px, 100%);
  margin: 0 auto;
}
.physics-stage canvas {
  display: block;
  background: #0a0c12;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.physics-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
  background: rgba(10, 12, 18, 0.78);
  border-radius: 8px;
  color: var(--fg);
  z-index: 2;
}
.physics-overlay.visible { display: flex; }
.physics-overlay h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--good);
}
.physics-overlay p { margin: 0; color: var(--fg-dim); }
.overlay-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Plank tray --- */
.plank-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  min-height: 30px;
  padding: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.plank-tray:empty::before {
  content: "No planks for this level — just gravity.";
  color: var(--fg-dim);
  font-style: italic;
  font-size: 0.9rem;
  align-self: center;
}
.tray-plank {
  width: 70px;
  height: 14px;
  background: #b88a4a;
  border: 1px solid #7d5a2a;
  border-radius: 3px;
  cursor: grab;
  touch-action: none;
  position: relative;
  flex: 0 0 auto;
}
.tray-plank:active { cursor: grabbing; }
.tray-plank.dim { opacity: 0.4; pointer-events: none; }
