#pipe-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 360px;
  margin: 0 auto 16px;
}

.play-guide {
  max-width: 420px;
  margin: 0 auto 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.08);
}

.play-guide__goal {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.play-guide__goal strong {
  color: var(--primary);
}

.play-guide__steps {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.play-guide__steps li {
  margin-bottom: 4px;
}

.play-guide__steps strong {
  color: #c4d4ef;
}

.pipe-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  max-width: 360px;
  margin: 0 auto 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-pipe {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 43, 0.85);
  position: relative;
}

.legend-straight::after {
  content: "";
  position: absolute;
  inset: 3px 5px;
  background: var(--primary);
}

.legend-corner::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--primary);
  clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%);
}

.legend-t::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--primary);
  clip-path: polygon(35% 0, 65% 0, 65% 50%, 100% 50%, 100% 100%, 0 100%, 0 50%, 35% 50%);
}

.legend-empty {
  background: rgba(6, 11, 22, 0.6);
}

.legend-empty::after {
  display: none;
}

.pipe-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 43, 0.85);
  cursor: default;
  position: relative;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pipe-rotatable {
  cursor: pointer;
  border-color: rgba(68, 211, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(68, 211, 255, 0.15);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.pipe-rotatable:hover {
  border-color: var(--primary);
  transform: scale(1.03);
}

.pipe-rotatable:active {
  transform: scale(0.97);
}

.pipe-label {
  font-size: 16px;
  line-height: 1;
}

.pipe-sublabel {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

.pipe-cell:disabled {
  cursor: default;
  opacity: 1;
}

.pipe-empty {
  background: rgba(6, 11, 22, 0.6);
  cursor: default;
  opacity: 0.45;
}

.pipe-straight::before,
.pipe-corner::before,
.pipe-t::before {
  content: "";
  position: absolute;
  inset: 18%;
  background: var(--primary);
  opacity: 0.85;
}

.pipe-straight.rot-0::before,
.pipe-straight.rot-2::before {
  width: 22%;
  left: 39%;
  right: 39%;
  inset: 12% 39%;
}

.pipe-straight.rot-1::before,
.pipe-straight.rot-3::before {
  height: 22%;
  top: 39%;
  bottom: 39%;
  inset: 39% 12%;
}

.pipe-corner.rot-0::before {
  clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%);
  inset: 12%;
}

.pipe-corner.rot-1::before {
  clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
  inset: 12%;
}

.pipe-corner.rot-2::before {
  clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%);
  inset: 12%;
}

.pipe-corner.rot-3::before {
  clip-path: polygon(0 0, 50% 0, 50% 50%, 0 50%);
  inset: 12%;
}

.pipe-t.rot-0::before {
  clip-path: polygon(35% 0, 65% 0, 65% 50%, 100% 50%, 100% 100%, 0 100%, 0 50%, 35% 50%);
}

.pipe-t.rot-1::before {
  clip-path: polygon(0 0, 100% 0, 100% 35%, 50% 35%, 50% 65%, 100% 65%, 100% 100%, 0 100%);
}

.pipe-t.rot-2::before {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 65% 100%, 65% 50%, 35% 50%, 35% 100%, 0 100%);
}

.pipe-t.rot-3::before {
  clip-path: polygon(0 35%, 50% 35%, 50% 0, 100% 0, 100% 100%, 0 100%);
}

.pipe-start,
.pipe-end {
  background: rgba(68, 211, 255, 0.15);
  border-color: var(--primary);
}

.game-actions {
  text-align: center;
}
