* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
  background: #111318;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#topbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  color: #9aa0ab;
}

#status {
  transition: color 0.15s ease;
}
#status.recording {
  color: #ff5252;
  font-weight: 600;
}

#grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: 0;
}

.pad {
  border-radius: 18px;
  border: none;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  filter: brightness(0.92);
  transition: filter 0.08s ease, transform 0.08s ease;
  overflow: hidden;
}

.pad.empty {
  filter: brightness(0.55) saturate(0.6);
}

.pad .label {
  pointer-events: none;
}

.pad .rec-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff3b3b;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.pad.playing {
  filter: brightness(1.15);
  transform: scale(0.97);
}

.pad.arming .rec-dot {
  opacity: 0.9;
}

.pad.recording {
  filter: brightness(1.05);
}
.pad.recording .rec-dot {
  opacity: 1;
  animation: blink 0.6s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

#hint {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  padding: 6px 12px 10px;
}
