/* Path Puzzle — Game Anything
 * Shell: /play/shared/ga-casual-shell.css · tokens: --pth-* */

#pthPlayShell.game-worlds-play-shell {
  min-height: 0;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 130% 90% at 50% 40%, rgba(56, 189, 248, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(34, 197, 94, 0.05) 0%, transparent 50%),
    linear-gradient(165deg, #05070c 0%, #0c1118 42%, #080b10 100%);
}

#pthPlayShell.game-worlds-play-shell:not([data-pth-sized]) {
  height: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.pth-outer-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

:root {
  --pth-bg0: #070b14;
  --pth-panel: rgba(15, 23, 42, 0.78);
  --pth-border: rgba(56, 189, 248, 0.22);
  --pth-text: #f1f5f9;
  --pth-muted: #94a3b8;
  --pth-accent: #38bdf8;
  --pth-path: #4ade80;
  --pth-path-glow: rgba(74, 222, 128, 0.45);
  --pth-mark: #fbbf24;
  --pth-radius: 18px;
  --pth-font: "Outfit", "DM Sans", system-ui, sans-serif;
  --pth-cell-gap: 3px;
  --pth-cols: 6;
  --pth-rows: 6;
  --pth-cell-w: 48px;
  --pth-cell-h: 48px;
}

.ga-casual-scope.pth-app {
  --pth-bg0: var(--ga-bg-abyss);
  --pth-panel: var(--ga-surface);
  --pth-border: var(--ga-border);
  --pth-text: var(--ga-text);
  --pth-muted: var(--ga-muted);
  --pth-accent: var(--ga-sky);
  --ga-accent-game: #4ade80;
}

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

.html-standalone,
body.pth-standalone {
  margin: 0;
  min-height: 100%;
  font-family: var(--pth-font);
  color: var(--pth-text);
  background: #000;
  -webkit-tap-highlight-color: transparent;
}

.pth-app {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 5vw, 30px)
    max(30px, env(safe-area-inset-bottom));
  font-family: var(--pth-font);
  color: var(--pth-text);
}

#pthPlayShell .pth-app.pth-gw {
  align-items: stretch;
  padding: clamp(0.55rem, 2vw, 0.85rem) clamp(0.65rem, 2.5vw, 1rem);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pth-screen {
  width: min(960px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  justify-content: center;
  align-items: center;
}

.pth-screen.pth-screen-active {
  display: flex;
  flex-direction: column;
}

.pth-screen-play.pth-screen-active {
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

#pthPlayShell .pth-screen-play.pth-screen-active {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
}

#pthPlayShell .pth-screen-play.pth-screen-active .pth-play {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

/* Infinite Maze–style: frosted menu over a live board preview */
#pth-app.pth-mode-overlay {
  position: relative;
}

#pth-app.pth-mode-overlay #pth-screen-play.pth-screen-active {
  display: flex;
}

#pth-app.pth-mode-overlay #pth-screen-play .pth-play-head,
#pth-app.pth-mode-overlay #pth-screen-play .pth-status {
  visibility: hidden;
  pointer-events: none;
}

#pth-app.pth-mode-overlay #pth-screen-play .pth-board-wrap {
  pointer-events: none;
}

.pth-screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  margin: 0;
  padding: clamp(12px, 3vw, 24px);
  box-sizing: border-box;
  background: rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(11px) saturate(1.06);
  -webkit-backdrop-filter: blur(11px) saturate(1.06);
}

.pth-screen-overlay.pth-screen-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#pth-screen-menu.pth-screen,
#pth-screen-difficulty.pth-screen,
#pth-screen-how.pth-screen {
  width: 100%;
  max-width: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#pth-screen-menu .pth-panel,
#pth-screen-difficulty .pth-panel,
#pth-screen-how .pth-panel {
  width: min(var(--ga-puzzle-menu-max), 100%);
  max-width: min(var(--ga-puzzle-menu-max), 100%);
  margin-inline: auto;
}

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

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

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

.pth-panel {
  width: min(480px, 100%);
  padding: clamp(22px, 4.5vw, 34px) clamp(20px, 4vw, 30px);
  border-radius: var(--pth-radius);
  background: var(--pth-panel);
  border: 1px solid var(--pth-border);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.pth-panel h1,
.pth-panel h2 {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pth-panel h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  background: linear-gradient(102deg, #f8fafc 0%, #86efac 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pth-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #4ade80;
}

.pth-lead {
  margin: 0 0 20px;
  line-height: 1.55;
  color: var(--pth-muted);
  font-size: 0.98rem;
}

.pth-muted {
  color: var(--pth-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

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

.pth-btn {
  border: 1px solid var(--pth-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pth-text);
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 11px 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;
}

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

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

.pth-btn-primary {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(135deg, #16a34a, #22c55e 48%, #4ade80);
  color: #052e16;
  box-shadow: 0 10px 32px rgba(34, 197, 94, 0.35);
}

.pth-btn-primary:hover {
  box-shadow: 0 14px 36px rgba(34, 197, 94, 0.45);
}

.pth-btn-ghost {
  background: transparent;
  margin-top: 8px;
}

.pth-diff-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0 8px;
}

.pth-diff-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--pth-border);
  background: rgba(15, 23, 42, 0.65);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.25s ease,
    transform 0.2s ease,
    background 0.25s ease;
}

.pth-diff-card:hover {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(20, 40, 30, 0.55);
  transform: translateY(-1px);
}

.pth-diff-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.pth-diff-meta {
  color: var(--pth-muted);
  font-size: 0.88rem;
}

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

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

.pth-list strong {
  color: var(--pth-text);
}

/* Play HUD */
.pth-play {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  width: 100%;
}

.pth-play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

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

.pth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pth-muted);
}

