/* Live activity board: a positioned stage that the SVG, the particle canvas
   and the floating HUD all fill. A page either hands it the whole viewport
   (/30) or a bounded panel in the flow of the page. */

.board-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1600 / 808;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ece7dd;
}

.board-svg,
.board-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.board-flow {
  pointer-events: none;
}

.board-svg text {
  font-family: Poppins, Arial, sans-serif;
}

.board-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px;
  pointer-events: none;
  color: var(--ink);
}

.board-hud-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.board-hud-title p {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.board-hud-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.board-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.board-window,
.board-replay {
  padding: 8px 12px;
  border: 1px solid #ddd6c8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.board-window {
  padding-right: 26px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23626262' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  appearance: none;
}

.board-replay {
  position: relative;
  overflow: hidden;
}

.board-replay:hover,
.board-window:hover,
.board-replay.is-active {
  border-color: var(--red);
}

.board-replay-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.1s linear;
}

.board-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 14px;
  border: 1px solid #ddd6c8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
}

.board-stat-num {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.board-stat-label {
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.board-status,
.board-caption {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

/* Fullscreen board: the page is the stage, so the panel framing goes. */
.board-page {
  margin: 0;
  background: #ece7dd;
}

.board-page .board {
  position: fixed;
  inset: 0;
}

.board-page .board-stage {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.board-page .board-status,
.board-page .board-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  margin: 0;
  z-index: 1;
}

.board-page .board-status {
  top: 50%;
  transform: translateY(-50%);
}

.board-page .board-caption {
  bottom: 14px;
  font-size: 12px;
}

/* Below this width the stage turns portrait, which is the shape the board's
   own portrait layout expects. */
@media (max-width: 720px) {
  .board-stage {
    aspect-ratio: 480 / 760;
  }

  .board-hud {
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
  }

  .board-hud-title h2 {
    font-size: 17px;
  }

  .board-hud-title p {
    font-size: 11px;
  }

  .board-hud-stats {
    justify-content: flex-start;
  }

  /* 16px keeps iOS from zooming the page when the select takes focus. */
  .board-window {
    font-size: 16px;
  }

  .board-stat {
    padding: 4px 10px;
  }

  .board-stat-num {
    font-size: 17px;
  }
}
