* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #000;
  background: #fff;
}

.window {
  position: relative;
  width: 800px;
  height: 500px;
  max-width: 100vw;
  max-height: 100vh;
  min-height: 400px;
  background: white;
  overflow: auto;
}

.page {
  position: absolute;
  inset: 20px;
}

.start-page, .game-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.start-page[hidden], .game-page[hidden] {
  display: none;
}

.interval-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.section-title {
  font-size: 20px;
  margin: 0 5px 20px;
}

.interval-list label {
  display: flex;
  align-items: center;
  min-height: 21px;
  margin: 0 5px 5px;
  cursor: default;
}

.interval-list input {
  margin: 3px 4px 3px 4px;
}

button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.green-button {
  height: 30px;
  background: green;
  color: white;
  border: 1px solid #666;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 700;
}

.green-button:hover:not(:disabled) {
  background: lightgreen;
}

.green-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.start-button {
  justify-self: end;
  align-self: center;
  width: 80px;
}

.play-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.note-button {
  width: 150px;
  min-width: 150px;
  margin: 20px;
  white-space: nowrap;
}

.back-button {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 120px;
  height: 30px;
  margin: 0 20px 0;
}

.result-box {
  grid-column: 2;
  align-self: center;
  justify-self: center;
  margin: 20px;
  font-size: 30px;
  text-align: center;
  transform-origin: center;
}

.result-box.pop {
  animation: solution-pop 400ms ease-in-out;
}

@keyframes solution-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.solution-button {
  grid-column: 2;
  align-self: end;
  justify-self: end;
  width: 90px;
  height: 30px;
  margin: 0 20px;
}

@media (max-width: 600px) {
  .window {
    width: 100vw;
    height: 100vh;
  }
  .page {
    inset: 12px;
  }
  .start-page, .game-page {
    grid-template-columns: 1fr 1fr;
  }
  .section-title { font-size: 18px; }
  .note-button { margin: 20px 4px; width: 120px; }
  .back-button { margin-left: 4px; }
  .solution-button { margin-right: 4px; }
  .result-box { font-size: 24px; margin: 4px; }
}