.pth-pill-accent {
  border-color: rgba(74, 222, 128, 0.35);
  color: #86efac;
}


.pth-diff-wrap {
  display: inline-flex;
  align-items: center;
}

.pth-diff-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 30px;
  padding: 4px 28px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background:
    rgba(15, 23, 42, 0.78)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%94a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--pth-muted, #94a3b8);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.pth-diff-select:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--pth-text, #e2e8f0);
}

.pth-diff-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pth-diff-select:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.pth-diff-select option {
  background: #0f172a;
  color: #e2e8f0;
}

.pth-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pth-tool {
  border: 1px solid var(--pth-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pth-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.pth-tool:hover {
  background: rgba(255, 255, 255, 0.09);
}

.pth-tool-ghost {
  background: transparent;
}

.pth-icon-btn {
  border: 1px solid var(--pth-border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  min-width: 34px;
  min-height: 34px;
  cursor: pointer;
  font-size: 0.95rem;
}

.pth-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.pth-board {
  --pth-cols: 6;
  --pth-rows: 6;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--pth-cols), var(--pth-cell-w));
  grid-template-rows: repeat(var(--pth-rows), var(--pth-cell-h));
  gap: var(--pth-cell-gap);
  padding: 10px;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pth-cell {
  position: relative;
  z-index: 1;
  width: var(--pth-cell-w);
  height: var(--pth-cell-h);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  color: var(--pth-text);
  font: inherit;
  cursor: crosshair;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.2s ease;
  touch-action: none;
}

.pth-cell--filled {
  background: linear-gradient(160deg, rgba(22, 101, 52, 0.45), rgba(20, 50, 35, 0.85));
  border-color: rgba(74, 222, 128, 0.35);
}

.pth-cell--tip {
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.55), 0 0 18px var(--pth-path-glow);
}

.pth-cell--todo {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.25);
  animation: pth-todo-pulse 1.1s ease-in-out infinite;
}

@keyframes pth-todo-pulse {
  0%,
  100% {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  }
  50% {
    background: linear-gradient(160deg, rgba(69, 50, 20, 0.85), rgba(40, 30, 12, 0.95));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pth-cell--todo {
    animation: none;
  }
}

.pth-cell--mark {
  z-index: 4;
}

.pth-cell--mark .pth-mark {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62%;
  height: 62%;
  min-width: 1.4em;
  min-height: 1.4em;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(0.75rem, 2.6vw, 1.05rem);
  color: #0f172a;
  background: linear-gradient(145deg, #fde68a, #fbbf24 55%, #f59e0b);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  pointer-events: none;
}

.pth-cell--start .pth-mark {
  background: linear-gradient(145deg, #86efac, #4ade80 55%, #22c55e);
}

.pth-cell--end .pth-mark {
  background: linear-gradient(145deg, #7dd3fc, #38bdf8 55%, #0ea5e9);
}

.pth-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.pth-path-line {
  stroke: var(--pth-path);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--pth-path-glow));
}

.pth-path-preview {
  stroke: rgba(74, 222, 128, 0.55);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 6 8;
}

.pth-path-head {
  fill: #ecfdf5;
  stroke: #4ade80;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px var(--pth-path-glow));
}

.pth-status {
  margin: 0;
  min-height: 1.25em;
  text-align: center;
  font-size: 0.85rem;
  color: var(--pth-muted);
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

.pth-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Keep win/pause inside the play shell (Game Worlds clips fixed overlays). */
#pthPlayShell .pth-overlay.ga-game-overlay,
.pth-app .pth-overlay.ga-game-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  border-radius: inherit;
}

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

@media (max-width: 520px) {
  .pth-play-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pth-hud-actions {
    justify-content: flex-start;
  }

  .pth-cell {
    border-radius: 8px;
  }

  .pth-path-line {
    stroke-width: 5;
  }
}

/* Game Worlds: center menu cards in the full play shell */
.game-worlds-body #pthPlayShell #pth-screen-menu.pth-screen-active,
.game-worlds-body #pthPlayShell #pth-screen-difficulty.pth-screen-active,
.game-worlds-body #pthPlayShell #pth-screen-how.pth-screen-active,
.game-worlds-body .game-worlds-play-shell #pth-screen-menu.pth-screen-active,
.game-worlds-body .game-worlds-play-shell #pth-screen-difficulty.pth-screen-active,
.game-worlds-body .game-worlds-play-shell #pth-screen-how.pth-screen-active {
  width: 100%;
  align-items: center;
  justify-content: center;
}
