:root {
  --bg: #081222;
  --card: #0b1220;
  --accent: #8b5cf6;
  --muted: #9aa4b2;
  --white: #e6eef6;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #002252;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.card {
  width: min(960px, 96%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

header {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #22c1c3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 18px;
}

.lead {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  gap: 12px;
  flex-wrap: wrap;
}

.small-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(90deg, var(--accent), #22c1c3);
  color: white;
  font-weight: 600;
  cursor: pointer
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin: 15px 0px;
}

.piano {
  display: flex;
  position: relative;
  height: 220px;
  user-select: none;
  margin-top: 8px;
}

.key {
  position: relative;
  flex: 1 1 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin: 0 1px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff0 0%, rgba(255, 255, 255, 0.02));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  box-shadow: inset 0 -6px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.key .label {
  pointer-events: none;
}

.key.white {
  background: #f7f7f8;
  color: #0b1220;
}

.key.black {
  background: #111216;
  width: 44px;
  flex: 0 0 44px;
  height: 140px;
  margin: 0 -22px;
  z-index: 2;
  color: var(--white);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  align-self: flex-start;
  padding-bottom: 8px;
}

.key.active {
  outline: 3px solid rgba(99, 102, 241, 0.14);
  transform: translateY(-3px);
}

.piano-row {
  position: relative;
  display: flex;
  width: 100%;
}

/* ensure black keys are positioned over whites */
.black-positions {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 80px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 12px;
}

.black-positions .key.black {
  pointer-events: auto;
}

/* small screen adjustments */
@media (max-width:720px) {
  .piano {
    height: 160px;
  }

  .key.black {
    width: 36px;
    margin: -18px;
    height: 100px;
  }

  .key {
    font-size: 12px;
  }
}