/* Physics Puzzle — Game Anything
 * Shell: /play/shared/ga-casual-shell.css · Levels: levels.js / PP_HANDCRAFTED_LEVELS */
:root {
  --pp-bg0: #070b14;
  --pp-bg1: #111b2d;
  --pp-panel: rgba(15, 23, 42, 0.78);
  --pp-panel-border: rgba(56, 189, 248, 0.22);
  --pp-text: #f1f5f9;
  --pp-muted: #94a3b8;
  --pp-accent: #38bdf8;
  --pp-accent2: #a78bfa;
  --pp-warn: #fb7185;
  --pp-success: #4ade80;
  --pp-shadow: 0 24px 56px rgba(2, 6, 23, 0.55);
  --pp-radius: 20px;
  --pp-font: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.ga-casual-scope.pp-app {
  --pp-bg0: var(--ga-bg-abyss);
  --pp-bg1: var(--ga-bg-mid);
  --pp-panel: var(--ga-surface);
  --pp-panel-border: var(--ga-border);
  --pp-text: var(--ga-text);
  --pp-muted: var(--ga-muted);
  --pp-accent: var(--ga-sky);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: #000000;
  color: var(--pp-text);
  font-family: var(--pp-font);
  -webkit-tap-highlight-color: transparent;
}

.pp-app {
  /*min-height: 100dvh;*/
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 5vw, 32px) max(28px, env(safe-area-inset-bottom));
}

.pp-screen {
  width: min(1040px, 100%);
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

#pp-screen-menu.pp-screen {
  width: min(var(--ga-puzzle-menu-max), 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#pp-screen-menu .pp-panel {
  width: min(var(--ga-puzzle-menu-max), 100%);
}

.pp-screen.pp-screen-active {
  display: flex;
}

.pp-screen.pp-screen-active .pp-panel {
  animation: pp-panel-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pp-screen-play.pp-screen-active .pp-panel {
  animation: none;
}

.pp-screen-play {
  align-items: stretch;
}

@keyframes pp-panel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pp-screen.pp-screen-active .pp-panel {
    animation: none;
  }
}

.pp-panel {
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 36px) clamp(22px, 4.5vw, 34px);
  border-radius: var(--pp-radius);
  background: var(--pp-panel);
  border: 1px solid var(--pp-panel-border);
  box-shadow: var(--pp-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  transition:
    border-color 0.3s ease,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.pp-panel-wide {
  width: min(920px, 100%);
}

.pp-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pp-accent2);
}

.pp-lead {
  margin: 0 0 22px;
  color: var(--pp-muted);
  line-height: 1.55;
  font-size: 1rem;
}

.pp-menu-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin-bottom: 12px;
}

.pp-btn {
  appearance: none;
  border: 1px solid var(--pp-panel-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pp-text);
  font: inherit;
  font-weight: 600;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.18, 0.64, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

.pp-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(56, 189, 248, 0.32);
}

.pp-btn:active {
  transform: scale(0.98);
}

.pp-btn-primary {
  border-color: rgba(37, 99, 235, 0.55);
  background: linear-gradient(135deg, #2563eb, #3b82f6 42%, #38bdf8);
  color: #fff;
  box-shadow: 0 10px 32px rgba(37, 99, 235, 0.4);
}

.pp-btn-primary:hover {
  box-shadow: 0 14px 38px rgba(37, 99, 235, 0.48);
}

.pp-btn-ghost {
  background: transparent;
}

.pp-btn-small {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.pp-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.pp-cta {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.06);
  margin-bottom: 12px;
}

.pp-cta-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--pp-text);
}

.pp-cta-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--pp-muted);
  line-height: 1.5;
}

.pp-list {
  margin: 0 0 18px;
  padding-left: 1.1rem;
  color: var(--pp-muted);
  line-height: 1.55;
}

.pp-list li {
  margin-bottom: 8px;
}

.pp-muted {
  color: var(--pp-muted);
}

.pp-small {
  font-size: 0.85rem;
}

.pp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.pp-levels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pp-levels-head h2 {
  margin: 0;
}

.pp-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.pp-level-card {
  border-radius: 14px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pp-level-card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 231, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.pp-level-card-locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.pp-level-card-index {
  font-size: 1.35rem;
  font-weight: 700;
}

.pp-level-card-meta {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--pp-muted);
}

.pp-play-shell {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.pp-phaser-host {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 10;
  max-height: min(72vh, 620px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(110, 231, 255, 0.06) inset;
  background: #101624;
  touch-action: none;
}

.pp-phaser-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.pp-hud {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pp-hud-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pp-hud-pill {
  font-size: 12px;
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(125, 211, 252, 0.28);
}

.pp-hud-accent {
  border-color: rgba(110, 231, 255, 0.45);
  color: #a5f3fc;
}

.pp-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pp-btn-hud {
  min-height: 0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
}

.pp-hud-icon {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 0.95rem;
  border-radius: 10px;
}

.pp-overlay {
  position: fixed;
  inset: 0;
  padding: 20px;
  z-index: 50;
  animation: pp-fade-in 0.25s ease;
}

.pp-overlay:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-overlay[hidden] {
  display: none !important;
}

.pp-win-stars {
  font-size: 2rem;
  letter-spacing: 0.2em;
  margin: 8px 0 4px;
  color: #fde68a;
  text-shadow: 0 0 20px rgba(253, 230, 138, 0.35);
}

@media (max-width: 600px) {
  .pp-hud-actions {
    justify-content: flex-end;
    width: 100%;
  }
}

/*
 * Game Worlds: same play column as block-puzzle; Phaser host fills below HUD.
 */
.game-worlds-body .game-worlds-play-shell #pp-app.pp-app {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  align-items: stretch;
}

.game-worlds-body .game-worlds-play-shell .pp-screen.pp-screen-active {
  min-height: 0;
}

.game-worlds-body .game-worlds-play-shell .pp-screen-play.pp-screen-active {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.game-worlds-body .game-worlds-play-shell .pp-play-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
}

.game-worlds-body .game-worlds-play-shell .pp-phaser-host {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  aspect-ratio: auto;
}
