@import "https://necolas.github.io/normalize.css/8.0.1/normalize.css";
@import "https://fonts.googleapis.com/css?family=Passion+One";

:root {
  --bg-color: snow;
  --pad-bg: rgba(13, 13, 13, 0.2);
  --pad-active: tomato;
  --text-color: rgba(255, 250, 250, 0.5);
  --velocity: 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #353839; /* Black Onyx Pantone color */
    --pad-bg: rgba(255, 250, 250, 0.1);
    --pad-active: crimson; 
    --text-color: rgba(255, 250, 250, 0.1);
  }
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Passion One", cursive;
  position: absolute;
  inset: 0;
  user-select: none;
  touch-action: manipulation;
}

section {
  overflow: hidden;
}

section.pads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  grid-template-areas: 
    "cy cb sp"
    "lt mt ht"
    "cp rs oh"
    "bd sd ch";
  gap: 0.1em;
  font-size: 5vmin;
  width: min(100vw, 75vh);
  height: calc(min(100vw, 75vh) * 4/3);
  max-width: 100vw;
  max-height: 100vh;
}

@media (orientation: landscape) {
  section.pads {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas: 
      "lt mt ht sp"
      "cp rs oh cb"
      "bd sd ch cy";
    height: min(100vh, 75vw);
    width: calc(min(100vh, 75vw) * 4/3);
    max-width: 100vw;
    max-height: 100vh;
  }
}

section.pads .pad {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--pad-bg);
  color: var(--text-color);
  transition: background 0.3s ease-in, transform 0.3s ease-in;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  --velocity: 1;
  aspect-ratio: 1 / 1; /* Ensure pads are always square */
}

section.pads .pad:active,
section.pads .pad.active {
  background: var(--pad-active);
  transform: scale(0.95);
  transition-duration: 0.1s;
  --velocity: 1;
}

section.pads .pad[data-sound="cb"] { grid-area: cb; }
section.pads .pad[data-sound="cy"] { grid-area: cy; }
section.pads .pad[data-sound="sp"] { grid-area: sp; }
section.pads .pad[data-sound="lt"] { grid-area: lt; }
section.pads .pad[data-sound="mt"] { grid-area: mt; }
section.pads .pad[data-sound="ht"] { grid-area: ht; }
section.pads .pad[data-sound="ch"] { grid-area: ch; }
section.pads .pad[data-sound="oh"] { grid-area: oh; }
section.pads .pad[data-sound="rs"] { grid-area: rs; }
section.pads .pad[data-sound="bd"] { grid-area: bd; }
section.pads .pad[data-sound="sd"] { grid-area: sd; }
section.pads .pad[data-sound="cp"] { grid-area: cp; }
