html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.panel {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint {
  margin: 0;
  text-align: center;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 400;
  font-size: 10px;
  line-height: 1.35;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 38px;
  grid-auto-flow: dense;
  gap: 8px;
}

.tile {
  border-radius: 16px;
  background: rgba(23, 20, 26, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  transform-origin: center;
  transition: background 300ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.tile[data-pad=p0] {
  background: rgba(23, 20, 26, 0.06);
}
.tile[data-pad=p1] {
  padding: 8px;
  background: rgba(23, 20, 26, 0.1);
}
.tile[data-pad=p2] {
  padding: 12px;
  background: rgba(47, 109, 246, 0.2);
}
.tile[data-pad=p3] {
  padding: 16px;
  background: rgba(47, 109, 246, 0.32);
}

.tile--pulse {
  animation: pulse 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.tileName {
  margin: 0;
  color: #17141a;
  font-weight: 600;
  font-size: 10px;
}
[data-font=f1] .tileName {
  font-size: 11px;
}
[data-font=f2] .tileName {
  font-size: 12px;
}
[data-font=f3] .tileName {
  font-size: 13px;
}

.tileNum {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.tileVal {
  color: #17141a;
  font-weight: 700;
  font-size: 12px;
}
[data-font=f1] .tileVal {
  font-size: 14px;
}
[data-font=f2] .tileVal {
  font-size: 18px;
}
[data-font=f3] .tileVal {
  font-size: 22px;
}

.tileUnit {
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 9px;
}

@keyframes pulse {
  0% {
    transform: scale(1.1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .panel {
    max-width: 300px;
    gap: 4px;
  }
  .hint {
    font-size: 9px;
  }
  .grid {
    grid-auto-rows: 30px;
    gap: 4px;
  }
  .tileName {
    font-size: 9px;
  }
  .tileVal {
    font-size: 11px;
  }
  .tileUnit {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile--pulse {
    transition: none;
    animation: none;
  }
}
