/*
 * Puzz shared-shell — modal CSS for the completion/share modal and the
 * daily-start modal. Identical across Tangle, Escape, and Split
 * (copy-pasted, no build step yet — see types.md). Fully self-contained
 * (hardcoded colors) so it looks the same regardless of each game's own
 * theme. Pair with the canonical markup in completion-modal.html /
 * daily-modal.html and shared-shell.js's initCompletionModal /
 * initDailyStartModal.
 */
#completionOverlay, #dailyIntroOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
#completionOverlay.open, #completionOverlay.show,
#dailyIntroOverlay.open, #dailyIntroOverlay.show {
  display: flex;
}
.puzz-modal-card {
  position: relative;
  overflow: hidden;
  background: #1c232c;
  border: 1px solid #323c49;
  border-radius: 16px;
  padding: 32px 28px 26px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: puzz-modal-pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes puzz-modal-pop-in {
  0% { transform: scale(0.82); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.puzz-confetti-layer {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.puzz-confetti-layer .confetti-piece {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: puzz-confetti-fall 2s ease-in forwards;
}
@keyframes puzz-confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(260px) rotate(360deg); opacity: 0; }
}
.puzz-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  color: #8a97a8;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.puzz-close-btn:hover { color: #eef1f5; }
.puzz-close-btn:focus-visible { outline: 2px solid #d4a94c; outline-offset: 2px; }
.puzz-modal-title {
  margin: 0 0 4px;
  color: #4caf6f;
  font-size: 1.4rem;
}
.puzz-modal-subtitle { color: #8a97a8; font-size: 0.9rem; margin-bottom: 14px; }
.puzz-modal-stats {
  font-family: 'JetBrains Mono', 'Space Mono', 'SF Mono', Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: #d4a94c;
  margin-bottom: 18px;
}
.puzz-share-preview {
  margin-top: 4px;
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #2c3847;
  border: 1px solid #3a4859;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', 'Space Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  color: #eef1f5;
  margin-bottom: 16px;
  resize: vertical;
}
.puzz-share-preview:focus { outline: 2px solid #d4a94c; }
.puzz-share-note { font-size: 0.75rem; color: #8a97a8; text-align: left; margin: -10px 0 16px; }
.puzz-modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 0; }
.puzz-btn {
  font-family: inherit;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  background: #2c3847;
  border: 1px solid #3a4859;
  color: #eef1f5;
}
.puzz-btn:hover { filter: brightness(1.15); }
.puzz-btn-primary { background: #d4a94c; border-color: #d4a94c; color: #1b2430; }
.puzz-btn-primary:hover { filter: brightness(1.08); }

.puzz-modal-body { color: #8a97a8; font-size: 0.85rem; line-height: 1.5; margin: 0 0 16px; }
.puzz-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.puzz-toggle-label { font-size: 0.82rem; color: #8a97a8; }
.puzz-toggle-track {
  position: relative;
  display: inline-flex;
  background: #2c3847;
  border: 1px solid #3a4859;
  border-radius: 20px;
  padding: 3px;
}
.puzz-toggle-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(100% / var(--puzz-toggle-count, 2) - 3px);
  background: #d4a94c;
  border-radius: 16px;
  transition: transform 0.2s ease;
  z-index: 0;
}
.puzz-toggle-opt {
  position: relative;
  z-index: 1;
  font-family: inherit;
  border: none;
  background: none;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #8a97a8;
  transition: color 0.15s ease;
}
.puzz-toggle-opt.active { color: #1b2430; }
