/* Logic Puzzle — Game Anything
 * Shell: /play/shared/ga-casual-shell.css · AI: banks in puzzles.js, --lp-* tokens */
:root {
  --lp-bg0: #070b14;
  --lp-bg1: #111b2d;
  --lp-panel: rgba(15, 23, 42, 0.78);
  --lp-border: rgba(56, 189, 248, 0.22);
  --lp-text: #f1f5f9;
  --lp-muted: #94a3b8;
  --lp-accent: #60a5fa;
  --lp-glow: #fde68a;
  --lp-lamp: #fbbf24;
  --lp-wall: #1e293b;
  --lp-mark: #64748b;
  --lp-error: #fb7185;
  --lp-radius: 18px;
  --lp-font: "DM Sans", system-ui, sans-serif;
}

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

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

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

.lp-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, 30px) max(30px, env(safe-area-inset-bottom));
}

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

/* Main menu — match Speed Maze .sm-menu-panel (760px cap) */
#lp-screen-menu.lp-screen {
  width: min(var(--ga-puzzle-menu-max), 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

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

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

.lp-screen-play {
  align-items: flex-start;
}

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

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

.lp-panel {
  width: min(480px, 100%);
  padding: clamp(22px, 4.5vw, 34px) clamp(20px, 4vw, 30px);
  border-radius: var(--lp-radius);
  background: var(--lp-panel);
  border: 1px solid var(--lp-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);
  transition:
    border-color 0.3s ease,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

.lp-btn {
  border: 1px solid var(--lp-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--lp-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;
}

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

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

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

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

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

/* Legacy CTA (optional); menus use .ga-platform-cta from shared shell */
.lp-cta {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--lp-border);
  background: rgba(15, 23, 42, 0.5);
}

.lp-cta-title {
  margin: 0 0 6px;
  font-weight: 700;
}

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

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

.lp-diff-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--lp-border);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.lp-diff-card:hover {
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.lp-diff-card:active {
  transform: scale(0.99);
}

.lp-diff-name {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
}

.lp-diff-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--lp-muted);
}

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

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

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

.lp-small {
  font-size: 0.86rem;
}

.lp-play {
  width: min(960px, 100%);
}

.lp-play-head {
  margin-bottom: 12px;
}

/* Top HUD — puzzle-maze glass bar */
.lp-top-hud {
  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);
}

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

.lp-play-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lp-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);
}

.lp-pill-accent {
  border-color: rgba(165, 180, 252, 0.45);
  color: #c7d2fe;
}

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

.lp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lp-tool {
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--lp-text);
  cursor: pointer;
}

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

.lp-tool:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

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

.lp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 1.05rem;
}

.lp-hud-icon {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 0.95rem;
}

.lp-board-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.lp-board {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
  user-select: none;
}

.lp-cell {
  position: relative;
  width: clamp(28px, 8.2vw, 40px);
  height: clamp(28px, 8.2vw, 40px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(0.75rem, 3.5vw, 1rem);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.lp-cell:active {
  transform: scale(0.94);
}

.lp-cell-wall {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  color: var(--lp-glow);
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lp-cell-empty {
  background: rgba(255, 255, 255, 0.06);
}

.lp-cell-lit {
  background: rgba(253, 230, 138, 0.16);
  border-color: rgba(253, 230, 138, 0.25);
}

.lp-cell-lamp {
  background: radial-gradient(circle at 35% 30%, #fff7d6, var(--lp-lamp));
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
  border-color: rgba(251, 191, 36, 0.55);
}

.lp-cell-mark {
  background: rgba(100, 116, 139, 0.25);
  color: var(--lp-mark);
  font-size: 1.1rem;
  line-height: 1;
}

.lp-cell-error {
  outline: 2px solid var(--lp-error);
  outline-offset: 1px;
  animation: lp-shake 0.35s ease;
}

@keyframes lp-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.lp-status {
  text-align: center;
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--lp-muted);
}

.lp-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 24, 0.72);
  backdrop-filter: blur(6px);
  z-index: 40;
}

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

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

@media (max-width: 520px) {
  .lp-toolbar {
    justify-content: flex-start;
  }
}

/*
 * Game Worlds: same play column as block-puzzle (calc(768px * 5 / 7)); fill flex shell.
 */
.game-worlds-body .game-worlds-play-shell #lp-app.lp-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 .lp-screen.lp-screen-active {
  min-height: 0;
}

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

.game-worlds-body .game-worlds-play-shell .lp-play {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(960px, 100%);
}

.game-worlds-body .game-worlds-play-shell .lp-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
