.flow-shell-page {
  background:
    radial-gradient(circle at top, rgba(104, 171, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #eef5fb 0%, #f7efe8 52%, #f2f8f2 100%);
}

.flow-page-content {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  padding: 0;
}

.flow-stage-card {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.flow-banner-kicker {
  color: var(--moyu-muted);
}

.flow-board-card {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.flow-board-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 64px - env(safe-area-inset-bottom));
  height: calc(100dvh - 64px - env(safe-area-inset-bottom));
}

.flow-board {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  min-height: 100%;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.18), transparent 20%),
    linear-gradient(180deg, #0f2339 0%, #0c1829 100%);
  touch-action: none;
  user-select: none;
}

.flow-playfield {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--flow-playfield-size, min(calc(100vw - 24px), 760px));
  height: var(--flow-playfield-size, min(calc(100vw - 24px), 760px));
  transform: translate(-50%, -50%);
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.54), transparent 28%),
    linear-gradient(180deg, #102238 0%, #0d1828 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 44px rgba(24, 32, 51, 0.2);
}

.flow-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 2;
  pointer-events: none;
}

.flow-overlay-top {
  top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.flow-overlay-bottom {
  bottom: calc(12px + env(safe-area-inset-bottom));
}

.flow-overlay-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(7, 12, 24, 0.76);
  color: #f6fbff;
  font-size: 0.76rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 22px rgba(5, 9, 18, 0.2);
}

.flow-overlay-chip.subtle {
  color: rgba(246, 251, 255, 0.84);
  font-weight: 700;
}

.flow-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.flow-mini-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 12, 24, 0.76);
  color: #f6fbff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.flow-grid,
.flow-svg {
  position: absolute;
  inset: 0;
}

.flow-grid {
  display: grid;
}

.flow-cell {
  position: relative;
  border: 1px solid rgba(157, 188, 224, 0.12);
}

.flow-cell::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.flow-cell.is-filled::before {
  background: color-mix(in srgb, var(--flow-color, #ffffff) 18%, rgba(255, 255, 255, 0.03));
}

.flow-cell.is-endpoint::before {
  background: color-mix(in srgb, var(--flow-color, #ffffff) 26%, rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--flow-color, #ffffff) 40%, transparent);
}

.flow-cell.is-active::before {
  transform: scale(0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.flow-svg {
  overflow: visible;
}

.flow-path-shadow {
  fill: none;
  stroke: rgba(5, 9, 18, 0.36);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-path-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-endpoint-ring {
  fill: rgba(255, 255, 255, 0.16);
}

.flow-endpoint-core {
  stroke: rgba(255, 255, 255, 0.84);
  stroke-width: 0.06;
}

.flow-endpoint-glow {
  fill: rgba(255, 255, 255, 0.12);
}

.flow-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(-50%, 16px);
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(7, 12, 24, 0.8);
  color: #f7fbff;
  text-align: center;
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.flow-toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

.flow-finish-banner {
  position: absolute;
  left: 50%;
  width: min(calc(100vw - 28px), 520px);
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(12, 29, 29, 0.9), rgba(12, 23, 44, 0.9));
  border: 1px solid rgba(73, 214, 163, 0.26);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 34px rgba(5, 9, 18, 0.26);
}

.flow-finish-banner h3 {
  margin: 2px 0 6px;
  font-size: 1.08rem;
}

.flow-finish-banner p {
  margin: 0;
  color: var(--moyu-muted);
}

.flow-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 12, 22, 0.32);
  backdrop-filter: blur(8px);
}

.flow-pause-card {
  width: min(calc(100vw - 32px), 420px);
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(12, 29, 29, 0.94), rgba(12, 23, 44, 0.94));
  border: 1px solid rgba(120, 174, 255, 0.2);
  box-shadow: 0 18px 34px rgba(5, 9, 18, 0.26);
  color: #f6fbff;
}

.flow-pause-card h3 {
  margin: 4px 0 8px;
  font-size: 1.2rem;
}

.flow-pause-card p {
  margin: 0;
  color: rgba(246, 251, 255, 0.78);
  line-height: 1.55;
}

.flow-pause-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.flow-message {
  margin: 0 0 10px;
  padding: 0 8px;
  color: rgba(247, 251, 255, 0.88);
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 1px 0 rgba(5, 9, 18, 0.24);
  font-size: 0.84rem;
}

.flow-control-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  pointer-events: auto;
}

.flow-control-row .touch-button {
  min-height: 42px;
  padding: 0 10px;
  background: rgba(247, 251, 255, 0.92);
  font-size: 0.88rem;
}

.flow-control-row .touch-button.secondary {
  background: rgba(120, 174, 255, 0.2);
}

@media (max-width: 560px) {
  .flow-board-wrap {
    height: calc(100vh - 56px - env(safe-area-inset-bottom));
    height: calc(100dvh - 56px - env(safe-area-inset-bottom));
  }

  .flow-finish-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-pause-actions {
    grid-template-columns: 1fr;
  }

  .flow-overlay {
    left: 8px;
    right: 8px;
  }

  .flow-playfield {
    width: var(--flow-playfield-size, calc(100vw - 12px));
    height: var(--flow-playfield-size, calc(100vw - 12px));
  }
}
