/* Parent mode: hidden hotspot, double-tap challenge and panel. */

.pp-hotspot {
  position: fixed;
  top: 0;
  left: 0;
  width: calc(90px + env(safe-area-inset-left));
  height: calc(90px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 0 0 env(safe-area-inset-left);
  z-index: 10000;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In the puzzle and the dig that corner belongs to the close button: parent mode
   opens from the map. */
body:has(#puzzle-view:not([hidden]), #dig-view:not([hidden])) .pp-hotspot { display: none; }

.pp-ring {
  opacity: 0;
  transform: rotate(-90deg);
  transition: opacity 0.2s;
  pointer-events: none;
}
.pp-ring.pp-visible { opacity: 0.7; }
.pp-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 5; }
.pp-ring-bar { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; }

.pp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  animation: pp-fade 0.2s ease-out;
}

@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }

/* Challenge */
.pp-challenge { background: rgba(15, 23, 42, 0.82); }
.pp-challenge-box { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.pp-challenge-text { margin: 0; color: #fff; font-size: 24px; font-weight: 600; text-align: center; }
.pp-target {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 4px solid rgba(255, 255, 255, 0.85);
  touch-action: none;
}
.pp-target.pp-pulse { animation: pp-pulse 0.3s ease-out; }
@keyframes pp-pulse {
  0% { transform: scale(1); background: rgba(255, 255, 255, 0.4); }
  100% { transform: scale(1.06); background: rgba(255, 255, 255, 0.12); }
}

/* Panel */
.pp-panel-wrap { background: rgba(15, 23, 42, 0.55); touch-action: pan-y; }
.pp-panel {
  width: min(520px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  color: #1e293b;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  -webkit-user-select: none;
  user-select: none;
}
.pp-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pp-title { margin: 0; font-size: 26px; font-weight: 700; }
.pp-subtitle {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.pp-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 20px 0 0;
  padding: 16px;
  background: #f1f5f9;
  border-radius: 16px;
  font-size: 17px;
}
.pp-info dt { color: #64748b; }
.pp-info dd { margin: 0; font-weight: 600; text-align: right; }

.pp-section { margin-top: 24px; }

.pp-btn {
  min-height: 56px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 600;
  background: #e2e8f0;
  color: #1e293b;
  transition: background 0.15s, transform 0.1s;
}
.pp-btn:active { transform: scale(0.97); }

.pp-close { min-height: 48px; background: #1e293b; color: #fff; }

.pp-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pp-level.pp-active { background: #0ea5e9; color: #fff; box-shadow: inset 0 0 0 3px #0369a1; }

.pp-reset { width: 100%; background: #fee2e2; color: #b91c1c; }
.pp-reset.pp-armed { background: #dc2626; color: #fff; }
.pp-reset.pp-done { background: #dcfce7; color: #15803d; }

.pp-dinos { display: flex; flex-direction: column; gap: 10px; }
.pp-dino {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: #f1f5f9;
  border-radius: 16px;
}
.pp-dino-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-dino-name { font-size: 18px; font-weight: 600; }
.pp-dino-pron { font-size: 15px; color: #64748b; overflow-wrap: anywhere; }
.pp-play { flex: none; background: #0ea5e9; color: #fff; }
.pp-play.pp-muted { background: #e2e8f0; color: #64748b; }
.pp-empty { margin: 0; font-size: 16px; color: #64748b; }
