/* Plumbix note: shared visual styling for pipe game. */
/* Plumbix offline pipe puzzle — self-contained */
.pipe-offline-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 32px;
  background: linear-gradient(165deg, #0a1628 0%, #0e2a4a 45%, #0d3d5c 100%);
  color: #e8f4ff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.pipe-offline-header {
  text-align: center;
  max-width: 420px;
  margin-bottom: 16px;
}

.pipe-offline-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5ec8f0;
  margin-bottom: 12px;
}

.pipe-offline-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.pipe-offline-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}

.pipe-offline-header p {
  margin: 0;
  font-size: 0.92rem;
  color: #94b8d4;
  line-height: 1.45;
}

.pipe-game-wrap {
  width: 100%;
  max-width: min(92vw, 340px);
}

.pipe-game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #7eb8d8;
}

.pipe-game-grid {
  display: grid;
  gap: 4px;
  aspect-ratio: 1;
  width: 100%;
  touch-action: manipulation;
}

.pipe-tile {
  position: relative;
  border: none;
  border-radius: 8px;
  background: #132a44;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.1s;
}

.pipe-tile:active:not(:disabled) {
  transform: scale(0.96);
}

.pipe-tile:focus-visible {
  outline: 2px solid #3dd6ff;
  outline-offset: 2px;
}

.pipe-tile--fixed {
  cursor: default;
  background: #1a3550;
}

.pipe-tile--flow {
  background: #1a4a6e;
  box-shadow: inset 0 0 0 2px rgba(61, 214, 255, 0.45);
}

.pipe-tile--win .pipe-svg path {
  stroke: #5dffa8;
}

.pipe-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pipe-svg path {
  fill: none;
  stroke: #2ab8e8;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke 0.2s;
}

.pipe-svg path.pipe-joint {
  stroke-width: 18;
}

.pipe-tile--source .pipe-svg path,
.pipe-tile--sink .pipe-svg path {
  stroke: #3dd6ff;
  stroke-width: 16;
}

.pipe-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #6a9ab8;
}

.pipe-win {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(93, 255, 168, 0.35);
  text-align: center;
  animation: pipe-fade-in 0.35s ease;
}

.pipe-win[hidden] {
  display: none;
}

.pipe-win h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #5dffa8;
}

.pipe-win p {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #b8e8d0;
}

.pipe-win-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.pipe-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  min-width: 120px;
}

.pipe-btn--primary {
  background: linear-gradient(135deg, #1a8fd4, #3dd6ff);
  color: #042033;
}

.pipe-btn--ghost {
  background: transparent;
  color: #7ec8e8;
  border: 1px solid #3a6a8a;
}

@keyframes pipe-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .pipe-offline-page {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .pipe-game-board { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pipe-controls { flex-wrap: wrap; justify-content: center; }
  .pipe-btn { min-height: 44px; min-width: 44px; }
}

@media (min-width: 480px) {
  .pipe-offline-header h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .pipe-offline-header h1 { font-size: 1.25rem; }
  .pipe-score-row { flex-direction: column; gap: 8px; text-align: center; }
}

/* Offline page (pages/offline.html) — pg-* aliases */
.pg-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(165deg, #0a1628 0%, #0e2a4a 45%, #0d3d5c 100%);
  color: #e8f4ff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  touch-action: manipulation;
}

.pg-online-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 16px;
  background: #059669;
  color: #fff;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
}

.pg-online-banner.is-visible { transform: translateY(0); }

.pg-header {
  width: 100%;
  max-width: 420px;
  margin-bottom: 12px;
}

.pg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5ec8f0;
}

.pg-brand-icon { width: 28px; height: 28px; fill: #3dd6ff; flex-shrink: 0; }

.pg-hero {
  text-align: center;
  max-width: 420px;
  margin-bottom: 16px;
  padding: 0 8px;
}

.pg-hero h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}

.pg-hero p {
  margin: 0;
  font-size: 0.9rem;
  color: #94b8d4;
  line-height: 1.45;
}

.pg-game-wrap {
  width: 100%;
  max-width: min(92vw, 360px);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-hint {
  text-align: center;
  margin-top: 14px;
  font-size: 0.78rem;
  color: #6a9ab8;
  padding: 0 12px;
}

@media (max-width: 480px) {
  .pg-hero h1 { font-size: 1.2rem; }
  .pipe-game-wrap,
  .pg-game-wrap { max-width: min(96vw, 340px); }
}
