:root {
  --bg: #000000;
  --frame: #0d0d0d;
  --frame-line: #171717;
  --cell: #020202;
  --cell-line: #101010;
  --text: #ffffff;
  --muted: #7d7d7d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 8px;
}

.board-shell {
  width: min(1880px, 99vw);
  padding: 24px;
  border: 1px solid var(--frame-line);
  background: var(--frame);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.vestaboard {
  display: grid;
  grid-template-columns: repeat(22, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: #000000;
}

.flap {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #050505 0%, #010101 100%);
  border: 1px solid var(--cell-line);
  color: var(--text);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.95vw, 2.4rem);
  letter-spacing: 0.04em;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.flap span {
  display: inline-block;
  user-select: none;
}

.flap.is-flipping span {
  animation: flip 0.2s ease;
}

.controls {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
}

.status-text--interactive {
  cursor: pointer;
  user-select: none;
}

.status-text--interactive:hover,
.status-text--interactive:focus-visible {
  color: var(--text);
  outline: none;
}

@keyframes flip {
  0% {
    opacity: 0.25;
    transform: translateY(-14%) scaleY(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@media (max-width: 1100px) {
  .board-shell {
    width: 98vw;
    padding: 14px;
  }

  .vestaboard {
    gap: 5px;
    padding: 6px;
  }

  .flap {
    font-size: clamp(0.72rem, 2vw, 1.3rem);
  }
}

@media (max-width: 640px) {
  .app {
    padding: 6px;
    gap: 12px;
  }

  .board-shell {
    width: 99vw;
    padding: 6px;
  }

  .vestaboard {
    gap: 2px;
    padding: 3px;
  }

  .flap {
    font-size: clamp(0.42rem, 3vw, 0.82rem);
  }

  .status-text {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .status-text--interactive {
    font-size: 0.62rem;
  }
}
