body {
  background: #008080 url('images/win98-bg-pattern.png') repeat;
  font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
  margin: 0;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
}

/* Container */
#kalimba-container {
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 4px 4px 0 #000;
  flex: 0 0 auto;
}

/* Visualizer */
#visualizer-container {
  width: 100%;
  height: 12px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-sizing: border-box;
  margin: 10px 0;
}

#visualizer-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #000080, #00ffff);
  transition: width 0.05s linear;
}

/* Kalimba layout */
#kalimba {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  padding: 10px;
  background-image: url('images/wood-texture.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px #000;
  max-width: 100%;
}

/* Tines */
.tine {
  flex: 1 1 8%;
  min-width: 28px;
  max-width: 60px;
  aspect-ratio: 1 / 5;
  border-radius: 4px;
  font-size: 11px;
  box-shadow: inset -1px -1px #000, inset 1px 1px #fff;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 6px 0;
}

.tine.pressed {
  transform: translateY(2px);
  background-color: #ccc;
  box-shadow: inset 1px 1px #000, inset -1px -1px #fff;
}

.tine::after {
  content: attr(data-note);
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #000;
}

.tine::before {
  content: attr(data-key);
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: bold;
  color: #333;
}

/* Start bar */
#start-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #000;
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-sizing: border-box;
  z-index: 1000;
}

#start-button {
  margin-right: 6px;
  display: flex;
  align-items: center;
  padding: 2px 6px;
  font-weight: bold;
}

#task-button {
  margin-right: auto;
  font-weight: bold;
}

#task-clock {
  font-size: 12px;
  padding: 4px 8px;
  background: #e0e0e0;
  border: 2px inset #fff;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* Welcome Modal */
#welcome-modal {
  width: 250px;
  position: absolute;
  top: 40px;
  right: 30px;
}

#welcome-modal p {
  font-size: 13px;
}

/* Responsive tweaks */
@media (max-width: 500px) {
  .tine {
    min-width: 30px;
    aspect-ratio: 1 / 4;
    font-size: 10px;
  }

  .tine::before,
  .tine::after {
    font-size: 9px;
  }

  #kalimba {
    gap: 4px;
  }

  #welcome-modal {
    right: 10px;
    top: 10px;
    width: 90vw;
  }

  .window-body {
    padding: 0.5rem;
  }

  #volume {
    height: 24px;
  }

  #start-button,
  #task-button {
    font-size: 11px;
    padding: 2px 4px;
  }
}